aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2022-11-03 22:04:50 +0200
committerJan Ekström <jeebjp@gmail.com>2024-03-20 19:15:05 +0200
commit0d36844ddf90bcd8ca4ba7625918d384a5d808ba (patch)
tree92549741195038e912b930f78f6c8ece0b266f21 /libavcodec
parentd9ade14c5c559288e3ee587e38c58d5ba6171bf9 (diff)
downloadffmpeg-0d36844ddf90bcd8ca4ba7625918d384a5d808ba.tar.gz
avcodec: add frame side data array to AVCodecContext
This allows configuring an encoder by using AVFrameSideData.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h13
-rw-r--r--libavcodec/options.c2
-rw-r--r--libavcodec/version.h4
3 files changed, 17 insertions, 2 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 554501aa44..83dc487251 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2062,6 +2062,19 @@ typedef struct AVCodecContext {
* Number of entries in side_data_prefer_packet.
*/
unsigned nb_side_data_prefer_packet;
+
+ /**
+ * Array containing static side data, such as HDR10 CLL / MDCV structures.
+ * Side data entries should be allocated by usage of helpers defined in
+ * libavutil/frame.h.
+ *
+ * - encoding: may be set by user before calling avcodec_open2() for
+ * encoder configuration. Afterwards owned and freed by the
+ * encoder.
+ * - decoding: unused
+ */
+ AVFrameSideData **decoded_side_data;
+ int nb_decoded_side_data;
} AVCodecContext;
/**
diff --git a/libavcodec/options.c b/libavcodec/options.c
index dcc67e497a..5169f2e476 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -176,6 +176,8 @@ void avcodec_free_context(AVCodecContext **pavctx)
av_freep(&avctx->inter_matrix);
av_freep(&avctx->rc_override);
av_channel_layout_uninit(&avctx->ch_layout);
+ av_frame_side_data_free(
+ &avctx->decoded_side_data, &avctx->nb_decoded_side_data);
av_freep(pavctx);
}
diff --git a/libavcodec/version.h b/libavcodec/version.h
index b4616ccc27..0550d7b0d8 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,8 +29,8 @@
#include "version_major.h"
-#define LIBAVCODEC_VERSION_MINOR 1
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MINOR 2
+#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \