[FFmpeg-devel] [PATCH 07/12] avcodec/hevcdec: check for DOVI configuration record in AVCodecContext side data

Vittorio Giovara vittorio.giovara at gmail.com
Mon Aug 28 16:00:47 EEST 2023


On Mon, Aug 28, 2023 at 2:38 PM James Almer <jamrial at gmail.com> wrote:

> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavcodec/hevcdec.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index df40c91ba6..dabfe89d4a 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -3337,8 +3337,15 @@ static int hevc_decode_frame(AVCodecContext *avctx,
> AVFrame *rframe,
>      }
>
>      sd = av_packet_get_side_data(avpkt, AV_PKT_DATA_DOVI_CONF, &sd_size);
> -    if (sd && sd_size > 0)
> +    if (sd && sd_size > 0) {
> +        int old = s->dovi_ctx.dv_profile;
> +
>          ff_dovi_update_cfg(&s->dovi_ctx,
> (AVDOVIDecoderConfigurationRecord *) sd);
> +        if (old)
> +            av_log(avctx, AV_LOG_DEBUG,
> +                   "New DOVI configuration record from input packet
> (profile %d -> %u).\n",
> +                   old, s->dovi_ctx.dv_profile);
> +    }
>

In general isn't the bitstream side data more important than the container
level one?
Unless specified with a flag, I'd expect that the bistream information is
preserved over the other ones since it's harder to misconfure, and (iirc)
it's what we do in many other places (for example on color properties
config).
-- 
Vittorio


More information about the ffmpeg-devel mailing list