目录

class info
com.huawei.hms.mlsdk.common.MLFrame.Property
Frame metadata.

Constant Summary

TypeNameDesc
intIMAGE_FORMAT_NV21Constant in NV21 format, which corresponds to the YYYYYYYY VU VU encoding format.
intIMAGE_FORMAT_YV12Constant in YV12 format, which corresponds to the YYYYYYYY VV UU encoding format.
intSCREEN_FIRST_QUADRANTLandscape.
intSCREEN_FOURTH_QUADRANTReverse portrait, which is 90 degrees clockwise from SCREEN_THIRD_QUADRANT.
intSCREEN_SECOND_QUADRANTPortrait, which is 90 degrees clockwise from SCREEN_FIRST_QUADRANT.
intSCREEN_THIRD_QUADRANTReverse landscape, which is 90 degrees clockwise from SCREEN_SECOND_QUADRANT.

Public Constructor Summary

Constructor name
Property()
Creates an empty instance of MLFrame.Property.
Property(MLFrame.Property property)
Creates a specified instance of MLFrame.Property.

Public Method Summary

Return typeMethod name
intgetFormatType()
intgetHeight()
intgetItemIdentity()
intgetQuadrant()
longgetTimestamp()
intgetWidth()
voidresetWidthAndHeight()

Constants

Constant
public static final int IMAGE_FORMAT_NV21
Constant in NV21 format, which corresponds to the YYYYYYYY VU VU encoding format.The NV21 format corresponds to android.graphics.ImageFormat.NV21.
Constant
public static final int IMAGE_FORMAT_YV12
Constant in YV12 format, which corresponds to the YYYYYYYY VV UU encoding format.The YV12 format corresponds to android.graphics.ImageFormat.YV12.
Constant
public static final int SCREEN_FIRST_QUADRANT
Landscape.
Constant value: 0
Constant
public static final int SCREEN_SECOND_QUADRANT
Portrait, which is 90 degrees clockwise from SCREEN_FIRST_QUADRANT.
Constant value: 1
Constant
public static final int SCREEN_THIRD_QUADRANT
Reverse landscape, which is 90 degrees clockwise from SCREEN_SECOND_QUADRANT.
Constant value: 2
Constant
public static final int SCREEN_FOURTH_QUADRANT
Reverse portrait, which is 90 degrees clockwise from SCREEN_THIRD_QUADRANT.
Constant value: 3

Public Constructors

Method
public Property()
Creates an empty instance of MLFrame.Property.
Method
public Property(MLFrame.Property property)
Creates a specified instance of MLFrame.Property.

Parameters

Parameter nameParameter desc
propertyFrame metadata

Public Methods

Method
public int getFormatType()
Obtains the frame format.

Return

Typedesc
intFrame format code. For details, please refer to the definition in android.graphics.Imageformat.
Method
public int getHeight()
Obtains the frame height, in pixels.

Return

Typedesc
intFrame height
Method
public int getItemIdentity()
Obtains the ID of a frame. The camera uses a unique ID to number each generated frame in sequence by an increment of 1.

Return

Typedesc
intUnique frame ID, which is an integer.
Method
public int getQuadrant()
Obtains the screen orientation of a frame.

Return

Typedesc
intScreen orientation. The options are as follows:
0: landscape
1: portrait
2: reverse landscape
3: reverse portrait
Method
public long getTimestamp()
Obtains the timestamp of a frame. The timestamp records the number of milliseconds between the system start time and the frame generation time, including the deep sleep time of the device.

Return

Typedesc
longTimestamp of a frame
Method
public int getWidth()
Obtains the frame width, in pixels.

Return

Typedesc
intFrame width
Method
public void resetWidthAndHeight()
Resets the height and width of an image in portrait mode to the corresponding height and width in landscape mode.