diff mbox series

[FFmpeg-devel,04/11] avcodec/packet: add some documentation for AVPacketSideData

Message ID 20231004122849.56604-5-jamrial@gmail.com
State New
Headers show
Series AVCodecContext and AVCodecParameters side data | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

James Almer Oct. 4, 2023, 12:28 p.m. UTC
Explaining what or who may use it, and in what scenarios.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/packet.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Anton Khirnov Oct. 4, 2023, 2:46 p.m. UTC | #1
Quoting James Almer (2023-10-04 14:28:42)
> Explaining what or who may use it, and in what scenarios.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/packet.h | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> index 96fc0084d6..85b3eeb728 100644
> --- a/libavcodec/packet.h
> +++ b/libavcodec/packet.h
> @@ -312,6 +312,25 @@ enum AVPacketSideDataType {
>  
>  #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
>  
> +/**
> + * This structure stores information for decoding, presenting, or otherwise
                           ^
I didn't mean for you to drop the 'auxiliary' that used to be here - it
(or some other equivalent wording) should be here to make it clear that
side data applies in additon/on top of the main coded bitstream.

> + * processing the coded stream. It is typically exported by demuxers and
> + * encoders and can be fed to decoders and muxers in a per packet basis, or as
                                                    ^
                                                   / \
                                                  either

> + * global side data (applying to the entire coded stream) as follows:

The following bullet points apply only to the global side data, so you
should start a new sentence that makes that explicit.

> + * - During demuxing, it will be exported through global side data in
> + *   @ref AVStream.codecpar.side_data "AVStream's codec parameters", which can
> + *   then be passed as input to decoders through the
> + *   @ref AVCodecContext.coded_side_data "decoder context's side data", for
> + *   initialization.
> + * - For muxing, it can be fed through global side data in
> + *   @ref AVStream.codecpar.side_data "AVStream's codec parameters", typically
> + *   the output of encoders through the @ref AVCodecContext.coded_side_data
> + *   "encoder context's side data", for initialization.
> + *
> + * Different modules may accept or export different types of side data
> + * depending on media type and codec. Refer to @ref AVPacketSideDataType for a
> + * list of defined types and where they may be found or used.
> + */
diff mbox series

Patch

diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index 96fc0084d6..85b3eeb728 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -312,6 +312,25 @@  enum AVPacketSideDataType {
 
 #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
 
+/**
+ * This structure stores information for decoding, presenting, or otherwise
+ * processing the coded stream. It is typically exported by demuxers and
+ * encoders and can be fed to decoders and muxers in a per packet basis, or as
+ * global side data (applying to the entire coded stream) as follows:
+ * - During demuxing, it will be exported through global side data in
+ *   @ref AVStream.codecpar.side_data "AVStream's codec parameters", which can
+ *   then be passed as input to decoders through the
+ *   @ref AVCodecContext.coded_side_data "decoder context's side data", for
+ *   initialization.
+ * - For muxing, it can be fed through global side data in
+ *   @ref AVStream.codecpar.side_data "AVStream's codec parameters", typically
+ *   the output of encoders through the @ref AVCodecContext.coded_side_data
+ *   "encoder context's side data", for initialization.
+ *
+ * Different modules may accept or export different types of side data
+ * depending on media type and codec. Refer to @ref AVPacketSideDataType for a
+ * list of defined types and where they may be found or used.
+ */
 typedef struct AVPacketSideData {
     uint8_t *data;
     size_t   size;