FFmpeg
packet.h
Go to the documentation of this file.
1 /*
2  * AVPacket public API
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVCODEC_PACKET_H
22 #define AVCODEC_PACKET_H
23 
24 #include <stddef.h>
25 #include <stdint.h>
26 
27 #include "libavutil/attributes.h"
28 #include "libavutil/buffer.h"
29 #include "libavutil/dict.h"
30 #include "libavutil/rational.h"
31 
32 #include "libavcodec/version.h"
33 
34 /**
35  * @defgroup lavc_packet AVPacket
36  *
37  * Types and functions for working with AVPacket.
38  * @{
39  */
41  /**
42  * An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE
43  * bytes worth of palette. This side data signals that a new palette is
44  * present.
45  */
47 
48  /**
49  * The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format
50  * that the extradata buffer was changed and the receiving side should
51  * act upon it appropriately. The new extradata is embedded in the side
52  * data buffer and should be immediately used for processing the current
53  * frame or packet.
54  */
56 
57  /**
58  * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
59  * @code
60  * u32le param_flags
61  * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
62  * s32le channel_count
63  * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
64  * u64le channel_layout
65  * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
66  * s32le sample_rate
67  * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
68  * s32le width
69  * s32le height
70  * @endcode
71  */
73 
74  /**
75  * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of
76  * structures with info about macroblocks relevant to splitting the
77  * packet into smaller packets on macroblock edges (e.g. as for RFC 2190).
78  * That is, it does not necessarily contain info about all macroblocks,
79  * as long as the distance between macroblocks in the info is smaller
80  * than the target payload size.
81  * Each MB info structure is 12 bytes, and is laid out as follows:
82  * @code
83  * u32le bit offset from the start of the packet
84  * u8 current quantizer at the start of the macroblock
85  * u8 GOB number
86  * u16le macroblock address within the GOB
87  * u8 horizontal MV predictor
88  * u8 vertical MV predictor
89  * u8 horizontal MV predictor for block number 3
90  * u8 vertical MV predictor for block number 3
91  * @endcode
92  */
94 
95  /**
96  * This side data should be associated with an audio stream and contains
97  * ReplayGain information in form of the AVReplayGain struct.
98  */
100 
101  /**
102  * This side data contains a 3x3 transformation matrix describing an affine
103  * transformation that needs to be applied to the decoded video frames for
104  * correct presentation.
105  *
106  * See libavutil/display.h for a detailed description of the data.
107  */
109 
110  /**
111  * This side data should be associated with a video stream and contains
112  * Stereoscopic 3D information in form of the AVStereo3D struct.
113  */
115 
116  /**
117  * This side data should be associated with an audio stream and corresponds
118  * to enum AVAudioServiceType.
119  */
121 
122  /**
123  * This side data contains quality related information from the encoder.
124  * @code
125  * u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad).
126  * u8 picture type
127  * u8 error count
128  * u16 reserved
129  * u64le[error count] sum of squared differences between encoder in and output
130  * @endcode
131  */
133 
134  /**
135  * This side data contains an integer value representing the stream index
136  * of a "fallback" track. A fallback track indicates an alternate
137  * track to use when the current track can not be decoded for some reason.
138  * e.g. no decoder available for codec.
139  */
141 
142  /**
143  * This side data corresponds to the AVCPBProperties struct.
144  */
146 
147  /**
148  * Recommmends skipping the specified number of samples
149  * @code
150  * u32le number of samples to skip from start of this packet
151  * u32le number of samples to skip from end of this packet
152  * u8 reason for start skip
153  * u8 reason for end skip (0=padding silence, 1=convergence)
154  * @endcode
155  */
157 
158  /**
159  * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that
160  * the packet may contain "dual mono" audio specific to Japanese DTV
161  * and if it is true, recommends only the selected channel to be used.
162  * @code
163  * u8 selected channels (0=mail/left, 1=sub/right, 2=both)
164  * @endcode
165  */
167 
168  /**
169  * A list of zero terminated key/value strings. There is no end marker for
170  * the list, so it is required to rely on the side data size to stop.
171  */
173 
174  /**
175  * Subtitle event position
176  * @code
177  * u32le x1
178  * u32le y1
179  * u32le x2
180  * u32le y2
181  * @endcode
182  */
184 
185  /**
186  * Data found in BlockAdditional element of matroska container. There is
187  * no end marker for the data, so it is required to rely on the side data
188  * size to recognize the end. 8 byte id (as found in BlockAddId) followed
189  * by data.
190  */
192 
193  /**
194  * The optional first identifier line of a WebVTT cue.
195  */
197 
198  /**
199  * The optional settings (rendering instructions) that immediately
200  * follow the timestamp specifier of a WebVTT cue.
201  */
203 
204  /**
205  * A list of zero terminated key/value strings. There is no end marker for
206  * the list, so it is required to rely on the side data size to stop. This
207  * side data includes updated metadata which appeared in the stream.
208  */
210 
211  /**
212  * MPEGTS stream ID as uint8_t, this is required to pass the stream ID
213  * information from the demuxer to the corresponding muxer.
214  */
216 
217  /**
218  * Mastering display metadata (based on SMPTE-2086:2014). This metadata
219  * should be associated with a video stream and contains data in the form
220  * of the AVMasteringDisplayMetadata struct.
221  */
223 
224  /**
225  * This side data should be associated with a video stream and corresponds
226  * to the AVSphericalMapping structure.
227  */
229 
230  /**
231  * Content light level (based on CTA-861.3). This metadata should be
232  * associated with a video stream and contains data in the form of the
233  * AVContentLightMetadata struct.
234  */
236 
237  /**
238  * ATSC A53 Part 4 Closed Captions. This metadata should be associated with
239  * a video stream. A53 CC bitstream is stored as uint8_t in AVPacketSideData.data.
240  * The number of bytes of CC data is AVPacketSideData.size.
241  */
243 
244  /**
245  * This side data is encryption initialization data.
246  * The format is not part of ABI, use av_encryption_init_info_* methods to
247  * access.
248  */
250 
251  /**
252  * This side data contains encryption info for how to decrypt the packet.
253  * The format is not part of ABI, use av_encryption_info_* methods to access.
254  */
256 
257  /**
258  * Active Format Description data consisting of a single byte as specified
259  * in ETSI TS 101 154 using AVActiveFormatDescription enum.
260  */
262 
263  /**
264  * Producer Reference Time data corresponding to the AVProducerReferenceTime struct,
265  * usually exported by some encoders (on demand through the prft flag set in the
266  * AVCodecContext export_side_data field).
267  */
269 
270  /**
271  * ICC profile data consisting of an opaque octet buffer following the
272  * format described by ISO 15076-1.
273  */
275 
276  /**
277  * DOVI configuration
278  * ref:
279  * dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2, section 2.2
280  * dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2, section 3.3
281  * Tags are stored in struct AVDOVIDecoderConfigurationRecord.
282  */
284 
285  /**
286  * The number of side data types.
287  * This is not part of the public API/ABI in the sense that it may
288  * change when new side data types are added.
289  * This must stay the last enum value.
290  * If its value becomes huge, some code using it
291  * needs to be updated as it assumes it to be smaller than other limits.
292  */
294 };
295 
296 #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
297 
298 typedef struct AVPacketSideData {
300  int size;
303 
304 /**
305  * This structure stores compressed data. It is typically exported by demuxers
306  * and then passed as input to decoders, or received as output from encoders and
307  * then passed to muxers.
308  *
309  * For video, it should typically contain one compressed frame. For audio it may
310  * contain several compressed frames. Encoders are allowed to output empty
311  * packets, with no compressed data, containing only side data
312  * (e.g. to update some stream parameters at the end of encoding).
313  *
314  * AVPacket is one of the few structs in FFmpeg, whose size is a part of public
315  * ABI. Thus it may be allocated on stack and no new fields can be added to it
316  * without libavcodec and libavformat major bump.
317  *
318  * The semantics of data ownership depends on the buf field.
319  * If it is set, the packet data is dynamically allocated and is
320  * valid indefinitely until a call to av_packet_unref() reduces the
321  * reference count to 0.
322  *
323  * If the buf field is not set av_packet_ref() would make a copy instead
324  * of increasing the reference count.
325  *
326  * The side data is always allocated with av_malloc(), copied by
327  * av_packet_ref() and freed by av_packet_unref().
328  *
329  * @see av_packet_ref
330  * @see av_packet_unref
331  */
332 typedef struct AVPacket {
333  /**
334  * A reference to the reference-counted buffer where the packet data is
335  * stored.
336  * May be NULL, then the packet data is not reference-counted.
337  */
339  /**
340  * Presentation timestamp in AVStream->time_base units; the time at which
341  * the decompressed packet will be presented to the user.
342  * Can be AV_NOPTS_VALUE if it is not stored in the file.
343  * pts MUST be larger or equal to dts as presentation cannot happen before
344  * decompression, unless one wants to view hex dumps. Some formats misuse
345  * the terms dts and pts/cts to mean something different. Such timestamps
346  * must be converted to true pts/dts before they are stored in AVPacket.
347  */
348  int64_t pts;
349  /**
350  * Decompression timestamp in AVStream->time_base units; the time at which
351  * the packet is decompressed.
352  * Can be AV_NOPTS_VALUE if it is not stored in the file.
353  */
354  int64_t dts;
356  int size;
358  /**
359  * A combination of AV_PKT_FLAG values
360  */
361  int flags;
362  /**
363  * Additional packet data that can be provided by the container.
364  * Packet can contain several types of side information.
365  */
368 
369  /**
370  * Duration of this packet in AVStream->time_base units, 0 if unknown.
371  * Equals next_pts - this_pts in presentation order.
372  */
373  int64_t duration;
374 
375  int64_t pos; ///< byte position in stream, -1 if unknown
376 
377 #if FF_API_CONVERGENCE_DURATION
378  /**
379  * @deprecated Same as the duration field, but as int64_t. This was required
380  * for Matroska subtitles, whose duration values could overflow when the
381  * duration field was still an int.
382  */
384  int64_t convergence_duration;
385 #endif
386 } AVPacket;
387 
388 #define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe
389 #define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
390 /**
391  * Flag is used to discard packets which are required to maintain valid
392  * decoder state but are not required for output and should be dropped
393  * after decoding.
394  **/
395 #define AV_PKT_FLAG_DISCARD 0x0004
396 /**
397  * The packet comes from a trusted source.
398  *
399  * Otherwise-unsafe constructs such as arbitrary pointers to data
400  * outside the packet may be followed.
401  */
402 #define AV_PKT_FLAG_TRUSTED 0x0008
403 /**
404  * Flag is used to indicate packets that contain frames that can
405  * be discarded by the decoder. I.e. Non-reference frames.
406  */
407 #define AV_PKT_FLAG_DISPOSABLE 0x0010
408 
414 };
415 
416 /**
417  * Allocate an AVPacket and set its fields to default values. The resulting
418  * struct must be freed using av_packet_free().
419  *
420  * @return An AVPacket filled with default values or NULL on failure.
421  *
422  * @note this only allocates the AVPacket itself, not the data buffers. Those
423  * must be allocated through other means such as av_new_packet.
424  *
425  * @see av_new_packet
426  */
428 
429 /**
430  * Create a new packet that references the same data as src.
431  *
432  * This is a shortcut for av_packet_alloc()+av_packet_ref().
433  *
434  * @return newly created AVPacket on success, NULL on error.
435  *
436  * @see av_packet_alloc
437  * @see av_packet_ref
438  */
440 
441 /**
442  * Free the packet, if the packet is reference counted, it will be
443  * unreferenced first.
444  *
445  * @param pkt packet to be freed. The pointer will be set to NULL.
446  * @note passing NULL is a no-op.
447  */
448 void av_packet_free(AVPacket **pkt);
449 
450 /**
451  * Initialize optional fields of a packet with default values.
452  *
453  * Note, this does not touch the data and size members, which have to be
454  * initialized separately.
455  *
456  * @param pkt packet
457  */
459 
460 /**
461  * Allocate the payload of a packet and initialize its fields with
462  * default values.
463  *
464  * @param pkt packet
465  * @param size wanted payload size
466  * @return 0 if OK, AVERROR_xxx otherwise
467  */
468 int av_new_packet(AVPacket *pkt, int size);
469 
470 /**
471  * Reduce packet size, correctly zeroing padding
472  *
473  * @param pkt packet
474  * @param size new size
475  */
476 void av_shrink_packet(AVPacket *pkt, int size);
477 
478 /**
479  * Increase packet size, correctly zeroing padding
480  *
481  * @param pkt packet
482  * @param grow_by number of bytes by which to increase the size of the packet
483  */
484 int av_grow_packet(AVPacket *pkt, int grow_by);
485 
486 /**
487  * Initialize a reference-counted packet from av_malloc()ed data.
488  *
489  * @param pkt packet to be initialized. This function will set the data, size,
490  * and buf fields, all others are left untouched.
491  * @param data Data allocated by av_malloc() to be used as packet data. If this
492  * function returns successfully, the data is owned by the underlying AVBuffer.
493  * The caller may not access the data through other means.
494  * @param size size of data in bytes, without the padding. I.e. the full buffer
495  * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE.
496  *
497  * @return 0 on success, a negative AVERROR on error
498  */
500 
501 #if FF_API_AVPACKET_OLD_API
502 /**
503  * @warning This is a hack - the packet memory allocation stuff is broken. The
504  * packet is allocated if it was not really allocated.
505  *
506  * @deprecated Use av_packet_ref or av_packet_make_refcounted
507  */
510 /**
511  * Copy packet, including contents
512  *
513  * @return 0 on success, negative AVERROR on fail
514  *
515  * @deprecated Use av_packet_ref
516  */
518 int av_copy_packet(AVPacket *dst, const AVPacket *src);
519 
520 /**
521  * Copy packet side data
522  *
523  * @return 0 on success, negative AVERROR on fail
524  *
525  * @deprecated Use av_packet_copy_props
526  */
529 
530 /**
531  * Free a packet.
532  *
533  * @deprecated Use av_packet_unref
534  *
535  * @param pkt packet to free
536  */
539 #endif
540 /**
541  * Allocate new information of a packet.
542  *
543  * @param pkt packet
544  * @param type side information type
545  * @param size side information size
546  * @return pointer to fresh allocated data or NULL otherwise
547  */
549  int size);
550 
551 /**
552  * Wrap an existing array as a packet side data.
553  *
554  * @param pkt packet
555  * @param type side information type
556  * @param data the side data array. It must be allocated with the av_malloc()
557  * family of functions. The ownership of the data is transferred to
558  * pkt.
559  * @param size side information size
560  * @return a non-negative number on success, a negative AVERROR code on
561  * failure. On failure, the packet is unchanged and the data remains
562  * owned by the caller.
563  */
565  uint8_t *data, size_t size);
566 
567 /**
568  * Shrink the already allocated side data buffer
569  *
570  * @param pkt packet
571  * @param type side information type
572  * @param size new side information size
573  * @return 0 on success, < 0 on failure
574  */
576  int size);
577 
578 /**
579  * Get side information from packet.
580  *
581  * @param pkt packet
582  * @param type desired side information type
583  * @param size pointer for side information size to store (optional)
584  * @return pointer to data if present or NULL otherwise
585  */
587  int *size);
588 
589 #if FF_API_MERGE_SD_API
592 
595 #endif
596 
598 
599 /**
600  * Pack a dictionary for use in side_data.
601  *
602  * @param dict The dictionary to pack.
603  * @param size pointer to store the size of the returned data
604  * @return pointer to data if successful, NULL otherwise
605  */
607 /**
608  * Unpack a dictionary from side_data.
609  *
610  * @param data data from side_data
611  * @param size size of the data
612  * @param dict the metadata storage dictionary
613  * @return 0 on success, < 0 on failure
614  */
615 int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict);
616 
617 
618 /**
619  * Convenience function to free all the side data stored.
620  * All the other fields stay untouched.
621  *
622  * @param pkt packet
623  */
625 
626 /**
627  * Setup a new reference to the data described by a given packet
628  *
629  * If src is reference-counted, setup dst as a new reference to the
630  * buffer in src. Otherwise allocate a new buffer in dst and copy the
631  * data from src into it.
632  *
633  * All the other fields are copied from src.
634  *
635  * @see av_packet_unref
636  *
637  * @param dst Destination packet. Will be completely overwritten.
638  * @param src Source packet
639  *
640  * @return 0 on success, a negative AVERROR on error. On error, dst
641  * will be blank (as if returned by av_packet_alloc()).
642  */
643 int av_packet_ref(AVPacket *dst, const AVPacket *src);
644 
645 /**
646  * Wipe the packet.
647  *
648  * Unreference the buffer referenced by the packet and reset the
649  * remaining packet fields to their default values.
650  *
651  * @param pkt The packet to be unreferenced.
652  */
654 
655 /**
656  * Move every field in src to dst and reset src.
657  *
658  * @see av_packet_unref
659  *
660  * @param src Source packet, will be reset
661  * @param dst Destination packet
662  */
664 
665 /**
666  * Copy only "properties" fields from src to dst.
667  *
668  * Properties for the purpose of this function are all the fields
669  * beside those related to the packet data (buf, data, size)
670  *
671  * @param dst Destination packet
672  * @param src Source packet
673  *
674  * @return 0 on success AVERROR on failure.
675  */
676 int av_packet_copy_props(AVPacket *dst, const AVPacket *src);
677 
678 /**
679  * Ensure the data described by a given packet is reference counted.
680  *
681  * @note This function does not ensure that the reference will be writable.
682  * Use av_packet_make_writable instead for that purpose.
683  *
684  * @see av_packet_ref
685  * @see av_packet_make_writable
686  *
687  * @param pkt packet whose data should be made reference counted.
688  *
689  * @return 0 on success, a negative AVERROR on error. On failure, the
690  * packet is unchanged.
691  */
693 
694 /**
695  * Create a writable reference for the data described by a given packet,
696  * avoiding data copy if possible.
697  *
698  * @param pkt Packet whose data should be made writable.
699  *
700  * @return 0 on success, a negative AVERROR on failure. On failure, the
701  * packet is unchanged.
702  */
704 
705 /**
706  * Convert valid timing fields (timestamps / durations) in a packet from one
707  * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be
708  * ignored.
709  *
710  * @param pkt packet on which the conversion will be performed
711  * @param tb_src source timebase, in which the timing fields in pkt are
712  * expressed
713  * @param tb_dst destination timebase, to which the timing fields will be
714  * converted
715  */
716 void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst);
717 
718 /**
719  * @}
720  */
721 
722 #endif // AVCODEC_PACKET_H
AVSideDataParamChangeFlags
Definition: packet.h:409
Producer Reference Time data corresponding to the AVProducerReferenceTime struct, usually exported by...
Definition: packet.h:268
AVPacketSideDataType
Definition: packet.h:40
A list of zero terminated key/value strings.
Definition: packet.h:209
The optional first identifier line of a WebVTT cue.
Definition: packet.h:196
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:100
int64_t pos
byte position in stream, -1 if unknown
Definition: packet.h:375
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
Definition: avpacket.c:102
Subtitle event position.
Definition: packet.h:183
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
Definition: packet.h:114
ATSC A53 Part 4 Closed Captions.
Definition: packet.h:242
int size
Definition: packet.h:356
This side data contains an integer value representing the stream index of a "fallback" track...
Definition: packet.h:140
GLint GLenum type
Definition: opengl_enc.c:104
static AVPacket pkt
An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of structures with info about macroblo...
Definition: packet.h:93
Macro definitions for various function/variable attributes.
Mastering display metadata (based on SMPTE-2086:2014).
Definition: packet.h:222
Public dictionary API.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
Definition: avpacket.c:63
uint8_t
int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict)
Unpack a dictionary from side_data.
Definition: avpacket.c:528
int av_packet_split_side_data(AVPacket *pkt)
Definition: avpacket.c:445
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: packet.h:373
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
Definition: packet.h:108
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
Initialize a reference-counted packet from av_malloc()ed data.
Definition: avpacket.c:154
int av_packet_merge_side_data(AVPacket *pkt)
Definition: avpacket.c:410
uint8_t * data
Definition: packet.h:355
This side data is encryption initialization data.
Definition: packet.h:249
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
Definition: avpacket.c:662
uint8_t * data
Definition: packet.h:299
ptrdiff_t size
Definition: opengl_enc.c:100
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
Definition: avpacket.c:613
int av_packet_make_writable(AVPacket *pkt)
Create a writable reference for the data described by a given packet, avoiding data copy if possible...
Definition: avpacket.c:689
MPEGTS stream ID as uint8_t, this is required to pass the stream ID information from the demuxer to t...
Definition: packet.h:215
Libavcodec version macros.
#define src
Definition: vp8dsp.c:254
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
Definition: avpacket.c:87
DOVI configuration ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2, section 2.2 dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2, section 3.3 Tags are stored in struct AVDOVIDecoderConfigurationRecord.
Definition: packet.h:283
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette...
Definition: packet.h:46
AVPacket * av_packet_clone(const AVPacket *src)
Create a new packet that references the same data as src.
Definition: avpacket.c:649
void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst)
Convert valid timing fields (timestamps / durations) in a packet from one timebase to another...
Definition: avpacket.c:711
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
Definition: packet.h:72
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
Definition: avpacket.c:352
void av_packet_free_side_data(AVPacket *pkt)
Convenience function to free all the side data stored.
Definition: avpacket.c:272
ICC profile data consisting of an opaque octet buffer following the format described by ISO 15076-1...
Definition: packet.h:274
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
Definition: packet.h:338
enum AVPacketSideDataType type
Definition: packet.h:301
int side_data_elems
Definition: packet.h:367
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Shrink the already allocated side data buffer.
Definition: avpacket.c:554
int flags
A combination of AV_PKT_FLAG values.
Definition: packet.h:361
int av_copy_packet_side_data(AVPacket *pkt, const AVPacket *src)
Definition: avpacket.c:228
int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
Copy only "properties" fields from src to dst.
Definition: avpacket.c:570
This side data contains quality related information from the encoder.
Definition: packet.h:132
int av_packet_make_refcounted(AVPacket *pkt)
Ensure the data described by a given packet is reference counted.
Definition: avpacket.c:670
This side data should be associated with a video stream and corresponds to the AVSphericalMapping str...
Definition: packet.h:228
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
Definition: packet.h:261
Content light level (based on CTA-861.3).
Definition: packet.h:235
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
Definition: packet.h:55
A list of zero terminated key/value strings.
Definition: packet.h:172
uint8_t * av_packet_pack_dictionary(AVDictionary *dict, int *size)
Pack a dictionary for use in side_data.
Definition: avpacket.c:493
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
Definition: avpacket.c:604
Data found in BlockAdditional element of matroska container.
Definition: packet.h:191
Rational number (pair of numerator and denominator).
Definition: rational.h:58
Recommmends skipping the specified number of samples.
Definition: packet.h:156
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, uint8_t *data, size_t size)
Wrap an existing array as a packet side data.
Definition: avpacket.c:297
FF_DISABLE_DEPRECATION_WARNINGS void av_free_packet(AVPacket *pkt)
Definition: avpacket.c:283
refcounted data buffer API
This side data contains encryption info for how to decrypt the packet.
Definition: packet.h:255
int av_copy_packet(AVPacket *dst, const AVPacket *src)
Definition: avpacket.c:264
This side data should be associated with an audio stream and contains ReplayGain information in form ...
Definition: packet.h:99
#define attribute_deprecated
Definition: attributes.h:100
A reference to a data buffer.
Definition: buffer.h:81
An AV_PKT_DATA_JP_DUALMONO side data packet indicates that the packet may contain "dual mono" audio s...
Definition: packet.h:166
AVPacketSideData * side_data
Additional packet data that can be provided by the container.
Definition: packet.h:366
Utilties for rational number calculation.
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
Definition: avpacket.c:110
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
Definition: avpacket.c:34
The optional settings (rendering instructions) that immediately follow the timestamp specifier of a W...
Definition: packet.h:202
int av_dup_packet(AVPacket *pkt)
Definition: avpacket.c:253
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
Definition: avpacket.c:52
This side data corresponds to the AVCPBProperties struct.
Definition: packet.h:145
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
Definition: packet.h:354
const char * av_packet_side_data_name(enum AVPacketSideDataType type)
Definition: avpacket.c:369
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
Definition: avpacket.c:331
int stream_index
Definition: packet.h:357
The number of side data types.
Definition: packet.h:293
This structure stores compressed data.
Definition: packet.h:332
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:348
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType.
Definition: packet.h:120