1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec: add frame side data array to AVCodecContext

This allows configuring an encoder by using AVFrameSideData.
This commit is contained in:
Jan Ekström 2022-11-03 22:04:50 +02:00
parent d9ade14c5c
commit 0d36844ddf
4 changed files with 20 additions and 2 deletions

View File

@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
API changes, most recent first: API changes, most recent first:
2024-03-xx - xxxxxxxxxx - lavc 61.2.100 - avcodec.h
Add AVCodecContext.[nb_]decoded_side_data.
2024-03-xx - xxxxxxxxxx - lavu 59.3.100 - frame.h 2024-03-xx - xxxxxxxxxx - lavu 59.3.100 - frame.h
Add av_frame_side_data_free(), av_frame_side_data_new(), Add av_frame_side_data_free(), av_frame_side_data_new(),
av_frame_side_data_clone(), av_frame_side_data_get() as well av_frame_side_data_clone(), av_frame_side_data_get() as well

View File

@ -2062,6 +2062,19 @@ typedef struct AVCodecContext {
* Number of entries in side_data_prefer_packet. * Number of entries in side_data_prefer_packet.
*/ */
unsigned nb_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; } AVCodecContext;
/** /**

View File

@ -176,6 +176,8 @@ void avcodec_free_context(AVCodecContext **pavctx)
av_freep(&avctx->inter_matrix); av_freep(&avctx->inter_matrix);
av_freep(&avctx->rc_override); av_freep(&avctx->rc_override);
av_channel_layout_uninit(&avctx->ch_layout); av_channel_layout_uninit(&avctx->ch_layout);
av_frame_side_data_free(
&avctx->decoded_side_data, &avctx->nb_decoded_side_data);
av_freep(pavctx); av_freep(pavctx);
} }

View File

@ -29,8 +29,8 @@
#include "version_major.h" #include "version_major.h"
#define LIBAVCODEC_VERSION_MINOR 1 #define LIBAVCODEC_VERSION_MINOR 2
#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \ LIBAVCODEC_VERSION_MINOR, \