|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __MPP_FRAME_H__ |
|
#define __MPP_FRAME_H__ |
|
|
|
#include "mpp_buffer.h" |
|
#include "mpp_meta.h" |
|
|
|
|
|
|
|
|
|
|
|
#define MPP_FRAME_FLAG_FRAME (0x00000000) |
|
|
|
#define MPP_FRAME_FLAG_TOP_FIELD (0x00000001) |
|
|
|
#define MPP_FRAME_FLAG_BOT_FIELD (0x00000002) |
|
|
|
#define MPP_FRAME_FLAG_PAIRED_FIELD (MPP_FRAME_FLAG_TOP_FIELD|MPP_FRAME_FLAG_BOT_FIELD) |
|
|
|
#define MPP_FRAME_FLAG_TOP_FIRST (0x00000004) |
|
|
|
#define MPP_FRAME_FLAG_BOT_FIRST (0x00000008) |
|
|
|
#define MPP_FRAME_FLAG_DEINTERLACED (MPP_FRAME_FLAG_TOP_FIRST|MPP_FRAME_FLAG_BOT_FIRST) |
|
#define MPP_FRAME_FLAG_FIELD_ORDER_MASK (0x0000000C) |
|
|
|
#define MPP_FRAME_FLAG_VIEW_ID_MASK (0x000000f0) |
|
|
|
#define MPP_FRAME_FLAG_IEP_DEI_MASK (0x00000f00) |
|
#define MPP_FRAME_FLAG_IEP_DEI_I2O1 (0x00000100) |
|
#define MPP_FRAME_FLAG_IEP_DEI_I4O2 (0x00000200) |
|
#define MPP_FRAME_FLAG_IEP_DEI_I4O1 (0x00000300) |
|
|
|
|
|
|
|
|
|
typedef enum { |
|
MPP_FRAME_RANGE_UNSPECIFIED = 0, |
|
MPP_FRAME_RANGE_MPEG = 1, |
|
MPP_FRAME_RANGE_JPEG = 2, |
|
MPP_FRAME_RANGE_NB, |
|
} MppFrameColorRange; |
|
|
|
typedef enum { |
|
MPP_FRAME_VIDEO_FMT_COMPONEMT = 0, |
|
MPP_FRAME_VIDEO_FMT_PAL = 1, |
|
MPP_FRAME_VIDEO_FMT_NTSC = 2, |
|
MPP_FRAME_VIDEO_FMT_SECAM = 3, |
|
MPP_FRAME_VIDEO_FMT_MAC = 4, |
|
MPP_FRAME_VIDEO_FMT_UNSPECIFIED = 5, |
|
MPP_FRAME_VIDEO_FMT_RESERVED0 = 6, |
|
MPP_FRAME_VIDEO_FMT_RESERVED1 = 7, |
|
} MppFrameVideoFormat; |
|
|
|
|
|
|
|
|
|
typedef enum { |
|
MPP_FRAME_PRI_RESERVED0 = 0, |
|
MPP_FRAME_PRI_BT709 = 1, |
|
MPP_FRAME_PRI_UNSPECIFIED = 2, |
|
MPP_FRAME_PRI_RESERVED = 3, |
|
MPP_FRAME_PRI_BT470M = 4, |
|
|
|
MPP_FRAME_PRI_BT470BG = 5, |
|
MPP_FRAME_PRI_SMPTE170M = 6, |
|
MPP_FRAME_PRI_SMPTE240M = 7, |
|
MPP_FRAME_PRI_FILM = 8, |
|
MPP_FRAME_PRI_BT2020 = 9, |
|
MPP_FRAME_PRI_SMPTEST428_1 = 10, |
|
MPP_FRAME_PRI_SMPTE431 = 11, |
|
MPP_FRAME_PRI_SMPTE432 = 12, |
|
MPP_FRAME_PRI_JEDEC_P22 = 22, |
|
MPP_FRAME_PRI_NB, |
|
} MppFrameColorPrimaries; |
|
|
|
|
|
|
|
|
|
typedef enum { |
|
MPP_FRAME_TRC_RESERVED0 = 0, |
|
MPP_FRAME_TRC_BT709 = 1, |
|
MPP_FRAME_TRC_UNSPECIFIED = 2, |
|
MPP_FRAME_TRC_RESERVED = 3, |
|
MPP_FRAME_TRC_GAMMA22 = 4, |
|
MPP_FRAME_TRC_GAMMA28 = 5, |
|
MPP_FRAME_TRC_SMPTE170M = 6, |
|
MPP_FRAME_TRC_SMPTE240M = 7, |
|
MPP_FRAME_TRC_LINEAR = 8, |
|
MPP_FRAME_TRC_LOG = 9, |
|
MPP_FRAME_TRC_LOG_SQRT = 10, |
|
MPP_FRAME_TRC_IEC61966_2_4 = 11, |
|
MPP_FRAME_TRC_BT1361_ECG = 12, |
|
MPP_FRAME_TRC_IEC61966_2_1 = 13, |
|
MPP_FRAME_TRC_BT2020_10 = 14, |
|
MPP_FRAME_TRC_BT2020_12 = 15, |
|
MPP_FRAME_TRC_SMPTEST2084 = 16, |
|
MPP_FRAME_TRC_SMPTEST428_1 = 17, |
|
MPP_FRAME_TRC_ARIB_STD_B67 = 18, |
|
MPP_FRAME_TRC_NB, |
|
} MppFrameColorTransferCharacteristic; |
|
|
|
|
|
|
|
|
|
typedef enum { |
|
MPP_FRAME_SPC_RGB = 0, |
|
MPP_FRAME_SPC_BT709 = 1, |
|
MPP_FRAME_SPC_UNSPECIFIED = 2, |
|
MPP_FRAME_SPC_RESERVED = 3, |
|
MPP_FRAME_SPC_FCC = 4, |
|
MPP_FRAME_SPC_BT470BG = 5, |
|
MPP_FRAME_SPC_SMPTE170M = 6, |
|
MPP_FRAME_SPC_SMPTE240M = 7, |
|
MPP_FRAME_SPC_YCOCG = 8, |
|
MPP_FRAME_SPC_BT2020_NCL = 9, |
|
MPP_FRAME_SPC_BT2020_CL = 10, |
|
MPP_FRAME_SPC_SMPTE2085 = 11, |
|
MPP_FRAME_SPC_CHROMA_DERIVED_NCL = 12, |
|
MPP_FRAME_SPC_CHROMA_DERIVED_CL = 13, |
|
MPP_FRAME_SPC_ICTCP = 14, |
|
MPP_FRAME_SPC_NB, |
|
} MppFrameColorSpace; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum { |
|
MPP_CHROMA_LOC_UNSPECIFIED = 0, |
|
MPP_CHROMA_LOC_LEFT = 1, |
|
MPP_CHROMA_LOC_CENTER = 2, |
|
MPP_CHROMA_LOC_TOPLEFT = 3, |
|
MPP_CHROMA_LOC_TOP = 4, |
|
MPP_CHROMA_LOC_BOTTOMLEFT = 5, |
|
MPP_CHROMA_LOC_BOTTOM = 6, |
|
MPP_CHROMA_LOC_NB, |
|
} MppFrameChromaLocation; |
|
|
|
#define MPP_FRAME_FMT_MASK (0x000fffff) |
|
|
|
#define MPP_FRAME_FMT_COLOR_MASK (0x000f0000) |
|
#define MPP_FRAME_FMT_YUV (0x00000000) |
|
#define MPP_FRAME_FMT_RGB (0x00010000) |
|
|
|
#define MPP_FRAME_FBC_MASK (0x00f00000) |
|
#define MPP_FRAME_FBC_NONE (0x00000000) |
|
|
|
#define MPP_FRAME_HDR_MASK (0x0f000000) |
|
#define MPP_FRAME_HDR_NONE (0x00000000) |
|
|
|
#define MPP_FRAME_HDR (0x01000000) |
|
|
|
|
|
|
|
|
|
|
|
|
|
#define MPP_FRAME_FBC_AFBC_V1 (0x00100000) |
|
|
|
|
|
|
|
|
|
|
|
#define MPP_FRAME_FBC_AFBC_V2 (0x00200000) |
|
|
|
#define MPP_FRAME_FMT_LE_MASK (0x01000000) |
|
|
|
#define MPP_FRAME_FMT_IS_YUV(fmt) (((fmt & MPP_FRAME_FMT_COLOR_MASK) == MPP_FRAME_FMT_YUV) && \ |
|
((fmt & MPP_FRAME_FMT_MASK) < MPP_FMT_YUV_BUTT)) |
|
#define MPP_FRAME_FMT_IS_YUV_10BIT(fmt) ((fmt & MPP_FRAME_FMT_MASK) == MPP_FMT_YUV420SP_10BIT || \ |
|
(fmt & MPP_FRAME_FMT_MASK) == MPP_FMT_YUV422SP_10BIT) |
|
#define MPP_FRAME_FMT_IS_RGB(fmt) (((fmt & MPP_FRAME_FMT_COLOR_MASK) == MPP_FRAME_FMT_RGB) && \ |
|
((fmt & MPP_FRAME_FMT_MASK) < MPP_FMT_RGB_BUTT)) |
|
|
|
|
|
|
|
|
|
#define MPP_FRAME_FMT_IS_FBC(fmt) (fmt & MPP_FRAME_FBC_MASK) |
|
|
|
#define MPP_FRAME_FMT_IS_HDR(fmt) (fmt & MPP_FRAME_HDR_MASK) |
|
|
|
#define MPP_FRAME_FMT_IS_LE(fmt) ((fmt & MPP_FRAME_FMT_LE_MASK) == MPP_FRAME_FMT_LE_MASK) |
|
#define MPP_FRAME_FMT_IS_BE(fmt) ((fmt & MPP_FRAME_FMT_LE_MASK) == 0) |
|
|
|
|
|
typedef enum { |
|
MPP_FMT_YUV420SP = (MPP_FRAME_FMT_YUV + 0), |
|
|
|
|
|
|
|
|
|
MPP_FMT_YUV420SP_10BIT = (MPP_FRAME_FMT_YUV + 1), |
|
MPP_FMT_YUV422SP = (MPP_FRAME_FMT_YUV + 2), |
|
MPP_FMT_YUV422SP_10BIT = (MPP_FRAME_FMT_YUV + 3), |
|
MPP_FMT_YUV420P = (MPP_FRAME_FMT_YUV + 4), |
|
MPP_FMT_YUV420SP_VU = (MPP_FRAME_FMT_YUV + 5), |
|
MPP_FMT_YUV422P = (MPP_FRAME_FMT_YUV + 6), |
|
MPP_FMT_YUV422SP_VU = (MPP_FRAME_FMT_YUV + 7), |
|
MPP_FMT_YUV422_YUYV = (MPP_FRAME_FMT_YUV + 8), |
|
MPP_FMT_YUV422_YVYU = (MPP_FRAME_FMT_YUV + 9), |
|
MPP_FMT_YUV422_UYVY = (MPP_FRAME_FMT_YUV + 10), |
|
MPP_FMT_YUV422_VYUY = (MPP_FRAME_FMT_YUV + 11), |
|
MPP_FMT_YUV400 = (MPP_FRAME_FMT_YUV + 12), |
|
MPP_FMT_YUV440SP = (MPP_FRAME_FMT_YUV + 13), |
|
MPP_FMT_YUV411SP = (MPP_FRAME_FMT_YUV + 14), |
|
MPP_FMT_YUV444SP = (MPP_FRAME_FMT_YUV + 15), |
|
MPP_FMT_YUV444P = (MPP_FRAME_FMT_YUV + 16), |
|
MPP_FMT_YUV_BUTT, |
|
|
|
MPP_FMT_RGB565 = (MPP_FRAME_FMT_RGB + 0), |
|
MPP_FMT_BGR565 = (MPP_FRAME_FMT_RGB + 1), |
|
MPP_FMT_RGB555 = (MPP_FRAME_FMT_RGB + 2), |
|
MPP_FMT_BGR555 = (MPP_FRAME_FMT_RGB + 3), |
|
MPP_FMT_RGB444 = (MPP_FRAME_FMT_RGB + 4), |
|
MPP_FMT_BGR444 = (MPP_FRAME_FMT_RGB + 5), |
|
MPP_FMT_RGB888 = (MPP_FRAME_FMT_RGB + 6), |
|
MPP_FMT_BGR888 = (MPP_FRAME_FMT_RGB + 7), |
|
MPP_FMT_RGB101010 = (MPP_FRAME_FMT_RGB + 8), |
|
MPP_FMT_BGR101010 = (MPP_FRAME_FMT_RGB + 9), |
|
MPP_FMT_ARGB8888 = (MPP_FRAME_FMT_RGB + 10), |
|
MPP_FMT_ABGR8888 = (MPP_FRAME_FMT_RGB + 11), |
|
MPP_FMT_BGRA8888 = (MPP_FRAME_FMT_RGB + 12), |
|
MPP_FMT_RGBA8888 = (MPP_FRAME_FMT_RGB + 13), |
|
MPP_FMT_RGB_BUTT, |
|
|
|
MPP_FMT_BUTT, |
|
} MppFrameFormat; |
|
|
|
|
|
|
|
|
|
typedef struct MppFrameRational { |
|
RK_S32 num; |
|
RK_S32 den; |
|
} MppFrameRational; |
|
|
|
typedef struct MppFrameMasteringDisplayMetadata { |
|
RK_U16 display_primaries[3][2]; |
|
RK_U16 white_point[2]; |
|
RK_U32 max_luminance; |
|
RK_U32 min_luminance; |
|
} MppFrameMasteringDisplayMetadata; |
|
|
|
typedef struct MppFrameContentLightMetadata { |
|
RK_U16 MaxCLL; |
|
RK_U16 MaxFALL; |
|
} MppFrameContentLightMetadata; |
|
|
|
typedef struct MppFrameHdrDynamicMeta { |
|
RK_U32 hdr_fmt; |
|
RK_U32 size; |
|
RK_U8 data[]; |
|
} MppFrameHdrDynamicMeta; |
|
|
|
typedef enum MppFrameError { |
|
|
|
MPP_FRAME_ERR_UNKNOW = 0x0001, |
|
|
|
|
|
MPP_FRAME_ERR_UNSUPPORT = 0x0002, |
|
|
|
|
|
|
|
|
|
|
|
MPP_FRAME_ERR_DEC_INVALID = 0x0010, |
|
|
|
|
|
|
|
|
|
MPP_FRAME_ERR_DEC_HW_ERR = 0x0100, |
|
|
|
|
|
|
|
|
|
MPP_FRAME_ERR_DEC_MISS_REF = 0x0200, |
|
} MppFrameError; |
|
|
|
#ifdef __cplusplus |
|
extern "C" { |
|
#endif |
|
|
|
|
|
|
|
|
|
MPP_RET mpp_frame_init(MppFrame *frame); |
|
MPP_RET mpp_frame_deinit(MppFrame *frame); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RK_U32 mpp_frame_get_width(const MppFrame frame); |
|
void mpp_frame_set_width(MppFrame frame, RK_U32 width); |
|
RK_U32 mpp_frame_get_height(const MppFrame frame); |
|
void mpp_frame_set_height(MppFrame frame, RK_U32 height); |
|
RK_U32 mpp_frame_get_hor_stride(const MppFrame frame); |
|
void mpp_frame_set_hor_stride(MppFrame frame, RK_U32 hor_stride); |
|
RK_U32 mpp_frame_get_ver_stride(const MppFrame frame); |
|
void mpp_frame_set_ver_stride(MppFrame frame, RK_U32 ver_stride); |
|
void mpp_frame_set_hor_stride_pixel(MppFrame frame, RK_U32 hor_stride_pixel); |
|
RK_U32 mpp_frame_get_hor_stride_pixel(const MppFrame frame); |
|
void mpp_frame_set_fbc_hdr_stride(MppFrame frame, RK_U32 fbc_hdr_stride); |
|
RK_U32 mpp_frame_get_fbc_hdr_stride(const MppFrame frame); |
|
|
|
RK_U32 mpp_frame_get_offset_x(const MppFrame frame); |
|
void mpp_frame_set_offset_x(MppFrame frame, RK_U32 offset_x); |
|
RK_U32 mpp_frame_get_offset_y(const MppFrame frame); |
|
void mpp_frame_set_offset_y(MppFrame frame, RK_U32 offset_y); |
|
RK_U32 mpp_frame_get_mode(const MppFrame frame); |
|
void mpp_frame_set_mode(MppFrame frame, RK_U32 mode); |
|
RK_U32 mpp_frame_get_discard(const MppFrame frame); |
|
void mpp_frame_set_discard(MppFrame frame, RK_U32 discard); |
|
RK_U32 mpp_frame_get_viewid(const MppFrame frame); |
|
void mpp_frame_set_viewid(MppFrame frame, RK_U32 viewid); |
|
RK_U32 mpp_frame_get_poc(const MppFrame frame); |
|
void mpp_frame_set_poc(MppFrame frame, RK_U32 poc); |
|
RK_S64 mpp_frame_get_pts(const MppFrame frame); |
|
void mpp_frame_set_pts(MppFrame frame, RK_S64 pts); |
|
RK_S64 mpp_frame_get_dts(const MppFrame frame); |
|
void mpp_frame_set_dts(MppFrame frame, RK_S64 dts); |
|
RK_U32 mpp_frame_get_errinfo(const MppFrame frame); |
|
void mpp_frame_set_errinfo(MppFrame frame, RK_U32 errinfo); |
|
size_t mpp_frame_get_buf_size(const MppFrame frame); |
|
void mpp_frame_set_buf_size(MppFrame frame, size_t buf_size); |
|
void mpp_frame_set_thumbnail_en(MppFrame frame, RK_U32 thumbnail_en); |
|
RK_U32 mpp_frame_get_thumbnail_en(const MppFrame frame); |
|
|
|
|
|
|
|
|
|
RK_U32 mpp_frame_get_eos(const MppFrame frame); |
|
void mpp_frame_set_eos(MppFrame frame, RK_U32 eos); |
|
RK_U32 mpp_frame_get_info_change(const MppFrame frame); |
|
void mpp_frame_set_info_change(MppFrame frame, RK_U32 info_change); |
|
|
|
|
|
|
|
|
|
MppBuffer mpp_frame_get_buffer(const MppFrame frame); |
|
void mpp_frame_set_buffer(MppFrame frame, MppBuffer buffer); |
|
|
|
|
|
|
|
|
|
RK_S32 mpp_frame_has_meta(const MppFrame frame); |
|
MppMeta mpp_frame_get_meta(const MppFrame frame); |
|
void mpp_frame_set_meta(MppFrame frame, MppMeta meta); |
|
|
|
|
|
|
|
|
|
MppFrameColorRange mpp_frame_get_color_range(const MppFrame frame); |
|
void mpp_frame_set_color_range(MppFrame frame, MppFrameColorRange color_range); |
|
MppFrameColorPrimaries mpp_frame_get_color_primaries(const MppFrame frame); |
|
void mpp_frame_set_color_primaries(MppFrame frame, MppFrameColorPrimaries color_primaries); |
|
MppFrameColorTransferCharacteristic mpp_frame_get_color_trc(const MppFrame frame); |
|
void mpp_frame_set_color_trc(MppFrame frame, MppFrameColorTransferCharacteristic color_trc); |
|
MppFrameColorSpace mpp_frame_get_colorspace(const MppFrame frame); |
|
void mpp_frame_set_colorspace(MppFrame frame, MppFrameColorSpace colorspace); |
|
MppFrameChromaLocation mpp_frame_get_chroma_location(const MppFrame frame); |
|
void mpp_frame_set_chroma_location(MppFrame frame, MppFrameChromaLocation chroma_location); |
|
MppFrameFormat mpp_frame_get_fmt(MppFrame frame); |
|
void mpp_frame_set_fmt(MppFrame frame, MppFrameFormat fmt); |
|
MppFrameRational mpp_frame_get_sar(const MppFrame frame); |
|
void mpp_frame_set_sar(MppFrame frame, MppFrameRational sar); |
|
MppFrameMasteringDisplayMetadata mpp_frame_get_mastering_display(const MppFrame frame); |
|
void mpp_frame_set_mastering_display(MppFrame frame, MppFrameMasteringDisplayMetadata mastering_display); |
|
MppFrameContentLightMetadata mpp_frame_get_content_light(const MppFrame frame); |
|
void mpp_frame_set_content_light(MppFrame frame, MppFrameContentLightMetadata content_light); |
|
MppFrameHdrDynamicMeta* mpp_frame_get_hdr_dynamic_meta(const MppFrame frame); |
|
void mpp_frame_set_hdr_dynamic_meta(MppFrame frame, MppFrameHdrDynamicMeta *vivi_data); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
} |
|
#endif |
|
|
|
#endif |
|
|