[FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device in both directions

Soft Works softworkz at hotmail.com
Fri Nov 26 20:15:59 EET 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Anton
> Khirnov
> Sent: Friday, November 26, 2021 5:15 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When deriving a
> hwdevice, search for existing device in both directions
> 
> Quoting Soft Works (2021-11-25 18:02:54)
> >
> >
> > > -----Original Message-----
> > > From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Anton
> > > Khirnov
> > > Sent: Thursday, November 25, 2021 5:40 PM
> > > To: ffmpeg-devel at ffmpeg.org
> > > Subject: Re: [FFmpeg-devel] [PATCH v4 1/1] avutils/hwcontext: When
> deriving a
> > > hwdevice, search for existing device in both directions
> > >
> > > Quoting Soft Works (2021-11-25 03:41:32)
> > > > @@ -687,6 +720,11 @@ int
> av_hwdevice_ctx_create_derived_opts(AVBufferRef
> > > **dst_ref_ptr,
> > > >                      ret = AVERROR(ENOMEM);
> > > >                      goto fail;
> > > >                  }
> > > > +                tmp_ctx->internal->derived_devices[type] =
> > > av_buffer_ref(dst_ref);
> > > > +                if (!tmp_ctx->internal->derived_devices[type]) {
> > > > +                    ret = AVERROR(ENOMEM);
> > > > +                    goto fail;
> > > > +                }
> > >
> > > This means that once you derive a device of a certain type, you can
> > > never truly close it without also killing the parent device. That
> > > strikes me as
> > > - potentially troublesome
> > > - a behavior change
> > >
> > > Also, I don't see it as completely obvious that all derivations should
> > > always return the same child instance.
> >
> >
> > It creates the behavior that everybody wants and expects who is working
> > with HW devices derivation.
> 
> What qualifies you to speak for "everybody"? I would expect to hear some
> practical arguments for such a strong claim.

I meant "everybody who has been dealing with multi-level hw context 
derivation and talked about it here".

All of them had given specific examples of problems they were running into
or considering problematic:

- Haihao Xiang
- Wenbin Chen
- Guangxin Xu
- Lynne
- Mark Thompson
  (https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg117373.html)

Do you have any example that would be negatively affected by this patch?

Thanks,
softworkz




More information about the ffmpeg-devel mailing list