[FFmpeg-devel] [PATCH, v2] lavc/qsvdec: Add GPU-accelerated memory copy support

Li, Zhong zhong.li at intel.com
Sun Sep 29 10:57:18 EEST 2019


> > > +static int ff_qsv_get_continuous_buffer(AVCodecContext *avctx,
> > AVFrame
> > > +*frame, AVBufferPool *pool) {
> > > +    int ret = 0;
> > > +
> > > +    ff_decode_frame_props(avctx, frame);
> > > +
> > > +    frame->width       = avctx->width;
> > > +    frame->height      = avctx->height;
> > > +    frame->linesize[0] = FFALIGN(avctx->width, 128);
> > > +    frame->linesize[1] = frame->linesize[0];
> > > +    frame->buf[0]      = av_buffer_pool_get(pool);
> > > +    if (!frame->buf[0])
> > > +        return AVERROR(ENOMEM);
> > > +
> > > +    frame->data[0] = frame->buf[0]->data;
> > > +    frame->data[1] = frame->data[0] +
> > > +                            frame->linesize[0] *
> > > + FFALIGN(avctx->height, 64);
> > > +
> > > +    ret = ff_attach_decode_data(frame);
> >
> > Could you please explain why need this function? I don't see
> > private_ref is needed from qsv decoding.
> 
> private_ref is required if a decoder declares the capability of
> AV_CODEC_CAP_DR1.
> https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/decode.c#L654
> 
> - Linjie

Ok, to keep consistency it is ok though get_buffer() is not called in the path of ff_qsv_get_continuous_buffer ().


More information about the ffmpeg-devel mailing list