1 /* 2 * Copyright 2015 Rockchip Electronics Co. LTD 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __MPP_FRAME_H__ 18 #define __MPP_FRAME_H__ 19 20 #include "mpp_buffer.h" 21 #include "mpp_meta.h" 22 23 /* 24 * bit definition for mode flag in MppFrame 25 */ 26 /* progressive frame */ 27 #define MPP_FRAME_FLAG_FRAME (0x00000000) 28 /* top field only */ 29 #define MPP_FRAME_FLAG_TOP_FIELD (0x00000001) 30 /* bottom field only */ 31 #define MPP_FRAME_FLAG_BOT_FIELD (0x00000002) 32 /* paired field */ 33 #define MPP_FRAME_FLAG_PAIRED_FIELD (MPP_FRAME_FLAG_TOP_FIELD|MPP_FRAME_FLAG_BOT_FIELD) 34 /* paired field with field order of top first */ 35 #define MPP_FRAME_FLAG_TOP_FIRST (0x00000004) 36 /* paired field with field order of bottom first */ 37 #define MPP_FRAME_FLAG_BOT_FIRST (0x00000008) 38 /* paired field with unknown field order (MBAFF) */ 39 #define MPP_FRAME_FLAG_DEINTERLACED (MPP_FRAME_FLAG_TOP_FIRST|MPP_FRAME_FLAG_BOT_FIRST) 40 #define MPP_FRAME_FLAG_FIELD_ORDER_MASK (0x0000000C) 41 // for multiview stream 42 #define MPP_FRAME_FLAG_VIEW_ID_MASK (0x000000f0) 43 44 #define MPP_FRAME_FLAG_IEP_DEI_MASK (0x00000f00) 45 #define MPP_FRAME_FLAG_IEP_DEI_I2O1 (0x00000100) 46 #define MPP_FRAME_FLAG_IEP_DEI_I4O2 (0x00000200) 47 #define MPP_FRAME_FLAG_IEP_DEI_I4O1 (0x00000300) 48 49 /* 50 * MPEG vs JPEG YUV range. 51 */ 52 typedef enum { 53 MPP_FRAME_RANGE_UNSPECIFIED = 0, 54 MPP_FRAME_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges 55 MPP_FRAME_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges 56 MPP_FRAME_RANGE_NB, ///< Not part of ABI 57 } MppFrameColorRange; 58 59 typedef enum { 60 MPP_FRAME_VIDEO_FMT_COMPONEMT = 0, 61 MPP_FRAME_VIDEO_FMT_PAL = 1, 62 MPP_FRAME_VIDEO_FMT_NTSC = 2, 63 MPP_FRAME_VIDEO_FMT_SECAM = 3, 64 MPP_FRAME_VIDEO_FMT_MAC = 4, 65 MPP_FRAME_VIDEO_FMT_UNSPECIFIED = 5, 66 MPP_FRAME_VIDEO_FMT_RESERVED0 = 6, 67 MPP_FRAME_VIDEO_FMT_RESERVED1 = 7, 68 } MppFrameVideoFormat; 69 70 /* 71 * Chromaticity coordinates of the source primaries. 72 */ 73 typedef enum { 74 MPP_FRAME_PRI_RESERVED0 = 0, 75 MPP_FRAME_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B 76 MPP_FRAME_PRI_UNSPECIFIED = 2, 77 MPP_FRAME_PRI_RESERVED = 3, 78 MPP_FRAME_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) 79 80 MPP_FRAME_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM 81 MPP_FRAME_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC/SMPTE ST 170 (2004) 82 MPP_FRAME_PRI_SMPTE240M = 7, ///< functionally identical to above/SMPTE ST 240 83 MPP_FRAME_PRI_FILM = 8, ///< colour filters using Illuminant C 84 MPP_FRAME_PRI_BT2020 = 9, ///< ITU-R BT2020 / ITU-R BT.2100-2 85 MPP_FRAME_PRI_SMPTEST428_1 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ) 86 MPP_FRAME_PRI_SMPTE431 = 11, ///< SMPTE ST 431-2 (2011) / DCI P3 87 MPP_FRAME_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 (2010) / P3 D65 / Display P3 88 MPP_FRAME_PRI_JEDEC_P22 = 22, ///< JEDEC P22 phosphors 89 MPP_FRAME_PRI_NB, ///< Not part of ABI 90 } MppFrameColorPrimaries; 91 92 /* 93 * Color Transfer Characteristic. 94 */ 95 typedef enum { 96 MPP_FRAME_TRC_RESERVED0 = 0, 97 MPP_FRAME_TRC_BT709 = 1, ///< also ITU-R BT1361 98 MPP_FRAME_TRC_UNSPECIFIED = 2, 99 MPP_FRAME_TRC_RESERVED = 3, 100 MPP_FRAME_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM 101 MPP_FRAME_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG 102 MPP_FRAME_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC 103 MPP_FRAME_TRC_SMPTE240M = 7, 104 MPP_FRAME_TRC_LINEAR = 8, ///< "Linear transfer characteristics" 105 MPP_FRAME_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" 106 MPP_FRAME_TRC_LOG_SQRT = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" 107 MPP_FRAME_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 108 MPP_FRAME_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut 109 MPP_FRAME_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) 110 MPP_FRAME_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10 bit system 111 MPP_FRAME_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12 bit system 112 MPP_FRAME_TRC_SMPTEST2084 = 16, ///< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems 113 MPP_FRAME_TRC_SMPTEST428_1 = 17, ///< SMPTE ST 428-1 114 MPP_FRAME_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma" 115 MPP_FRAME_TRC_NB, ///< Not part of ABI 116 } MppFrameColorTransferCharacteristic; 117 118 /* 119 * YUV colorspace type. 120 */ 121 typedef enum { 122 MPP_FRAME_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB) 123 MPP_FRAME_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B 124 MPP_FRAME_SPC_UNSPECIFIED = 2, 125 MPP_FRAME_SPC_RESERVED = 3, 126 MPP_FRAME_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) 127 MPP_FRAME_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 128 MPP_FRAME_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above 129 MPP_FRAME_SPC_SMPTE240M = 7, 130 MPP_FRAME_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 131 MPP_FRAME_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system 132 MPP_FRAME_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system 133 MPP_FRAME_SPC_SMPTE2085 = 11, ///< SMPTE 2085, Y'D'zD'x 134 MPP_FRAME_SPC_CHROMA_DERIVED_NCL = 12, ///< Chromaticity-derived non-constant luminance system 135 MPP_FRAME_SPC_CHROMA_DERIVED_CL = 13, ///< Chromaticity-derived constant luminance system 136 MPP_FRAME_SPC_ICTCP = 14, ///< ITU-R BT.2100-0, ICtCp 137 MPP_FRAME_SPC_NB, ///< Not part of ABI 138 } MppFrameColorSpace; 139 140 /* 141 * Location of chroma samples. 142 * 143 * Illustration showing the location of the first (top left) chroma sample of the 144 * image, the left shows only luma, the right 145 * shows the location of the chroma sample, the 2 could be imagined to overlay 146 * each other but are drawn separately due to limitations of ASCII 147 * 148 * 1st 2nd 1st 2nd horizontal luma sample positions 149 * v v v v 150 * ______ ______ 151 *1st luma line > |X X ... |3 4 X ... X are luma samples, 152 * | |1 2 1-6 are possible chroma positions 153 *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position 154 */ 155 typedef enum { 156 MPP_CHROMA_LOC_UNSPECIFIED = 0, 157 MPP_CHROMA_LOC_LEFT = 1, ///< mpeg2/4 4:2:0, h264 default for 4:2:0 158 MPP_CHROMA_LOC_CENTER = 2, ///< mpeg1 4:2:0, jpeg 4:2:0, h263 4:2:0 159 MPP_CHROMA_LOC_TOPLEFT = 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 160 MPP_CHROMA_LOC_TOP = 4, 161 MPP_CHROMA_LOC_BOTTOMLEFT = 5, 162 MPP_CHROMA_LOC_BOTTOM = 6, 163 MPP_CHROMA_LOC_NB, ///< Not part of ABI 164 } MppFrameChromaLocation; 165 166 #define MPP_FRAME_FMT_MASK (0x000fffff) 167 168 #define MPP_FRAME_FMT_COLOR_MASK (0x000f0000) 169 #define MPP_FRAME_FMT_YUV (0x00000000) 170 #define MPP_FRAME_FMT_RGB (0x00010000) 171 172 #define MPP_FRAME_FBC_MASK (0x00f00000) 173 #define MPP_FRAME_FBC_NONE (0x00000000) 174 175 #define MPP_FRAME_HDR_MASK (0x0f000000) 176 #define MPP_FRAME_HDR_NONE (0x00000000) 177 178 #define MPP_FRAME_HDR (0x01000000) 179 180 /* 181 * AFBC_V1 is for ISP output. 182 * It has default payload offset to be calculated * from width and height: 183 * Payload offset = MPP_ALIGN(MPP_ALIGN(width, 16) * MPP_ALIGN(height, 16) / 16, SZ_4K) 184 */ 185 #define MPP_FRAME_FBC_AFBC_V1 (0x00100000) 186 /* 187 * AFBC_V2 is for video decoder output. 188 * It stores payload offset in first 32-bit in header address 189 * Payload offset is always set to zero. 190 */ 191 #define MPP_FRAME_FBC_AFBC_V2 (0x00200000) 192 193 #define MPP_FRAME_FMT_LE_MASK (0x01000000) 194 195 #define MPP_FRAME_FMT_IS_YUV(fmt) (((fmt & MPP_FRAME_FMT_COLOR_MASK) == MPP_FRAME_FMT_YUV) && \ 196 ((fmt & MPP_FRAME_FMT_MASK) < MPP_FMT_YUV_BUTT)) 197 #define MPP_FRAME_FMT_IS_YUV_10BIT(fmt) ((fmt & MPP_FRAME_FMT_MASK) == MPP_FMT_YUV420SP_10BIT || \ 198 (fmt & MPP_FRAME_FMT_MASK) == MPP_FMT_YUV422SP_10BIT) 199 #define MPP_FRAME_FMT_IS_RGB(fmt) (((fmt & MPP_FRAME_FMT_COLOR_MASK) == MPP_FRAME_FMT_RGB) && \ 200 ((fmt & MPP_FRAME_FMT_MASK) < MPP_FMT_RGB_BUTT)) 201 202 /* 203 * For MPP_FRAME_FBC_AFBC_V1 the 16byte aligned stride is used. 204 */ 205 #define MPP_FRAME_FMT_IS_FBC(fmt) (fmt & MPP_FRAME_FBC_MASK) 206 207 #define MPP_FRAME_FMT_IS_HDR(fmt) (fmt & MPP_FRAME_HDR_MASK) 208 209 #define MPP_FRAME_FMT_IS_LE(fmt) ((fmt & MPP_FRAME_FMT_LE_MASK) == MPP_FRAME_FMT_LE_MASK) 210 #define MPP_FRAME_FMT_IS_BE(fmt) ((fmt & MPP_FRAME_FMT_LE_MASK) == 0) 211 212 /* mpp color format index definition */ 213 typedef enum { 214 MPP_FMT_YUV420SP = (MPP_FRAME_FMT_YUV + 0), /* YYYY... UV... (NV12) */ 215 /* 216 * A rockchip specific pixel format, without gap between pixel aganist 217 * the P010_10LE/P010_10BE 218 */ 219 MPP_FMT_YUV420SP_10BIT = (MPP_FRAME_FMT_YUV + 1), 220 MPP_FMT_YUV422SP = (MPP_FRAME_FMT_YUV + 2), /* YYYY... UVUV... (NV16) */ 221 MPP_FMT_YUV422SP_10BIT = (MPP_FRAME_FMT_YUV + 3), ///< Not part of ABI 222 MPP_FMT_YUV420P = (MPP_FRAME_FMT_YUV + 4), /* YYYY... U...V... (I420) */ 223 MPP_FMT_YUV420SP_VU = (MPP_FRAME_FMT_YUV + 5), /* YYYY... VUVUVU... (NV21) */ 224 MPP_FMT_YUV422P = (MPP_FRAME_FMT_YUV + 6), /* YYYY... UU...VV...(422P) */ 225 MPP_FMT_YUV422SP_VU = (MPP_FRAME_FMT_YUV + 7), /* YYYY... VUVUVU... (NV61) */ 226 MPP_FMT_YUV422_YUYV = (MPP_FRAME_FMT_YUV + 8), /* YUYVYUYV... (YUY2) */ 227 MPP_FMT_YUV422_YVYU = (MPP_FRAME_FMT_YUV + 9), /* YVYUYVYU... (YVY2) */ 228 MPP_FMT_YUV422_UYVY = (MPP_FRAME_FMT_YUV + 10), /* UYVYUYVY... (UYVY) */ 229 MPP_FMT_YUV422_VYUY = (MPP_FRAME_FMT_YUV + 11), /* VYUYVYUY... (VYUY) */ 230 MPP_FMT_YUV400 = (MPP_FRAME_FMT_YUV + 12), /* YYYY... */ 231 MPP_FMT_YUV440SP = (MPP_FRAME_FMT_YUV + 13), /* YYYY... UVUV... */ 232 MPP_FMT_YUV411SP = (MPP_FRAME_FMT_YUV + 14), /* YYYY... UV... */ 233 MPP_FMT_YUV444SP = (MPP_FRAME_FMT_YUV + 15), /* YYYY... UVUVUVUV... */ 234 MPP_FMT_YUV444P = (MPP_FRAME_FMT_YUV + 16), /* YYYY... UUUU... VVVV... */ 235 MPP_FMT_YUV_BUTT, 236 237 MPP_FMT_RGB565 = (MPP_FRAME_FMT_RGB + 0), /* 16-bit RGB */ 238 MPP_FMT_BGR565 = (MPP_FRAME_FMT_RGB + 1), /* 16-bit RGB */ 239 MPP_FMT_RGB555 = (MPP_FRAME_FMT_RGB + 2), /* 15-bit RGB */ 240 MPP_FMT_BGR555 = (MPP_FRAME_FMT_RGB + 3), /* 15-bit RGB */ 241 MPP_FMT_RGB444 = (MPP_FRAME_FMT_RGB + 4), /* 12-bit RGB */ 242 MPP_FMT_BGR444 = (MPP_FRAME_FMT_RGB + 5), /* 12-bit RGB */ 243 MPP_FMT_RGB888 = (MPP_FRAME_FMT_RGB + 6), /* 24-bit RGB */ 244 MPP_FMT_BGR888 = (MPP_FRAME_FMT_RGB + 7), /* 24-bit RGB */ 245 MPP_FMT_RGB101010 = (MPP_FRAME_FMT_RGB + 8), /* 30-bit RGB */ 246 MPP_FMT_BGR101010 = (MPP_FRAME_FMT_RGB + 9), /* 30-bit RGB */ 247 MPP_FMT_ARGB8888 = (MPP_FRAME_FMT_RGB + 10), /* 32-bit RGB */ 248 MPP_FMT_ABGR8888 = (MPP_FRAME_FMT_RGB + 11), /* 32-bit RGB */ 249 MPP_FMT_BGRA8888 = (MPP_FRAME_FMT_RGB + 12), /* 32-bit RGB */ 250 MPP_FMT_RGBA8888 = (MPP_FRAME_FMT_RGB + 13), /* 32-bit RGB */ 251 MPP_FMT_RGB_BUTT, 252 253 MPP_FMT_BUTT, 254 } MppFrameFormat; 255 256 /** 257 * Rational number (pair of numerator and denominator). 258 */ 259 typedef struct MppFrameRational { 260 RK_S32 num; ///< Numerator 261 RK_S32 den; ///< Denominator 262 } MppFrameRational; 263 264 typedef struct MppFrameMasteringDisplayMetadata { 265 RK_U16 display_primaries[3][2]; 266 RK_U16 white_point[2]; 267 RK_U32 max_luminance; 268 RK_U32 min_luminance; 269 } MppFrameMasteringDisplayMetadata; 270 271 typedef struct MppFrameContentLightMetadata { 272 RK_U16 MaxCLL; 273 RK_U16 MaxFALL; 274 } MppFrameContentLightMetadata; 275 276 typedef struct MppFrameHdrDynamicMeta { 277 RK_U32 hdr_fmt; 278 RK_U32 size; 279 RK_U8 data[]; 280 } MppFrameHdrDynamicMeta; 281 282 typedef enum MppFrameError { 283 /* General error not specified */ 284 MPP_FRAME_ERR_UNKNOW = 0x0001, 285 286 /* Critical error for decoder not support error */ 287 MPP_FRAME_ERR_UNSUPPORT = 0x0002, 288 289 /* 290 * Fatal error for decoder can not parse a valid frame for hardware. 291 * the pixel data is all invalid. 292 */ 293 MPP_FRAME_ERR_DEC_INVALID = 0x0010, 294 295 /* 296 * Normal error for decoder found hardware error on decoding. 297 */ 298 MPP_FRAME_ERR_DEC_HW_ERR = 0x0100, 299 300 /* 301 * Normal error for decoder found missing reference frame on decoding. 302 */ 303 MPP_FRAME_ERR_DEC_MISS_REF = 0x0200, 304 } MppFrameError; 305 306 #ifdef __cplusplus 307 extern "C" { 308 #endif 309 310 /* 311 * MppFrame interface 312 */ 313 MPP_RET mpp_frame_init(MppFrame *frame); 314 MPP_RET mpp_frame_deinit(MppFrame *frame); 315 316 /* 317 * normal parameter 318 * 319 * offset_x 320 * <--------> 321 * 322 * <---------------+ hor_stride +---------------> 323 * 324 * +------------------------------------------------------+ ^ ^ 325 * | | | | 326 * | | | | offset_y 327 * | | | | 328 * | +--------------------------------+ ^ | | v 329 * | | | | | | 330 * | | | + | + 331 * | | | | 332 * | | valid data area | height | ver_stride 333 * | | | | 334 * | | | + | + 335 * | | | | | | 336 * | +--------------------------------+ v | | 337 * | | | 338 * | <----------+ width +---------> | | 339 * | | | 340 * +------------------------------------------------------+ v 341 * 342 */ 343 RK_U32 mpp_frame_get_width(const MppFrame frame); 344 void mpp_frame_set_width(MppFrame frame, RK_U32 width); 345 RK_U32 mpp_frame_get_height(const MppFrame frame); 346 void mpp_frame_set_height(MppFrame frame, RK_U32 height); 347 RK_U32 mpp_frame_get_hor_stride(const MppFrame frame); 348 void mpp_frame_set_hor_stride(MppFrame frame, RK_U32 hor_stride); 349 RK_U32 mpp_frame_get_ver_stride(const MppFrame frame); 350 void mpp_frame_set_ver_stride(MppFrame frame, RK_U32 ver_stride); 351 void mpp_frame_set_hor_stride_pixel(MppFrame frame, RK_U32 hor_stride_pixel); 352 RK_U32 mpp_frame_get_hor_stride_pixel(const MppFrame frame); 353 void mpp_frame_set_fbc_hdr_stride(MppFrame frame, RK_U32 fbc_hdr_stride); 354 RK_U32 mpp_frame_get_fbc_hdr_stride(const MppFrame frame); 355 356 RK_U32 mpp_frame_get_offset_x(const MppFrame frame); 357 void mpp_frame_set_offset_x(MppFrame frame, RK_U32 offset_x); 358 RK_U32 mpp_frame_get_offset_y(const MppFrame frame); 359 void mpp_frame_set_offset_y(MppFrame frame, RK_U32 offset_y); 360 RK_U32 mpp_frame_get_mode(const MppFrame frame); 361 void mpp_frame_set_mode(MppFrame frame, RK_U32 mode); 362 RK_U32 mpp_frame_get_discard(const MppFrame frame); 363 void mpp_frame_set_discard(MppFrame frame, RK_U32 discard); 364 RK_U32 mpp_frame_get_viewid(const MppFrame frame); 365 void mpp_frame_set_viewid(MppFrame frame, RK_U32 viewid); 366 RK_U32 mpp_frame_get_poc(const MppFrame frame); 367 void mpp_frame_set_poc(MppFrame frame, RK_U32 poc); 368 RK_S64 mpp_frame_get_pts(const MppFrame frame); 369 void mpp_frame_set_pts(MppFrame frame, RK_S64 pts); 370 RK_S64 mpp_frame_get_dts(const MppFrame frame); 371 void mpp_frame_set_dts(MppFrame frame, RK_S64 dts); 372 RK_U32 mpp_frame_get_errinfo(const MppFrame frame); 373 void mpp_frame_set_errinfo(MppFrame frame, RK_U32 errinfo); 374 size_t mpp_frame_get_buf_size(const MppFrame frame); 375 void mpp_frame_set_buf_size(MppFrame frame, size_t buf_size); 376 void mpp_frame_set_thumbnail_en(MppFrame frame, RK_U32 thumbnail_en); 377 RK_U32 mpp_frame_get_thumbnail_en(const MppFrame frame); 378 379 /* 380 * flow control parmeter 381 */ 382 RK_U32 mpp_frame_get_eos(const MppFrame frame); 383 void mpp_frame_set_eos(MppFrame frame, RK_U32 eos); 384 RK_U32 mpp_frame_get_info_change(const MppFrame frame); 385 void mpp_frame_set_info_change(MppFrame frame, RK_U32 info_change); 386 387 /* 388 * buffer parameter 389 */ 390 MppBuffer mpp_frame_get_buffer(const MppFrame frame); 391 void mpp_frame_set_buffer(MppFrame frame, MppBuffer buffer); 392 393 /* 394 * meta data parameter 395 */ 396 RK_S32 mpp_frame_has_meta(const MppFrame frame); 397 MppMeta mpp_frame_get_meta(const MppFrame frame); 398 void mpp_frame_set_meta(MppFrame frame, MppMeta meta); 399 400 /* 401 * color related parameter 402 */ 403 MppFrameColorRange mpp_frame_get_color_range(const MppFrame frame); 404 void mpp_frame_set_color_range(MppFrame frame, MppFrameColorRange color_range); 405 MppFrameColorPrimaries mpp_frame_get_color_primaries(const MppFrame frame); 406 void mpp_frame_set_color_primaries(MppFrame frame, MppFrameColorPrimaries color_primaries); 407 MppFrameColorTransferCharacteristic mpp_frame_get_color_trc(const MppFrame frame); 408 void mpp_frame_set_color_trc(MppFrame frame, MppFrameColorTransferCharacteristic color_trc); 409 MppFrameColorSpace mpp_frame_get_colorspace(const MppFrame frame); 410 void mpp_frame_set_colorspace(MppFrame frame, MppFrameColorSpace colorspace); 411 MppFrameChromaLocation mpp_frame_get_chroma_location(const MppFrame frame); 412 void mpp_frame_set_chroma_location(MppFrame frame, MppFrameChromaLocation chroma_location); 413 MppFrameFormat mpp_frame_get_fmt(MppFrame frame); 414 void mpp_frame_set_fmt(MppFrame frame, MppFrameFormat fmt); 415 MppFrameRational mpp_frame_get_sar(const MppFrame frame); 416 void mpp_frame_set_sar(MppFrame frame, MppFrameRational sar); 417 MppFrameMasteringDisplayMetadata mpp_frame_get_mastering_display(const MppFrame frame); 418 void mpp_frame_set_mastering_display(MppFrame frame, MppFrameMasteringDisplayMetadata mastering_display); 419 MppFrameContentLightMetadata mpp_frame_get_content_light(const MppFrame frame); 420 void mpp_frame_set_content_light(MppFrame frame, MppFrameContentLightMetadata content_light); 421 MppFrameHdrDynamicMeta* mpp_frame_get_hdr_dynamic_meta(const MppFrame frame); 422 void mpp_frame_set_hdr_dynamic_meta(MppFrame frame, MppFrameHdrDynamicMeta *vivi_data); 423 424 /* 425 * HDR parameter 426 */ 427 428 #ifdef __cplusplus 429 } 430 #endif 431 432 #endif /*__MPP_FRAME_H__*/ 433