[FFmpeg-devel] [PATCH v3 08/12] avcodec: add side data set to AVCodecContext

Jan Ekström jeebjp at gmail.com
Fri Aug 18 00:48:46 EEST 2023


This allows configuring an encoder by using AVFrameSideData.
---
 libavcodec/avcodec.h | 7 +++++++
 libavcodec/options.c | 1 +
 2 files changed, 8 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 649411ac79..500a8f3e49 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2100,6 +2100,13 @@ typedef struct AVCodecContext {
      *   an error.
      */
     int64_t frame_num;
+
+    /**
+     * Set containing static side data, such as HDR10 CLL / MDCV structures.
+     * - encoding: set by user
+     * - decoding: unused
+     */
+    AVFrameSideDataSet side_data_set;
 } AVCodecContext;
 
 /**
diff --git a/libavcodec/options.c b/libavcodec/options.c
index a9b35ee1c3..fff2c53ae3 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -180,6 +180,7 @@ void avcodec_free_context(AVCodecContext **pavctx)
     av_freep(&avctx->inter_matrix);
     av_freep(&avctx->rc_override);
     av_channel_layout_uninit(&avctx->ch_layout);
+    av_side_data_set_uninit(&avctx->side_data_set);
 
     av_freep(pavctx);
 }
-- 
2.41.0



More information about the ffmpeg-devel mailing list