FFmpeg
side_data.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include "avassert.h"
20 #include "buffer.h"
21 #include "common.h"
22 #include "dict.h"
23 #include "frame.h"
24 #include "mem.h"
25 #include "side_data.h"
26 
27 static const AVSideDataDescriptor sd_props[] = {
29  [AV_FRAME_DATA_A53_CC] = { "ATSC A53 Part 4 Closed Captions" },
31  [AV_FRAME_DATA_DOWNMIX_INFO] = { "Metadata relevant to a downmix procedure", AV_SIDE_DATA_PROP_CHANNEL_DEPENDENT },
32  [AV_FRAME_DATA_AFD] = { "Active format description" },
34  [AV_FRAME_DATA_SKIP_SAMPLES] = { "Skip samples" },
35  [AV_FRAME_DATA_GOP_TIMECODE] = { "GOP timecode" },
36  [AV_FRAME_DATA_S12M_TIMECODE] = { "SMPTE 12-1 timecode" },
37  [AV_FRAME_DATA_DYNAMIC_HDR_PLUS] = { "HDR Dynamic Metadata SMPTE2094-40 (HDR10+)", AV_SIDE_DATA_PROP_COLOR_DEPENDENT },
38  [AV_FRAME_DATA_DYNAMIC_HDR_VIVID] = { "HDR Dynamic Metadata CUVA 005.1 2021 (Vivid)", AV_SIDE_DATA_PROP_COLOR_DEPENDENT },
40  [AV_FRAME_DATA_VIDEO_ENC_PARAMS] = { "Video encoding parameters" },
41  [AV_FRAME_DATA_FILM_GRAIN_PARAMS] = { "Film grain parameters" },
42  [AV_FRAME_DATA_DETECTION_BBOXES] = { "Bounding boxes for object detection and classification", AV_SIDE_DATA_PROP_SIZE_DEPENDENT },
44  [AV_FRAME_DATA_DOVI_METADATA] = { "Dolby Vision Metadata", AV_SIDE_DATA_PROP_COLOR_DEPENDENT },
45  [AV_FRAME_DATA_LCEVC] = { "LCEVC NAL data", AV_SIDE_DATA_PROP_SIZE_DEPENDENT },
46  [AV_FRAME_DATA_VIEW_ID] = { "View ID" },
48  [AV_FRAME_DATA_REPLAYGAIN] = { "AVReplayGain", AV_SIDE_DATA_PROP_GLOBAL },
49  [AV_FRAME_DATA_DISPLAYMATRIX] = { "3x3 displaymatrix", AV_SIDE_DATA_PROP_GLOBAL },
50  [AV_FRAME_DATA_AUDIO_SERVICE_TYPE] = { "Audio service type", AV_SIDE_DATA_PROP_GLOBAL },
53  [AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT] = { "Ambient viewing environment", AV_SIDE_DATA_PROP_GLOBAL },
56  [AV_FRAME_DATA_EXIF] = { "EXIF metadata", AV_SIDE_DATA_PROP_GLOBAL },
57  [AV_FRAME_DATA_SEI_UNREGISTERED] = { "H.26[45] User Data Unregistered SEI message", AV_SIDE_DATA_PROP_MULTI },
58  [AV_FRAME_DATA_VIDEO_HINT] = { "Encoding video hint", AV_SIDE_DATA_PROP_SIZE_DEPENDENT },
59  [AV_FRAME_DATA_3D_REFERENCE_DISPLAYS] = { "3D Reference Displays Information", AV_SIDE_DATA_PROP_GLOBAL },
60 };
61 
63 {
64  unsigned t = type;
65  if (t < FF_ARRAY_ELEMS(sd_props) && sd_props[t].name)
66  return &sd_props[t];
67  return NULL;
68 }
69 
71 {
73  return desc ? desc->name : NULL;
74 }
75 
77 {
78  AVFrameSideData *sd = *ptr_sd;
79 
80  av_buffer_unref(&sd->buf);
81  av_dict_free(&sd->metadata);
82  av_freep(ptr_sd);
83 }
84 
85 static void remove_side_data_by_entry(AVFrameSideData ***sd, int *nb_sd,
86  const AVFrameSideData *target)
87 {
88  for (int i = *nb_sd - 1; i >= 0; i--) {
89  AVFrameSideData *entry = ((*sd)[i]);
90  if (entry != target)
91  continue;
92 
94 
95  ((*sd)[i]) = ((*sd)[*nb_sd - 1]);
96  (*nb_sd)--;
97 
98  return;
99  }
100 }
101 
104 {
105  for (int i = *nb_sd - 1; i >= 0; i--) {
106  AVFrameSideData *entry = ((*sd)[i]);
107  if (entry->type != type)
108  continue;
109 
111 
112  ((*sd)[i]) = ((*sd)[*nb_sd - 1]);
113  (*nb_sd)--;
114  }
115 }
116 
118  int props)
119 {
120  for (int i = *nb_sd - 1; i >= 0; i--) {
121  AVFrameSideData *entry = ((*sd)[i]);
123  if (!desc || !(desc->props & props))
124  continue;
125 
127 
128  ((*sd)[i]) = ((*sd)[*nb_sd - 1]);
129  (*nb_sd)--;
130  }
131 }
132 
134 {
135  for (int i = 0; i < *nb_sd; i++)
136  free_side_data_entry(&((*sd)[i]));
137  *nb_sd = 0;
138 
139  av_freep(sd);
140 }
141 
143  int *nb_sd,
145  AVBufferRef *buf, uint8_t *data,
146  size_t size)
147 {
148  AVFrameSideData *ret, **tmp;
149 
150  // *nb_sd + 1 needs to fit into an int and a size_t.
151  if ((unsigned)*nb_sd >= FFMIN(INT_MAX, SIZE_MAX))
152  return NULL;
153 
154  tmp = av_realloc_array(*sd, sizeof(**sd), *nb_sd + 1);
155  if (!tmp)
156  return NULL;
157  *sd = tmp;
158 
159  ret = av_mallocz(sizeof(*ret));
160  if (!ret)
161  return NULL;
162 
163  ret->buf = buf;
164  ret->data = data;
165  ret->size = size;
166  ret->type = type;
167 
168  (*sd)[(*nb_sd)++] = ret;
169 
170  return ret;
171 }
172 
174  int *nb_sd,
176  AVBufferRef *buf)
177 {
178  if (!buf)
179  return NULL;
180 
181  return add_side_data_from_buf_ext(sd, nb_sd, type, buf, buf->data, buf->size);
182 }
183 
185  AVBufferRef *buf, int flags)
186 {
188  return NULL;
189 
190  av_dict_free(&dst->metadata);
191  av_buffer_unref(&dst->buf);
192  dst->buf = buf;
193  dst->data = buf->data;
194  dst->size = buf->size;
195  return dst;
196 }
197 
200  size_t size, unsigned int flags)
201 {
205 
207  av_frame_side_data_remove(sd, nb_sd, type);
208  if ((!desc || !(desc->props & AV_SIDE_DATA_PROP_MULTI)) &&
209  (ret = (AVFrameSideData *)av_frame_side_data_get(*sd, *nb_sd, type))) {
211  if (!ret)
212  av_buffer_unref(&buf);
213  return ret;
214  }
215 
216  ret = ff_frame_side_data_add_from_buf(sd, nb_sd, type, buf);
217  if (!ret)
218  av_buffer_unref(&buf);
219 
220  return ret;
221 }
222 
225  AVBufferRef **pbuf, unsigned int flags)
226 {
228  AVFrameSideData *sd_dst = NULL;
229  AVBufferRef *buf = *pbuf;
230 
231  if ((flags & AV_FRAME_SIDE_DATA_FLAG_NEW_REF) && !(buf = av_buffer_ref(*pbuf)))
232  return NULL;
234  av_frame_side_data_remove(sd, nb_sd, type);
235  if ((!desc || !(desc->props & AV_SIDE_DATA_PROP_MULTI)) &&
236  (sd_dst = (AVFrameSideData *)av_frame_side_data_get(*sd, *nb_sd, type))) {
237  sd_dst = replace_side_data_from_buf(sd_dst, buf, flags);
238  } else
239  sd_dst = ff_frame_side_data_add_from_buf(sd, nb_sd, type, buf);
240 
241  if (sd_dst && !(flags & AV_FRAME_SIDE_DATA_FLAG_NEW_REF))
242  *pbuf = NULL;
243  else if (!sd_dst && (flags & AV_FRAME_SIDE_DATA_FLAG_NEW_REF))
244  av_buffer_unref(&buf);
245  return sd_dst;
246 }
247 
249  const AVFrameSideData *src, unsigned int flags)
250 {
251  const AVSideDataDescriptor *desc;
252  AVBufferRef *buf = NULL;
253  AVFrameSideData *sd_dst = NULL;
254  int ret = AVERROR_BUG;
255 
256  if (!sd || !src || !nb_sd || (*nb_sd && !*sd))
257  return AVERROR(EINVAL);
258 
261  av_frame_side_data_remove(sd, nb_sd, src->type);
262  if ((!desc || !(desc->props & AV_SIDE_DATA_PROP_MULTI)) &&
263  (sd_dst = (AVFrameSideData *)av_frame_side_data_get(*sd, *nb_sd, src->type))) {
264  AVDictionary *dict = NULL;
265 
267  return AVERROR(EEXIST);
268 
269  ret = av_dict_copy(&dict, src->metadata, 0);
270  if (ret < 0)
271  return ret;
272 
273  ret = av_buffer_replace(&sd_dst->buf, src->buf);
274  if (ret < 0) {
275  av_dict_free(&dict);
276  return ret;
277  }
278 
279  av_dict_free(&sd_dst->metadata);
280  sd_dst->metadata = dict;
281  sd_dst->data = src->data;
282  sd_dst->size = src->size;
283  return 0;
284  }
285 
286  buf = av_buffer_ref(src->buf);
287  if (!buf)
288  return AVERROR(ENOMEM);
289 
290  sd_dst = add_side_data_from_buf_ext(sd, nb_sd, src->type, buf,
291  src->data, src->size);
292  if (!sd_dst) {
293  av_buffer_unref(&buf);
294  return AVERROR(ENOMEM);
295  }
296 
297  ret = av_dict_copy(&sd_dst->metadata, src->metadata, 0);
298  if (ret < 0) {
299  remove_side_data_by_entry(sd, nb_sd, sd_dst);
300  return ret;
301  }
302 
303  return 0;
304 }
305 
307  const int nb_sd,
309 {
310  for (int i = 0; i < nb_sd; i++) {
311  if (sd[i]->type == type)
312  return sd[i];
313  }
314  return NULL;
315 }
flags
const SwsFlags flags[]
Definition: swscale.c:61
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
entry
#define entry
Definition: aom_film_grain_template.c:66
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
AVBufferRef::data
uint8_t * data
The data buffer.
Definition: buffer.h:90
AV_FRAME_DATA_A53_CC
@ AV_FRAME_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
Definition: frame.h:59
free_side_data_entry
static void free_side_data_entry(AVFrameSideData **ptr_sd)
Definition: side_data.c:76
AV_FRAME_DATA_DOVI_METADATA
@ AV_FRAME_DATA_DOVI_METADATA
Parsed Dolby Vision metadata, suitable for passing to a software implementation.
Definition: frame.h:208
AV_FRAME_DATA_FILM_GRAIN_PARAMS
@ AV_FRAME_DATA_FILM_GRAIN_PARAMS
Film grain parameters for a frame, described by AVFilmGrainParams.
Definition: frame.h:188
AV_FRAME_DATA_S12M_TIMECODE
@ AV_FRAME_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1.
Definition: frame.h:152
remove_side_data_by_entry
static void remove_side_data_by_entry(AVFrameSideData ***sd, int *nb_sd, const AVFrameSideData *target)
Definition: side_data.c:85
AVFrameSideData::buf
AVBufferRef * buf
Definition: frame.h:287
data
const char data[16]
Definition: mxf.c:149
AV_FRAME_DATA_DOVI_RPU_BUFFER
@ AV_FRAME_DATA_DOVI_RPU_BUFFER
Dolby Vision RPU raw data, suitable for passing to x265 or other libraries.
Definition: frame.h:201
AV_FRAME_DATA_DISPLAYMATRIX
@ AV_FRAME_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
Definition: frame.h:85
AVDictionary
Definition: dict.c:32
av_buffer_ref
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition: buffer.c:103
av_frame_side_data_clone
int av_frame_side_data_clone(AVFrameSideData ***sd, int *nb_sd, const AVFrameSideData *src, unsigned int flags)
Add a new side data entry to an array based on existing side data, taking a reference towards the con...
Definition: side_data.c:248
replace_side_data_from_buf
static AVFrameSideData * replace_side_data_from_buf(AVFrameSideData *dst, AVBufferRef *buf, int flags)
Definition: side_data.c:184
AV_FRAME_DATA_MATRIXENCODING
@ AV_FRAME_DATA_MATRIXENCODING
The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.
Definition: frame.h:68
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
AVFrameSideDataType
AVFrameSideDataType
Definition: frame.h:49
AV_SIDE_DATA_PROP_SIZE_DEPENDENT
@ AV_SIDE_DATA_PROP_SIZE_DEPENDENT
Side data depends on the video dimensions.
Definition: frame.h:309
avassert.h
AV_FRAME_SIDE_DATA_FLAG_UNIQUE
#define AV_FRAME_SIDE_DATA_FLAG_UNIQUE
Remove existing entries before adding new ones.
Definition: frame.h:1041
AVFrameSideData::size
size_t size
Definition: frame.h:285
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
AV_FRAME_SIDE_DATA_FLAG_NEW_REF
#define AV_FRAME_SIDE_DATA_FLAG_NEW_REF
Create a new reference to the passed in buffer instead of taking ownership of it.
Definition: frame.h:1051
av_realloc_array
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
Definition: mem.c:217
AV_FRAME_DATA_AUDIO_SERVICE_TYPE
@ AV_FRAME_DATA_AUDIO_SERVICE_TYPE
This side data must be associated with an audio frame and corresponds to enum AVAudioServiceType defi...
Definition: frame.h:114
sd_props
static const AVSideDataDescriptor sd_props[]
Definition: side_data.c:27
AV_SIDE_DATA_PROP_MULTI
@ AV_SIDE_DATA_PROP_MULTI
Multiple instances of this side data type can be meaningfully present in a single side data array.
Definition: frame.h:302
AV_FRAME_DATA_3D_REFERENCE_DISPLAYS
@ AV_FRAME_DATA_3D_REFERENCE_DISPLAYS
This side data contains information about the reference display width(s) and reference viewing distan...
Definition: frame.h:256
AV_SIDE_DATA_PROP_GLOBAL
@ AV_SIDE_DATA_PROP_GLOBAL
The side data type can be used in stream-global structures.
Definition: frame.h:296
AV_FRAME_DATA_DYNAMIC_HDR_VIVID
@ AV_FRAME_DATA_DYNAMIC_HDR_VIVID
HDR Vivid dynamic metadata associated with a video frame.
Definition: frame.h:215
AV_FRAME_DATA_SPHERICAL
@ AV_FRAME_DATA_SPHERICAL
The data represents the AVSphericalMapping structure defined in libavutil/spherical....
Definition: frame.h:131
ff_frame_side_data_add_from_buf
AVFrameSideData * ff_frame_side_data_add_from_buf(AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type, AVBufferRef *buf)
Definition: side_data.c:173
NULL
#define NULL
Definition: coverity.c:32
av_buffer_unref
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
Definition: buffer.c:139
tmp
static uint8_t tmp[20]
Definition: aes_ctr.c:47
av_frame_side_data_remove
void av_frame_side_data_remove(AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type)
Remove and free all side data instances of the given type from an array.
Definition: side_data.c:102
AV_FRAME_DATA_ICC_PROFILE
@ AV_FRAME_DATA_ICC_PROFILE
The data contains an ICC profile as an opaque octet buffer following the format described by ISO 1507...
Definition: frame.h:144
AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
Definition: frame.h:120
AV_FRAME_SIDE_DATA_FLAG_REPLACE
#define AV_FRAME_SIDE_DATA_FLAG_REPLACE
Don't add a new entry if another of the same type exists.
Definition: frame.h:1046
AV_FRAME_DATA_AFD
@ AV_FRAME_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
Definition: frame.h:90
AV_FRAME_DATA_SEI_UNREGISTERED
@ AV_FRAME_DATA_SEI_UNREGISTERED
User data unregistered metadata associated with a video frame.
Definition: frame.h:178
AV_FRAME_DATA_REPLAYGAIN
@ AV_FRAME_DATA_REPLAYGAIN
ReplayGain information in the form of the AVReplayGain struct.
Definition: frame.h:77
AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT
@ AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT
Ambient viewing environment metadata, as defined by H.274.
Definition: frame.h:220
AV_FRAME_DATA_PANSCAN
@ AV_FRAME_DATA_PANSCAN
The data is the AVPanScan struct defined in libavcodec.
Definition: frame.h:53
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:87
AV_FRAME_DATA_LCEVC
@ AV_FRAME_DATA_LCEVC
Raw LCEVC payload data, as a uint8_t array, with NAL emulation bytes intact.
Definition: frame.h:236
size
int size
Definition: twinvq_data.h:10344
AVFrameSideData::data
uint8_t * data
Definition: frame.h:284
frame.h
buffer.h
av_dict_free
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
Definition: dict.c:233
av_buffer_alloc
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
Definition: buffer.c:77
av_frame_side_data_remove_by_props
void av_frame_side_data_remove_by_props(AVFrameSideData ***sd, int *nb_sd, int props)
Remove and free all side data instances that match any of the given side data properties.
Definition: side_data.c:117
AVBufferRef::size
size_t size
Size of data in bytes.
Definition: buffer.h:94
AV_FRAME_DATA_VIEW_ID
@ AV_FRAME_DATA_VIEW_ID
This side data must be associated with a video frame.
Definition: frame.h:245
AV_FRAME_DATA_SKIP_SAMPLES
@ AV_FRAME_DATA_SKIP_SAMPLES
Recommends skipping the specified number of samples.
Definition: frame.h:109
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
Definition: frame.h:137
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AV_SIDE_DATA_PROP_CHANNEL_DEPENDENT
@ AV_SIDE_DATA_PROP_CHANNEL_DEPENDENT
Side data depends on the channel layout.
Definition: frame.h:323
av_frame_side_data_free
void av_frame_side_data_free(AVFrameSideData ***sd, int *nb_sd)
Free all side data entries and their contents, then zeroes out the values which the pointers are poin...
Definition: side_data.c:133
common.h
AV_FRAME_DATA_STEREO3D
@ AV_FRAME_DATA_STEREO3D
Stereoscopic 3d metadata.
Definition: frame.h:64
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
av_mallocz
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:256
av_buffer_replace
int av_buffer_replace(AVBufferRef **pdst, const AVBufferRef *src)
Ensure dst refers to the same data as src.
Definition: buffer.c:233
AV_SIDE_DATA_PROP_COLOR_DEPENDENT
@ AV_SIDE_DATA_PROP_COLOR_DEPENDENT
Side data depends on the video color space.
Definition: frame.h:316
ret
ret
Definition: filter_design.txt:187
AV_FRAME_DATA_GOP_TIMECODE
@ AV_FRAME_DATA_GOP_TIMECODE
The GOP timecode in 25 bit timecode format.
Definition: frame.h:125
AV_FRAME_DATA_VIDEO_HINT
@ AV_FRAME_DATA_VIDEO_HINT
Provide encoder-specific hinting information about changed/unchanged portions of a frame.
Definition: frame.h:230
side_data.h
dict.h
AV_FRAME_DATA_DYNAMIC_HDR_PLUS
@ AV_FRAME_DATA_DYNAMIC_HDR_PLUS
HDR dynamic metadata associated with a video frame.
Definition: frame.h:159
add_side_data_from_buf_ext
static AVFrameSideData * add_side_data_from_buf_ext(AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type, AVBufferRef *buf, uint8_t *data, size_t size)
Definition: side_data.c:142
av_frame_side_data_new
AVFrameSideData * av_frame_side_data_new(AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type, size_t size, unsigned int flags)
Add new side data entry to an array.
Definition: side_data.c:198
AV_FRAME_DATA_VIDEO_ENC_PARAMS
@ AV_FRAME_DATA_VIDEO_ENC_PARAMS
Encoding parameters for a video frame, as described by AVVideoEncParams.
Definition: frame.h:170
AVSideDataDescriptor
This struct describes the properties of a side data type.
Definition: frame.h:330
desc
const char * desc
Definition: libsvtav1.c:79
mem.h
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
AVFrameSideData
Structure to hold side data for an AVFrame.
Definition: frame.h:282
av_frame_side_data_desc
const AVSideDataDescriptor * av_frame_side_data_desc(enum AVFrameSideDataType type)
Definition: side_data.c:62
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
av_dict_copy
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
Definition: dict.c:247
av_frame_side_data_name
const char * av_frame_side_data_name(enum AVFrameSideDataType type)
Definition: side_data.c:70
av_frame_side_data_get
static const AVFrameSideData * av_frame_side_data_get(AVFrameSideData *const *sd, const int nb_sd, enum AVFrameSideDataType type)
Wrapper around av_frame_side_data_get_c() to workaround the limitation that for any type T the conver...
Definition: frame.h:1144
AV_FRAME_DATA_EXIF
@ AV_FRAME_DATA_EXIF
Extensible image file format metadata.
Definition: frame.h:262
AV_FRAME_DATA_REGIONS_OF_INTEREST
@ AV_FRAME_DATA_REGIONS_OF_INTEREST
Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of array element is ...
Definition: frame.h:165
AVERROR_BUG
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Definition: error.h:52
AVFrameSideData::metadata
AVDictionary * metadata
Definition: frame.h:286
av_frame_side_data_get_c
const AVFrameSideData * av_frame_side_data_get_c(const AVFrameSideData *const *sd, const int nb_sd, enum AVFrameSideDataType type)
Get a side data entry of a specific type from an array.
Definition: side_data.c:306
AV_FRAME_DATA_MOTION_VECTORS
@ AV_FRAME_DATA_MOTION_VECTORS
Motion vectors exported by some codecs (on demand through the export_mvs flag set in the libavcodec A...
Definition: frame.h:97
AV_FRAME_DATA_DOWNMIX_INFO
@ AV_FRAME_DATA_DOWNMIX_INFO
Metadata relevant to a downmix procedure.
Definition: frame.h:73
av_frame_side_data_add
AVFrameSideData * av_frame_side_data_add(AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type, AVBufferRef **pbuf, unsigned int flags)
Add a new side data entry to an array from an existing AVBufferRef.
Definition: side_data.c:223
src
#define src
Definition: vp8dsp.c:248
AV_FRAME_DATA_DETECTION_BBOXES
@ AV_FRAME_DATA_DETECTION_BBOXES
Bounding boxes for object detection and classification, as described by AVDetectionBBoxHeader.
Definition: frame.h:194