xref: /OK3568_Linux_fs/external/mpp/inc/mpp_frame.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
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          (0x0c000000)
176 #define MPP_FRAME_HDR_NONE          (0x00000000)
177 #define MPP_FRAME_HDR               (0x04000000)
178 
179 /*
180  * AFBC_V1 is for ISP output.
181  * It has default payload offset to be calculated * from width and height:
182  * Payload offset = MPP_ALIGN(MPP_ALIGN(width, 16) * MPP_ALIGN(height, 16) / 16, SZ_4K)
183  */
184 #define MPP_FRAME_FBC_AFBC_V1       (0x00100000)
185 /*
186  * AFBC_V2 is for video decoder output.
187  * It stores payload offset in first 32-bit in header address
188  * Payload offset is always set to zero.
189  */
190 #define MPP_FRAME_FBC_AFBC_V2       (0x00200000)
191 
192 #define MPP_FRAME_FMT_LE_MASK       (0x01000000)
193 
194 #define MPP_FRAME_FMT_IS_YUV(fmt)   (((fmt & MPP_FRAME_FMT_COLOR_MASK) == MPP_FRAME_FMT_YUV) && \
195                                      ((fmt & MPP_FRAME_FMT_MASK) < MPP_FMT_YUV_BUTT))
196 #define MPP_FRAME_FMT_IS_YUV_10BIT(fmt) ((fmt & MPP_FRAME_FMT_MASK) == MPP_FMT_YUV420SP_10BIT || \
197                                         (fmt & MPP_FRAME_FMT_MASK) == MPP_FMT_YUV422SP_10BIT)
198 #define MPP_FRAME_FMT_IS_RGB(fmt)   (((fmt & MPP_FRAME_FMT_COLOR_MASK) == MPP_FRAME_FMT_RGB) && \
199                                      ((fmt & MPP_FRAME_FMT_MASK) < MPP_FMT_RGB_BUTT))
200 
201 /*
202  * For MPP_FRAME_FBC_AFBC_V1 the 16byte aligned stride is used.
203  */
204 #define MPP_FRAME_FMT_IS_FBC(fmt)   (fmt & MPP_FRAME_FBC_MASK)
205 
206 #define MPP_FRAME_FMT_IS_HDR(fmt)   (fmt & MPP_FRAME_HDR_MASK)
207 
208 #define MPP_FRAME_FMT_IS_LE(fmt)    ((fmt & MPP_FRAME_FMT_LE_MASK) == MPP_FRAME_FMT_LE_MASK)
209 #define MPP_FRAME_FMT_IS_BE(fmt)    ((fmt & MPP_FRAME_FMT_LE_MASK) == 0)
210 
211 /* mpp color format index definition */
212 typedef enum {
213     MPP_FMT_YUV420SP        = (MPP_FRAME_FMT_YUV + 0),  /* YYYY... UV... (NV12)     */
214     /*
215      * A rockchip specific pixel format, without gap between pixel aganist
216      * the P010_10LE/P010_10BE
217      */
218     MPP_FMT_YUV420SP_10BIT  = (MPP_FRAME_FMT_YUV + 1),
219     MPP_FMT_YUV422SP        = (MPP_FRAME_FMT_YUV + 2),  /* YYYY... UVUV... (NV16)   */
220     MPP_FMT_YUV422SP_10BIT  = (MPP_FRAME_FMT_YUV + 3),  ///< Not part of ABI
221     MPP_FMT_YUV420P         = (MPP_FRAME_FMT_YUV + 4),  /* YYYY... U...V...  (I420) */
222     MPP_FMT_YUV420SP_VU     = (MPP_FRAME_FMT_YUV + 5),  /* YYYY... VUVUVU... (NV21) */
223     MPP_FMT_YUV422P         = (MPP_FRAME_FMT_YUV + 6),  /* YYYY... UU...VV...(422P) */
224     MPP_FMT_YUV422SP_VU     = (MPP_FRAME_FMT_YUV + 7),  /* YYYY... VUVUVU... (NV61) */
225     MPP_FMT_YUV422_YUYV     = (MPP_FRAME_FMT_YUV + 8),  /* YUYVYUYV... (YUY2)       */
226     MPP_FMT_YUV422_YVYU     = (MPP_FRAME_FMT_YUV + 9),  /* YVYUYVYU... (YVY2)       */
227     MPP_FMT_YUV422_UYVY     = (MPP_FRAME_FMT_YUV + 10), /* UYVYUYVY... (UYVY)       */
228     MPP_FMT_YUV422_VYUY     = (MPP_FRAME_FMT_YUV + 11), /* VYUYVYUY... (VYUY)       */
229     MPP_FMT_YUV400          = (MPP_FRAME_FMT_YUV + 12), /* YYYY...                  */
230     MPP_FMT_YUV440SP        = (MPP_FRAME_FMT_YUV + 13), /* YYYY... UVUV...          */
231     MPP_FMT_YUV411SP        = (MPP_FRAME_FMT_YUV + 14), /* YYYY... UV...            */
232     MPP_FMT_YUV444SP        = (MPP_FRAME_FMT_YUV + 15), /* YYYY... UVUVUVUV...      */
233     MPP_FMT_YUV444P         = (MPP_FRAME_FMT_YUV + 16), /* YYYY... UUUU... VVVV...  */
234     MPP_FMT_YUV_BUTT,
235 
236     MPP_FMT_RGB565          = (MPP_FRAME_FMT_RGB + 0),  /* 16-bit RGB               */
237     MPP_FMT_BGR565          = (MPP_FRAME_FMT_RGB + 1),  /* 16-bit RGB               */
238     MPP_FMT_RGB555          = (MPP_FRAME_FMT_RGB + 2),  /* 15-bit RGB               */
239     MPP_FMT_BGR555          = (MPP_FRAME_FMT_RGB + 3),  /* 15-bit RGB               */
240     MPP_FMT_RGB444          = (MPP_FRAME_FMT_RGB + 4),  /* 12-bit RGB               */
241     MPP_FMT_BGR444          = (MPP_FRAME_FMT_RGB + 5),  /* 12-bit RGB               */
242     MPP_FMT_RGB888          = (MPP_FRAME_FMT_RGB + 6),  /* 24-bit RGB               */
243     MPP_FMT_BGR888          = (MPP_FRAME_FMT_RGB + 7),  /* 24-bit RGB               */
244     MPP_FMT_RGB101010       = (MPP_FRAME_FMT_RGB + 8),  /* 30-bit RGB               */
245     MPP_FMT_BGR101010       = (MPP_FRAME_FMT_RGB + 9),  /* 30-bit RGB               */
246     MPP_FMT_ARGB8888        = (MPP_FRAME_FMT_RGB + 10), /* 32-bit RGB               */
247     MPP_FMT_ABGR8888        = (MPP_FRAME_FMT_RGB + 11), /* 32-bit RGB               */
248     MPP_FMT_BGRA8888        = (MPP_FRAME_FMT_RGB + 12), /* 32-bit RGB               */
249     MPP_FMT_RGBA8888        = (MPP_FRAME_FMT_RGB + 13), /* 32-bit RGB               */
250     MPP_FMT_RGB_BUTT,
251 
252     MPP_FMT_BUTT,
253 } MppFrameFormat;
254 
255 /**
256  * Rational number (pair of numerator and denominator).
257  */
258 typedef struct MppFrameRational {
259     RK_S32 num; ///< Numerator
260     RK_S32 den; ///< Denominator
261 } MppFrameRational;
262 
263 typedef struct MppFrameMasteringDisplayMetadata {
264     RK_U16 display_primaries[3][2];
265     RK_U16 white_point[2];
266     RK_U32 max_luminance;
267     RK_U32 min_luminance;
268 } MppFrameMasteringDisplayMetadata;
269 
270 typedef struct MppFrameContentLightMetadata {
271     RK_U16 MaxCLL;
272     RK_U16 MaxFALL;
273 } MppFrameContentLightMetadata;
274 
275 typedef struct MppFrameHdrDynamicMeta {
276     RK_U32 hdr_fmt;
277     RK_U32 size;
278     RK_U8 data[];
279 } MppFrameHdrDynamicMeta;
280 
281 typedef enum MppFrameError {
282     /* General error not specified */
283     MPP_FRAME_ERR_UNKNOW           = 0x0001,
284 
285     /* Critical error for decoder not support error */
286     MPP_FRAME_ERR_UNSUPPORT        = 0x0002,
287 
288     /*
289      * Fatal error for decoder can not parse a valid frame for hardware.
290      * the pixel data is all invalid.
291      */
292     MPP_FRAME_ERR_DEC_INVALID      = 0x0010,
293 
294     /*
295      * Normal error for decoder found hardware error on decoding.
296      */
297     MPP_FRAME_ERR_DEC_HW_ERR       = 0x0100,
298 
299     /*
300      * Normal error for decoder found missing reference frame on decoding.
301      */
302     MPP_FRAME_ERR_DEC_MISS_REF     = 0x0200,
303 } MppFrameError;
304 
305 #ifdef __cplusplus
306 extern "C" {
307 #endif
308 
309 /*
310  * MppFrame interface
311  */
312 MPP_RET mpp_frame_init(MppFrame *frame);
313 MPP_RET mpp_frame_deinit(MppFrame *frame);
314 
315 /*
316  * normal parameter
317  *
318  *    offset_x
319  *   <-------->
320  *
321  *   <---------------+      hor_stride      +--------------->
322  *
323  *   +------------------------------------------------------+   ^   ^
324  *   |                                                      |   |   |
325  *   |                                                      |   |   | offset_y
326  *   |                                                      |   |   |
327  *   |        +--------------------------------+  ^         |   |   v
328  *   |        |                                |  |         |   |
329  *   |        |                                |  +         |   +
330  *   |        |                                |            |
331  *   |        |        valid data area         | height     | ver_stride
332  *   |        |                                |            |
333  *   |        |                                |  +         |   +
334  *   |        |                                |  |         |   |
335  *   |        +--------------------------------+  v         |   |
336  *   |                                                      |   |
337  *   |        <----------+   width   +--------->            |   |
338  *   |                                                      |   |
339  *   +------------------------------------------------------+   v
340  *
341  */
342 RK_U32  mpp_frame_get_width(const MppFrame frame);
343 void    mpp_frame_set_width(MppFrame frame, RK_U32 width);
344 RK_U32  mpp_frame_get_height(const MppFrame frame);
345 void    mpp_frame_set_height(MppFrame frame, RK_U32 height);
346 RK_U32  mpp_frame_get_hor_stride(const MppFrame frame);
347 void    mpp_frame_set_hor_stride(MppFrame frame, RK_U32 hor_stride);
348 RK_U32  mpp_frame_get_ver_stride(const MppFrame frame);
349 void    mpp_frame_set_ver_stride(MppFrame frame, RK_U32 ver_stride);
350 void    mpp_frame_set_hor_stride_pixel(MppFrame frame, RK_U32 hor_stride_pixel);
351 RK_U32  mpp_frame_get_hor_stride_pixel(const MppFrame frame);
352 void    mpp_frame_set_fbc_hdr_stride(MppFrame frame, RK_U32 fbc_hdr_stride);
353 RK_U32  mpp_frame_get_fbc_hdr_stride(const MppFrame frame);
354 
355 RK_U32  mpp_frame_get_offset_x(const MppFrame frame);
356 void    mpp_frame_set_offset_x(MppFrame frame, RK_U32 offset_x);
357 RK_U32  mpp_frame_get_offset_y(const MppFrame frame);
358 void    mpp_frame_set_offset_y(MppFrame frame, RK_U32 offset_y);
359 RK_U32  mpp_frame_get_mode(const MppFrame frame);
360 void    mpp_frame_set_mode(MppFrame frame, RK_U32 mode);
361 RK_U32  mpp_frame_get_discard(const MppFrame frame);
362 void    mpp_frame_set_discard(MppFrame frame, RK_U32 discard);
363 RK_U32  mpp_frame_get_viewid(const MppFrame frame);
364 void    mpp_frame_set_viewid(MppFrame frame, RK_U32 viewid);
365 RK_U32  mpp_frame_get_poc(const MppFrame frame);
366 void    mpp_frame_set_poc(MppFrame frame, RK_U32 poc);
367 RK_S64  mpp_frame_get_pts(const MppFrame frame);
368 void    mpp_frame_set_pts(MppFrame frame, RK_S64 pts);
369 RK_S64  mpp_frame_get_dts(const MppFrame frame);
370 void    mpp_frame_set_dts(MppFrame frame, RK_S64 dts);
371 RK_U32  mpp_frame_get_errinfo(const MppFrame frame);
372 void    mpp_frame_set_errinfo(MppFrame frame, RK_U32 errinfo);
373 size_t  mpp_frame_get_buf_size(const MppFrame frame);
374 void    mpp_frame_set_buf_size(MppFrame frame, size_t buf_size);
375 void    mpp_frame_set_thumbnail_en(MppFrame frame, RK_U32 thumbnail_en);
376 RK_U32  mpp_frame_get_thumbnail_en(const MppFrame frame);
377 
378 /*
379  * flow control parmeter
380  */
381 RK_U32  mpp_frame_get_eos(const MppFrame frame);
382 void    mpp_frame_set_eos(MppFrame frame, RK_U32 eos);
383 RK_U32  mpp_frame_get_info_change(const MppFrame frame);
384 void    mpp_frame_set_info_change(MppFrame frame, RK_U32 info_change);
385 
386 /*
387  * buffer parameter
388  */
389 MppBuffer mpp_frame_get_buffer(const MppFrame frame);
390 void    mpp_frame_set_buffer(MppFrame frame, MppBuffer buffer);
391 
392 /*
393  * meta data parameter
394  */
395 RK_S32  mpp_frame_has_meta(const MppFrame frame);
396 MppMeta mpp_frame_get_meta(const MppFrame frame);
397 void    mpp_frame_set_meta(MppFrame frame, MppMeta meta);
398 
399 /*
400  * color related parameter
401  */
402 MppFrameColorRange mpp_frame_get_color_range(const MppFrame frame);
403 void    mpp_frame_set_color_range(MppFrame frame, MppFrameColorRange color_range);
404 MppFrameColorPrimaries mpp_frame_get_color_primaries(const MppFrame frame);
405 void    mpp_frame_set_color_primaries(MppFrame frame, MppFrameColorPrimaries color_primaries);
406 MppFrameColorTransferCharacteristic mpp_frame_get_color_trc(const MppFrame frame);
407 void    mpp_frame_set_color_trc(MppFrame frame, MppFrameColorTransferCharacteristic color_trc);
408 MppFrameColorSpace mpp_frame_get_colorspace(const MppFrame frame);
409 void    mpp_frame_set_colorspace(MppFrame frame, MppFrameColorSpace colorspace);
410 MppFrameChromaLocation mpp_frame_get_chroma_location(const MppFrame frame);
411 void    mpp_frame_set_chroma_location(MppFrame frame, MppFrameChromaLocation chroma_location);
412 MppFrameFormat mpp_frame_get_fmt(MppFrame frame);
413 void    mpp_frame_set_fmt(MppFrame frame, MppFrameFormat fmt);
414 MppFrameRational mpp_frame_get_sar(const MppFrame frame);
415 void    mpp_frame_set_sar(MppFrame frame, MppFrameRational sar);
416 MppFrameMasteringDisplayMetadata mpp_frame_get_mastering_display(const MppFrame frame);
417 void    mpp_frame_set_mastering_display(MppFrame frame, MppFrameMasteringDisplayMetadata mastering_display);
418 MppFrameContentLightMetadata mpp_frame_get_content_light(const MppFrame frame);
419 void    mpp_frame_set_content_light(MppFrame frame, MppFrameContentLightMetadata content_light);
420 MppFrameHdrDynamicMeta* mpp_frame_get_hdr_dynamic_meta(const MppFrame frame);
421 void    mpp_frame_set_hdr_dynamic_meta(MppFrame frame, MppFrameHdrDynamicMeta *vivi_data);
422 
423 /*
424  * HDR parameter
425  */
426 
427 #ifdef __cplusplus
428 }
429 #endif
430 
431 #endif /*__MPP_FRAME_H__*/
432