diff mbox series

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

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

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer Sept. 27, 2023, 1:12 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 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Anton Khirnov Oct. 3, 2023, 11:02 a.m. UTC | #1
Quoting James Almer (2023-09-27 15:12:35)
> Explaining what or who may use it, and in what scenarios.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/packet.h | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> index 96fc0084d6..f88dad2b3c 100644
> --- a/libavcodec/packet.h
> +++ b/libavcodec/packet.h
> @@ -312,6 +312,21 @@ enum AVPacketSideDataType {
>  
>  #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
>  
> +/**
> + * This structure stores auxiliary
...information for decoding, presenting, or otherwise processing the
coded stream.

> It is typically exported by demuxers
> + * within @ref AVStream.codecpar.side_data "AVStream's codec parameters" or an
> + * @ref AVPacket.side_data "AVPacket" and then passed as input to decoders
> + * through the @ref AVCodecContext.coded_side_data "decoder context's side data"
> + * for initialization or through @ref AVPacket.side_data "AVPacket", or received
> + * as output from encoders within the @ref AVCodecContext.coded_side_data
> + * "encoder context's side data" or @ref AVPacket.side_data "AVPacket" and then
> + * passed to muxers through @ref AVStream.codecpar.side_data "AVStream's codec
> + * parameters" for initialization or through @ref AVPacket.side_data "AVPacket".

Long sentence is long. Consider the following:
* first state that it may be global or per-packet
* then describe the typical decoding path (demuxer->decoder, mention
  that it may be mapped to frame side data)
* then same for encoding

> + * Different modules may export or be provided different types of side data
                            ^^^^^^^^^^^^^^^^^^^^^
accept or export

Also, the doxy for AVCodecContext.coded_side_data,
AVCodecParameters.side_data and AVPacket.side_data should link to this
text, so it's actually discoverable for readers.
diff mbox series

Patch

diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index 96fc0084d6..f88dad2b3c 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -312,6 +312,21 @@  enum AVPacketSideDataType {
 
 #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
 
+/**
+ * This structure stores auxiliary data. It is typically exported by demuxers
+ * within @ref AVStream.codecpar.side_data "AVStream's codec parameters" or an
+ * @ref AVPacket.side_data "AVPacket" and then passed as input to decoders
+ * through the @ref AVCodecContext.coded_side_data "decoder context's side data"
+ * for initialization or through @ref AVPacket.side_data "AVPacket", or received
+ * as output from encoders within the @ref AVCodecContext.coded_side_data
+ * "encoder context's side data" or @ref AVPacket.side_data "AVPacket" and then
+ * passed to muxers through @ref AVStream.codecpar.side_data "AVStream's codec
+ * parameters" for initialization or through @ref AVPacket.side_data "AVPacket".
+ *
+ * Different modules may export or be provided 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;