[FFmpeg-devel] [PATCH v2 1/1] avcodec/vpp_qsv: Copy side data from input to output frame

Soft Works softworkz at hotmail.com
Fri Dec 3 09:55:19 EET 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Anton
> Khirnov
> Sent: Wednesday, December 1, 2021 11:55 AM
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v2 1/1] avcodec/vpp_qsv: Copy side data
> from input to output frame
> 
> Quoting Soft Works (2021-11-30 15:22:38)
> > Signed-off-by: softworkz <softworkz at hotmail.com>
> > ---
> > V2: Add public method av_frame_copy_side_data() instead to copying the
> implementation.
> >
> >  libavfilter/qsvvpp.c         |  5 ++++
> >  libavfilter/vf_overlay_qsv.c | 19 +++++++++---
> >  libavutil/frame.c            | 57 ++++++++++++++++++++----------------
> >  libavutil/frame.h            | 12 ++++++++
> >  4 files changed, 64 insertions(+), 29 deletions(-)
> 
> This should be split: new API in one commit, using it in the second.
> New API also needs a minor version bump and a doc/APIchanges entry.
> 
> > diff --git a/libavutil/frame.c b/libavutil/frame.c
> > index 1f1f573407..7a19245ea4 100644
> > --- a/libavutil/frame.c
> > +++ b/libavutil/frame.c
> > @@ -296,6 +296,36 @@ int av_frame_get_buffer2(AVFrame *frame, int align)
> >      }
> >  }
> >
> > +int av_frame_copy_side_data(AVFrame* dst, const AVFrame* src, int
> force_copy)
> > +{
> > +    for (unsigned i = 0; i < src->nb_side_data; i++) {
> > +        const AVFrameSideData *sd_src = src->side_data[i];
> > +        AVFrameSideData *sd_dst;
> > +        if (   sd_src->type == AV_FRAME_DATA_PANSCAN
> > +            && (src->width != dst->width || src->height != dst->height))
> > +            continue;
> 
> Yuck. I know it's already there, but it really really shouldn't be. This
> function does not have enough information to make such decisions.

Agreed. But I don't have enough information to do anything about it.

This code exists since October 2014. It has become part of ffmpeg 
behavior and I'm not familiar enough with the subject of this specific 
side data to make any suggestion. Even when - such change would be
unrelated and wouldn't belong into this patchset anyway.

I made all other changes, though.

Thanks for reviewing,
softworkz



More information about the ffmpeg-devel mailing list