| class info |
| com.huawei.hms.mlsdk.common.MLFrame.Property |
| 帧元数据。 |
| Type | Name | Desc |
| int | IMAGE_FORMAT_NV21 | 定义NV21格式常量,NV21 对应编码格式:YYYYYYYY VU VU。 |
| int | IMAGE_FORMAT_YV12 | 定义YV12格式常量,YV12 对应编码格式:YYYYYYYY VV UU。 |
| int | SCREEN_FIRST_QUADRANT | 相机屏幕方向为正向横屏。 |
| int | SCREEN_FOURTH_QUADRANT | 相机屏幕方向为反向竖屏,基于SCREEN_THIRD_QUADRANT顺时针旋转90度。 |
| int | SCREEN_SECOND_QUADRANT | 相机屏幕方向为正向竖屏,基于SCREEN_FIRST_QUADRANT顺时针旋转90度。 |
| int | SCREEN_THIRD_QUADRANT | 屏幕方向为反向横屏,基于SCREEN_SECOND_QUADRANT顺时针旋转90度。 |
| Constructor name |
| Property() 构造空的帧图像元数据实例。 |
| Property(MLFrame.Property property) 构造特定的帧图像元数据实例 |
| Return type | Method name |
| int | getFormatType() |
| int | getHeight() |
| int | getItemIdentity() |
| int | getQuadrant() |
| long | getTimestamp() |
| int | getWidth() |
| void | resetWidthAndHeight() |
| Constant |
| public static final int IMAGE_FORMAT_NV21 |
| 定义NV21格式常量,NV21对应编码格式:YYYYYYYY VU VU |
| 对应android.graphics.ImageFormat.NV21。 |
| Constant |
| public static final int IMAGE_FORMAT_YV12 |
| 定义YV12格式常量 YV12 对应编码格式:YYYYYYYY VV UU |
| 对应android.graphics.ImageFormat.YV12。 |
| Constant |
| public static final int SCREEN_FIRST_QUADRANT |
| 相机屏幕方向为正向横屏。 |
| Constant Value: 0。 |
| Constant |
| public static final int SCREEN_SECOND_QUADRANT |
| 相机屏幕方向为正向竖屏,基于SCREEN_FIRST_QUADRANT顺时针旋转90度。 |
| Constant Value: 1。 |
| Constant |
| public static final int SCREEN_THIRD_QUADRANT |
| 相机屏幕方向为反向横屏,基于SCREEN_SECOND_QUADRANT顺时针旋转90度。 |
| Constant Value: 2。 |
| Constant |
| public static final int SCREEN_FOURTH_QUADRANT |
| 相机屏幕方向为反向竖屏,基于SCREEN_THIRD_QUADRANT顺时针旋转90度。 |
| Constant Value: 3。 |
| Method |
| public Property() |
| 构造空的帧图像元数据实例。 |
| Method |
| public Property(MLFrame.Property property) |
| 构造特定的帧图像元数据实例。 |
Parameters
| Parameter name | Parameter desc |
| property | 帧图像元数据 |
| Method |
| public int getFormatType() |
| 获取帧格式。 |
Return
| Type | desc |
| int | 帧格式编码,参考android.graphics.Imageformat中的定义。 |
| Method |
| public int getHeight() |
| 获取帧图像高度,单位为像素。 |
Return
| Type | desc |
| int | 帧图像高度 |
| Method |
| public int getItemIdentity() |
| 获取帧ID,相机每生成一帧,都会对该帧进行编号,编号按次序不断加1,用于识别帧之间的生成次序。 |
Return
| Type | desc |
| int | 帧唯一ID,为整数。 |
| Method |
| public int getQuadrant() |
| 获取帧对应的相机屏幕方向。 |
Return
| Type | desc |
| int | 相机屏幕方向: 0:正向横屏 1:正向竖屏 2:反向横屏 3:反向竖屏 |
| Method |
| public long getTimestamp() |
| 获取帧时间戳,帧时间戳:记录系统启动到帧生成的毫秒数,包含设备深度休眠的时间。 |
Return
| Type | desc |
| long | 帧时间戳 |
| Method |
| public int getWidth() |
| 获取帧图像宽度,单位为像素。 |
Return
| Type | desc |
| int | 帧图像宽度 |
| Method |
| public void resetWidthAndHeight() |
| 重置图像元数据到正向横屏方位,如果当前相机屏幕是竖向的,则需要交换宽、高的数值。 |