[FFmpeg-devel] [PATCH 08/12] avcodec/decode: check for global side data in AVCodecContext side data

James Almer jamrial at gmail.com
Wed Aug 30 00:13:58 EEST 2023


On 8/29/2023 3:24 AM, Pavel Koshevoy wrote:
> On Mon, Aug 28, 2023, 06:38 James Almer <jamrial at gmail.com> wrote:
> 
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>   libavcodec/decode.c | 56 +++++++++++++++++++++++++++++++++++++--------
>>   libavcodec/decode.h |  2 +-
>>   2 files changed, 47 insertions(+), 11 deletions(-)
>>
>> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
>> index 7eada8e9ab..4b8c1bc74d 100644
>> --- a/libavcodec/decode.c
>> +++ b/libavcodec/decode.c
>> @@ -1408,25 +1408,30 @@ static int add_metadata_from_side_data(const
>> AVPacket *avpkt, AVFrame *frame)
>>       return av_packet_unpack_dictionary(side_metadata, size, frame_md);
>>   }
>>
>> -int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx,
>> +static const struct {
>> +    enum AVPacketSideDataType packet;
>> +    enum AVFrameSideDataType frame;
>> +} sd_global_map[] = {
>> +    { AV_PKT_DATA_REPLAYGAIN ,                AV_FRAME_DATA_REPLAYGAIN },
>> +    { AV_PKT_DATA_SPHERICAL,                  AV_FRAME_DATA_SPHERICAL },
>> +    { AV_PKT_DATA_STEREO3D,                   AV_FRAME_DATA_STEREO3D },
>> +    { AV_PKT_DATA_AUDIO_SERVICE_TYPE,
>>   AV_FRAME_DATA_AUDIO_SERVICE_TYPE },
>> +    { AV_PKT_DATA_MASTERING_DISPLAY_METADATA,
>> AV_FRAME_DATA_MASTERING_DISPLAY_METADATA },
>> +    { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
>> AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
>> +    { AV_PKT_DATA_ICC_PROFILE,                AV_FRAME_DATA_ICC_PROFILE },
>> +    { AV_PKT_DATA_DYNAMIC_HDR10_PLUS,
>>   AV_FRAME_DATA_DYNAMIC_HDR_PLUS },
>> +};
>> +
>> +int ff_decode_frame_props_from_pkt(AVCodecContext *avctx,
>>                                      AVFrame *frame, const AVPacket *pkt)
>>   {
>>       static const struct {
>>           enum AVPacketSideDataType packet;
>>           enum AVFrameSideDataType frame;
>>       } sd[] = {
>> -        { AV_PKT_DATA_REPLAYGAIN ,
>> AV_FRAME_DATA_REPLAYGAIN },
>> -        { AV_PKT_DATA_DISPLAYMATRIX,
>> AV_FRAME_DATA_DISPLAYMATRIX },
>>
> 
> AV_PKT_DATA_DISPLAYMATRIX is just removed, not moved?
> Just curious why this one is not like the others.

Unintended, and fixed locally. Thanks for noticing.


More information about the ffmpeg-devel mailing list