frame.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. /*
  2. *
  3. * This file is part of FFmpeg.
  4. *
  5. * FFmpeg is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2.1 of the License, or (at your option) any later version.
  9. *
  10. * FFmpeg is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with FFmpeg; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #ifndef AVUTIL_FRAME_H
  20. #define AVUTIL_FRAME_H
  21. #include <stdint.h>
  22. #include "libavcodec/version.h"
  23. #include "avutil.h"
  24. #include "buffer.h"
  25. #include "dict.h"
  26. #include "rational.h"
  27. #include "samplefmt.h"
  28. enum AVColorSpace{
  29. AVCOL_SPC_RGB = 0,
  30. AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
  31. AVCOL_SPC_UNSPECIFIED = 2,
  32. AVCOL_SPC_FCC = 4,
  33. AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
  34. AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
  35. AVCOL_SPC_SMPTE240M = 7,
  36. AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
  37. AVCOL_SPC_NB , ///< Not part of ABI
  38. };
  39. #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG
  40. enum AVColorRange{
  41. AVCOL_RANGE_UNSPECIFIED = 0,
  42. AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
  43. AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges
  44. AVCOL_RANGE_NB , ///< Not part of ABI
  45. };
  46. enum AVFrameSideDataType {
  47. /**
  48. * The data is the AVPanScan struct defined in libavcodec.
  49. */
  50. AV_FRAME_DATA_PANSCAN,
  51. };
  52. typedef struct AVFrameSideData {
  53. enum AVFrameSideDataType type;
  54. uint8_t *data;
  55. int size;
  56. AVDictionary *metadata;
  57. } AVFrameSideData;
  58. /**
  59. * This structure describes decoded (raw) audio or video data.
  60. *
  61. * AVFrame must be allocated using av_frame_alloc(). Note that this only
  62. * allocates the AVFrame itself, the buffers for the data must be managed
  63. * through other means (see below).
  64. * AVFrame must be freed with av_frame_free().
  65. *
  66. * AVFrame is typically allocated once and then reused multiple times to hold
  67. * different data (e.g. a single AVFrame to hold frames received from a
  68. * decoder). In such a case, av_frame_unref() will free any references held by
  69. * the frame and reset it to its original clean state before it
  70. * is reused again.
  71. *
  72. * The data described by an AVFrame is usually reference counted through the
  73. * AVBuffer API. The underlying buffer references are stored in AVFrame.buf /
  74. * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at
  75. * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case,
  76. * every single data plane must be contained in one of the buffers in
  77. * AVFrame.buf or AVFrame.extended_buf.
  78. * There may be a single buffer for all the data, or one separate buffer for
  79. * each plane, or anything in between.
  80. *
  81. * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added
  82. * to the end with a minor bump.
  83. * Similarly fields that are marked as to be only accessed by
  84. * av_opt_ptr() can be reordered. This allows 2 forks to add fields
  85. * without breaking compatibility with each other.
  86. */
  87. typedef struct AVFrame {
  88. #define AV_NUM_DATA_POINTERS 8
  89. /**
  90. * pointer to the picture/channel planes.
  91. * This might be different from the first allocated byte
  92. *
  93. * Some decoders access areas outside 0,0 - width,height, please
  94. * see avcodec_align_dimensions2(). Some filters and swscale can read
  95. * up to 16 bytes beyond the planes, if these filters are to be used,
  96. * then 16 extra bytes must be allocated.
  97. */
  98. uint8_t *data[AV_NUM_DATA_POINTERS];
  99. /**
  100. * For video, size in bytes of each picture line.
  101. * For audio, size in bytes of each plane.
  102. *
  103. * For audio, only linesize[0] may be set. For planar audio, each channel
  104. * plane must be the same size.
  105. *
  106. * For video the linesizes should be multiplies of the CPUs alignment
  107. * preference, this is 16 or 32 for modern desktop CPUs.
  108. * Some code requires such alignment other code can be slower without
  109. * correct alignment, for yet other it makes no difference.
  110. *
  111. * @note The linesize may be larger than the size of usable data -- there
  112. * may be extra padding present for performance reasons.
  113. */
  114. int linesize[AV_NUM_DATA_POINTERS];
  115. /**
  116. * pointers to the data planes/channels.
  117. *
  118. * For video, this should simply point to data[].
  119. *
  120. * For planar audio, each channel has a separate data pointer, and
  121. * linesize[0] contains the size of each channel buffer.
  122. * For packed audio, there is just one data pointer, and linesize[0]
  123. * contains the total size of the buffer for all channels.
  124. *
  125. * Note: Both data and extended_data should always be set in a valid frame,
  126. * but for planar audio with more channels that can fit in data,
  127. * extended_data must be used in order to access all channels.
  128. */
  129. uint8_t **extended_data;
  130. /**
  131. * width and height of the video frame
  132. */
  133. int width, height;
  134. /**
  135. * number of audio samples (per channel) described by this frame
  136. */
  137. int nb_samples;
  138. /**
  139. * format of the frame, -1 if unknown or unset
  140. * Values correspond to enum AVPixelFormat for video frames,
  141. * enum AVSampleFormat for audio)
  142. */
  143. int format;
  144. /**
  145. * 1 -> keyframe, 0-> not
  146. */
  147. int key_frame;
  148. /**
  149. * Picture type of the frame.
  150. */
  151. enum AVPictureType pict_type;
  152. #if FF_API_AVFRAME_LAVC
  153. attribute_deprecated
  154. uint8_t *base[AV_NUM_DATA_POINTERS];
  155. #endif
  156. /**
  157. * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
  158. */
  159. AVRational sample_aspect_ratio;
  160. /**
  161. * Presentation timestamp in time_base units (time when frame should be shown to user).
  162. */
  163. int64_t pts;
  164. /**
  165. * PTS copied from the AVPacket that was decoded to produce this frame.
  166. */
  167. int64_t pkt_pts;
  168. /**
  169. * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isnt used)
  170. * This is also the Presentation time of this AVFrame calculated from
  171. * only AVPacket.dts values without pts values.
  172. */
  173. int64_t pkt_dts;
  174. /**
  175. * picture number in bitstream order
  176. */
  177. int coded_picture_number;
  178. /**
  179. * picture number in display order
  180. */
  181. int display_picture_number;
  182. /**
  183. * quality (between 1 (good) and FF_LAMBDA_MAX (bad))
  184. */
  185. int quality;
  186. #if FF_API_AVFRAME_LAVC
  187. attribute_deprecated
  188. int reference;
  189. /**
  190. * QP table
  191. */
  192. attribute_deprecated
  193. int8_t *qscale_table;
  194. /**
  195. * QP store stride
  196. */
  197. attribute_deprecated
  198. int qstride;
  199. attribute_deprecated
  200. int qscale_type;
  201. /**
  202. * mbskip_table[mb]>=1 if MB didn't change
  203. * stride= mb_width = (width+15)>>4
  204. */
  205. attribute_deprecated
  206. uint8_t *mbskip_table;
  207. /**
  208. * motion vector table
  209. * @code
  210. * example:
  211. * int mv_sample_log2= 4 - motion_subsample_log2;
  212. * int mb_width= (width+15)>>4;
  213. * int mv_stride= (mb_width << mv_sample_log2) + 1;
  214. * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];
  215. * @endcode
  216. */
  217. attribute_deprecated
  218. int16_t (*motion_val[2])[2];
  219. /**
  220. * macroblock type table
  221. * mb_type_base + mb_width + 2
  222. */
  223. attribute_deprecated
  224. uint32_t *mb_type;
  225. /**
  226. * DCT coefficients
  227. */
  228. attribute_deprecated
  229. short *dct_coeff;
  230. /**
  231. * motion reference frame index
  232. * the order in which these are stored can depend on the codec.
  233. */
  234. attribute_deprecated
  235. int8_t *ref_index[2];
  236. #endif
  237. /**
  238. * for some private data of the user
  239. */
  240. void *opaque;
  241. /**
  242. * error
  243. */
  244. uint64_t error[AV_NUM_DATA_POINTERS];
  245. #if FF_API_AVFRAME_LAVC
  246. attribute_deprecated
  247. int type;
  248. #endif
  249. /**
  250. * When decoding, this signals how much the picture must be delayed.
  251. * extra_delay = repeat_pict / (2*fps)
  252. */
  253. int repeat_pict;
  254. /**
  255. * The content of the picture is interlaced.
  256. */
  257. int interlaced_frame;
  258. /**
  259. * If the content is interlaced, is top field displayed first.
  260. */
  261. int top_field_first;
  262. /**
  263. * Tell user application that palette has changed from previous frame.
  264. */
  265. int palette_has_changed;
  266. #if FF_API_AVFRAME_LAVC
  267. attribute_deprecated
  268. int buffer_hints;
  269. /**
  270. * Pan scan.
  271. */
  272. attribute_deprecated
  273. struct AVPanScan *pan_scan;
  274. #endif
  275. /**
  276. * reordered opaque 64bit (generally an integer or a double precision float
  277. * PTS but can be anything).
  278. * The user sets AVCodecContext.reordered_opaque to represent the input at
  279. * that time,
  280. * the decoder reorders values as needed and sets AVFrame.reordered_opaque
  281. * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
  282. * @deprecated in favor of pkt_pts
  283. */
  284. int64_t reordered_opaque;
  285. #if FF_API_AVFRAME_LAVC
  286. /**
  287. * @deprecated this field is unused
  288. */
  289. attribute_deprecated void *hwaccel_picture_private;
  290. attribute_deprecated
  291. struct AVCodecContext *owner;
  292. attribute_deprecated
  293. void *thread_opaque;
  294. /**
  295. * log2 of the size of the block which a single vector in motion_val represents:
  296. * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
  297. */
  298. attribute_deprecated
  299. uint8_t motion_subsample_log2;
  300. #endif
  301. /**
  302. * Sample rate of the audio data.
  303. */
  304. int sample_rate;
  305. /**
  306. * Channel layout of the audio data.
  307. */
  308. uint64_t channel_layout;
  309. /**
  310. * AVBuffer references backing the data for this frame. If all elements of
  311. * this array are NULL, then this frame is not reference counted.
  312. *
  313. * There may be at most one AVBuffer per data plane, so for video this array
  314. * always contains all the references. For planar audio with more than
  315. * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
  316. * this array. Then the extra AVBufferRef pointers are stored in the
  317. * extended_buf array.
  318. */
  319. AVBufferRef *buf[AV_NUM_DATA_POINTERS];
  320. /**
  321. * For planar audio which requires more than AV_NUM_DATA_POINTERS
  322. * AVBufferRef pointers, this array will hold all the references which
  323. * cannot fit into AVFrame.buf.
  324. *
  325. * Note that this is different from AVFrame.extended_data, which always
  326. * contains all the pointers. This array only contains the extra pointers,
  327. * which cannot fit into AVFrame.buf.
  328. *
  329. * This array is always allocated using av_malloc() by whoever constructs
  330. * the frame. It is freed in av_frame_unref().
  331. */
  332. AVBufferRef **extended_buf;
  333. /**
  334. * Number of elements in extended_buf.
  335. */
  336. int nb_extended_buf;
  337. AVFrameSideData **side_data;
  338. int nb_side_data;
  339. /**
  340. * frame timestamp estimated using various heuristics, in stream time base
  341. * Code outside libavcodec should access this field using:
  342. * av_frame_get_best_effort_timestamp(frame)
  343. * - encoding: unused
  344. * - decoding: set by libavcodec, read by user.
  345. */
  346. int64_t best_effort_timestamp;
  347. /**
  348. * reordered pos from the last AVPacket that has been input into the decoder
  349. * Code outside libavcodec should access this field using:
  350. * av_frame_get_pkt_pos(frame)
  351. * - encoding: unused
  352. * - decoding: Read by user.
  353. */
  354. int64_t pkt_pos;
  355. /**
  356. * duration of the corresponding packet, expressed in
  357. * AVStream->time_base units, 0 if unknown.
  358. * Code outside libavcodec should access this field using:
  359. * av_frame_get_pkt_duration(frame)
  360. * - encoding: unused
  361. * - decoding: Read by user.
  362. */
  363. int64_t pkt_duration;
  364. /**
  365. * metadata.
  366. * Code outside libavcodec should access this field using:
  367. * av_frame_get_metadata(frame)
  368. * - encoding: Set by user.
  369. * - decoding: Set by libavcodec.
  370. */
  371. AVDictionary *metadata;
  372. /**
  373. * decode error flags of the frame, set to a combination of
  374. * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there
  375. * were errors during the decoding.
  376. * Code outside libavcodec should access this field using:
  377. * av_frame_get_decode_error_flags(frame)
  378. * - encoding: unused
  379. * - decoding: set by libavcodec, read by user.
  380. */
  381. int decode_error_flags;
  382. #define FF_DECODE_ERROR_INVALID_BITSTREAM 1
  383. #define FF_DECODE_ERROR_MISSING_REFERENCE 2
  384. /**
  385. * number of audio channels, only used for audio.
  386. * Code outside libavcodec should access this field using:
  387. * av_frame_get_channels(frame)
  388. * - encoding: unused
  389. * - decoding: Read by user.
  390. */
  391. int channels;
  392. /**
  393. * size of the corresponding packet containing the compressed
  394. * frame. It must be accessed using av_frame_get_pkt_size() and
  395. * av_frame_set_pkt_size().
  396. * It is set to a negative value if unknown.
  397. * - encoding: unused
  398. * - decoding: set by libavcodec, read by user.
  399. */
  400. int pkt_size;
  401. /**
  402. * YUV colorspace type.
  403. * It must be accessed using av_frame_get_colorspace() and
  404. * av_frame_set_colorspace().
  405. * - encoding: Set by user
  406. * - decoding: Set by libavcodec
  407. */
  408. enum AVColorSpace colorspace;
  409. /**
  410. * MPEG vs JPEG YUV range.
  411. * It must be accessed using av_frame_get_color_range() and
  412. * av_frame_set_color_range().
  413. * - encoding: Set by user
  414. * - decoding: Set by libavcodec
  415. */
  416. enum AVColorRange color_range;
  417. /**
  418. * Not to be accessed directly from outside libavutil
  419. */
  420. AVBufferRef *qp_table_buf;
  421. } AVFrame;
  422. /**
  423. * Accessors for some AVFrame fields.
  424. * The position of these field in the structure is not part of the ABI,
  425. * they should not be accessed directly outside libavcodec.
  426. */
  427. int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame);
  428. void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);
  429. int64_t av_frame_get_pkt_duration (const AVFrame *frame);
  430. void av_frame_set_pkt_duration (AVFrame *frame, int64_t val);
  431. int64_t av_frame_get_pkt_pos (const AVFrame *frame);
  432. void av_frame_set_pkt_pos (AVFrame *frame, int64_t val);
  433. int64_t av_frame_get_channel_layout (const AVFrame *frame);
  434. void av_frame_set_channel_layout (AVFrame *frame, int64_t val);
  435. int av_frame_get_channels (const AVFrame *frame);
  436. void av_frame_set_channels (AVFrame *frame, int val);
  437. int av_frame_get_sample_rate (const AVFrame *frame);
  438. void av_frame_set_sample_rate (AVFrame *frame, int val);
  439. AVDictionary *av_frame_get_metadata (const AVFrame *frame);
  440. void av_frame_set_metadata (AVFrame *frame, AVDictionary *val);
  441. int av_frame_get_decode_error_flags (const AVFrame *frame);
  442. void av_frame_set_decode_error_flags (AVFrame *frame, int val);
  443. int av_frame_get_pkt_size(const AVFrame *frame);
  444. void av_frame_set_pkt_size(AVFrame *frame, int val);
  445. AVDictionary **avpriv_frame_get_metadatap(AVFrame *frame);
  446. int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type);
  447. int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int type);
  448. enum AVColorSpace av_frame_get_colorspace(const AVFrame *frame);
  449. void av_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val);
  450. enum AVColorRange av_frame_get_color_range(const AVFrame *frame);
  451. void av_frame_set_color_range(AVFrame *frame, enum AVColorRange val);
  452. /**
  453. * Get the name of a colorspace.
  454. * @return a static string identifying the colorspace; can be NULL.
  455. */
  456. const char *av_get_colorspace_name(enum AVColorSpace val);
  457. /**
  458. * Allocate an AVFrame and set its fields to default values. The resulting
  459. * struct must be freed using av_frame_free().
  460. *
  461. * @return An AVFrame filled with default values or NULL on failure.
  462. *
  463. * @note this only allocates the AVFrame itself, not the data buffers. Those
  464. * must be allocated through other means, e.g. with av_frame_get_buffer() or
  465. * manually.
  466. */
  467. AVFrame *av_frame_alloc(void);
  468. /**
  469. * Free the frame and any dynamically allocated objects in it,
  470. * e.g. extended_data. If the frame is reference counted, it will be
  471. * unreferenced first.
  472. *
  473. * @param frame frame to be freed. The pointer will be set to NULL.
  474. */
  475. void av_frame_free(AVFrame **frame);
  476. /**
  477. * Setup a new reference to the data described by a given frame.
  478. *
  479. * Copy frame properties from src to dst and create a new reference for each
  480. * AVBufferRef from src.
  481. *
  482. * If src is not reference counted, new buffers are allocated and the data is
  483. * copied.
  484. *
  485. * @return 0 on success, a negative AVERROR on error
  486. */
  487. int av_frame_ref(AVFrame *dst, AVFrame *src);
  488. /**
  489. * Create a new frame that references the same data as src.
  490. *
  491. * This is a shortcut for av_frame_alloc()+av_frame_ref().
  492. *
  493. * @return newly created AVFrame on success, NULL on error.
  494. */
  495. AVFrame *av_frame_clone(AVFrame *src);
  496. /**
  497. * Unreference all the buffers referenced by frame and reset the frame fields.
  498. */
  499. void av_frame_unref(AVFrame *frame);
  500. /**
  501. * Move everythnig contained in src to dst and reset src.
  502. */
  503. void av_frame_move_ref(AVFrame *dst, AVFrame *src);
  504. /**
  505. * Allocate new buffer(s) for audio or video data.
  506. *
  507. * The following fields must be set on frame before calling this function:
  508. * - format (pixel format for video, sample format for audio)
  509. * - width and height for video
  510. * - nb_samples and channel_layout for audio
  511. *
  512. * This function will fill AVFrame.data and AVFrame.buf arrays and, if
  513. * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf.
  514. * For planar formats, one buffer will be allocated for each plane.
  515. *
  516. * @param frame frame in which to store the new buffers.
  517. * @param align required buffer size alignment
  518. *
  519. * @return 0 on success, a negative AVERROR on error.
  520. */
  521. int av_frame_get_buffer(AVFrame *frame, int align);
  522. /**
  523. * Check if the frame data is writable.
  524. *
  525. * @return A positive value if the frame data is writable (which is true if and
  526. * only if each of the underlying buffers has only one reference, namely the one
  527. * stored in this frame). Return 0 otherwise.
  528. *
  529. * If 1 is returned the answer is valid until av_buffer_ref() is called on any
  530. * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly).
  531. *
  532. * @see av_frame_make_writable(), av_buffer_is_writable()
  533. */
  534. int av_frame_is_writable(AVFrame *frame);
  535. /**
  536. * Ensure that the frame data is writable, avoiding data copy if possible.
  537. *
  538. * Do nothing if the frame is writable, allocate new buffers and copy the data
  539. * if it is not.
  540. *
  541. * @return 0 on success, a negative AVERROR on error.
  542. *
  543. * @see av_frame_is_writable(), av_buffer_is_writable(),
  544. * av_buffer_make_writable()
  545. */
  546. int av_frame_make_writable(AVFrame *frame);
  547. /**
  548. * Copy only "metadata" fields from src to dst.
  549. *
  550. * Metadata for the purpose of this function are those fields that do not affect
  551. * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample
  552. * aspect ratio (for video), but not width/height or channel layout.
  553. * Side data is also copied.
  554. */
  555. int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
  556. /**
  557. * Get the buffer reference a given data plane is stored in.
  558. *
  559. * @param plane index of the data plane of interest in frame->extended_data.
  560. *
  561. * @return the buffer reference that contains the plane or NULL if the input
  562. * frame is not valid.
  563. */
  564. AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane);
  565. /**
  566. * Add a new side data to a frame.
  567. *
  568. * @param frame a frame to which the side data should be added
  569. * @param type type of the added side data
  570. * @param size size of the side data
  571. *
  572. * @return newly added side data on success, NULL on error
  573. */
  574. AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
  575. enum AVFrameSideDataType type,
  576. int size);
  577. /**
  578. * @return a pointer to the side data of a given type on success, NULL if there
  579. * is no side data with such type in this frame.
  580. */
  581. AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
  582. enum AVFrameSideDataType type);
  583. #endif /* AVUTIL_FRAME_H */