[vlc-devel] [PATCH] video_output: use vout_GetDevice for filters

Alexandre Janniaux ajanni at videolabs.io
Mon Jun 29 13:09:28 CEST 2020


Hi,

On Mon, Jun 29, 2020 at 12:55:48PM +0200, Steve Lhomme wrote:
> What's the use case ? Software decoding and inserting a GPU filter ?

I'm not exactly sure, but I was in a case where I didn't have
the decoder_device associated with the window module in a
GPU filter pipeline indeed. But it's likely this situation
yes.

> It seems whatever GPU filter using a decoder device will likely want the
> same feature if it's used with a CPU decoder.

I have different OpenGL implementation (thus, output buffer
kind) and load the correct one depending on the decoder device.

It allows using SurfaceTexture or CVPX buffers when displaying
on Android/iOS and potentially the same set of feature when
transcoding with mediacodec/videotoolbox, but still fallback
to CPU mode whenever the decoder device isn't a GPU-accelerated
one.

My understanding of the whole decoder device stuff is mostly
that it should help choose the correct decoders and filters
modules, in order to adapt the tail of the filter chain, or
in another way of saying it the input of the display/encoder.
So I also think it makes sense to have the decoder device in
filters even if the decoder itself don't use it.

But to be honest, I'm a bit lost by the name of decoder_device
since it has been decided to use it for device selection
instead of hinting decoders. I'd have prefer your `video device`
name instead of decoder device without that.

Regards,
--
Alexandre Janniaux
Videolabs

>
> On 2020-06-02 12:45, Alexandre Janniaux wrote:
> > It has the exact same effect, except that it will create the decoder
> > device if it has not been created instead of returning NULL.
> > ---
> >   src/video_output/video_output.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
> > index 480dfe75f37..e927823d4cd 100644
> > --- a/src/video_output/video_output.c
> > +++ b/src/video_output/video_output.c
> > @@ -973,7 +973,7 @@ static vlc_decoder_device * VoutHoldDecoderDevice(vlc_object_t *o, void *sys)
> >   {
> >       VLC_UNUSED(o);
> >       vout_thread_t *vout = sys;
> > -    return vout->p->dec_device ? vlc_decoder_device_Hold( vout->p->dec_device ) : NULL;
> > +    return vout_GetDevice(vout);
> >   }
>
> If so you should rename the function to VoutGetDecoderDevice. But then you'd
> also need to rename filter_video_callbacks.hold_device and the related
> functions (filter_chain_HoldDecoderDevice, filter_HoldDecoderDevice,
> filter_HoldDecoderDeviceType).
>
> It seems whatever GPU filter using a decoder device will likely want the
> same feature if it's used with a CPU decoder.
>
> >   static const struct filter_video_callbacks vout_video_cbs = {
> > --
> > 2.26.2
> >
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> >
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list