[FFmpeg-devel] [PATCH] avcodec/dovi_rpu: make ff_dovi_configure_ext() take an AVCodecContext as input argument

James Almer jamrial at gmail.com
Thu Nov 28 14:58:46 EET 2024


On 11/28/2024 9:57 AM, Anton Khirnov wrote:
> Quoting James Almer (2024-11-27 14:31:35)
>> @@ -222,10 +223,25 @@ static int dovi_rpu_init(AVBSFContext *bsf)
>>   
>>               s->enc.cfg = *cfg;
>>           } else {
>> +            AVCodecContext *avctx;
>>               av_log(bsf, AV_LOG_WARNING, "No Dolby Vision configuration record "
>>                      "found? Generating one, but results may be invalid.\n");
>> -            ret = ff_dovi_configure_ext(&s->enc, bsf->par_out, NULL, s->compression,
>> +            avctx = avcodec_alloc_context3(NULL);
>> +            if (!avctx)
>> +                return AVERROR(ENOMEM);
>> +            ret = avcodec_parameters_to_context(avctx, bsf->par_in);
>> +            if (ret < 0) {
>> +                avcodec_free_context(&avctx);
>> +                return ret;
>> +            }
>> +            ret = ff_dovi_configure_ext(&s->enc, avctx, NULL, s->compression,
>>                                           FF_COMPLIANCE_NORMAL);
>> +            if (ret < 0) {
>> +                avcodec_free_context(&avctx);
>> +                return ret;
>> +            }
>> +            ret = avcodec_parameters_from_context(bsf->par_out, avctx);
> 
> This still seems a bit too scorched-earth to me. I'd prefer to give
> ff_dovi_configure_ext() a side data list as a parameter and have it
> modify that.

It still checks a bunch of fields in codecpar/avctx (read only), not 
just side data, so it needs one of those.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241128/4635c1c4/attachment.sig>


More information about the ffmpeg-devel mailing list