[vlc-devel] [PATCH] decoder: remove the size requirement to create a vout

Alexandre Janniaux ajanni at videolabs.io
Mon Jan 13 13:23:44 CET 2020


Hi,

I'm pretty sure vout_window modules should refuse to resize
to a zero size, and underlying window backend would refuse.
I know that Opengl, wayland viewporter and metal are
already crashing if you request that.

I agree that we shouldn't specify the video size at decoder
instantiation but should push the new format whenever
available though.

On Mon, Jan 13, 2020 at 11:39:13AM +0100, Steve Lhomme wrote:
> Never mind. It doesn't work in some cases. The window is not enabled
> (created) because of the VoutCheckFormat() that forbids it.
>
> I'm not sure it would be wise to create a window with a 0x0 size. There
> should be a video format coming when the actual format is known. But
> depending on the user preferences we may not resize the (external) window
> once the size is known ?
>
> Another to get around the issue in the codec would be try to create a
> decoder device without a window (NULL) if none is created, rather than
> returning no decoder device at all. Again, for VAAPI/VDPAU that will not
> happen because we set the proper sizes early. The other decoder devices
> don't use the window anyway.
>
> On 2020-01-13 10:34, Steve Lhomme wrote:
> > In some cases (nvdec, mmal, mediacodec ?) the actual size of the video to
> > decode is known only after data have been processed, long after the device
> > is setup to use with this API. There are hacks to try to guess the size early
> > but in the end it's just a hack.
> >
> > It's not necessary to know the size of the video when creating the vout. It's
> > only needed by VDPAU and maybe VAAPI because they need a real window. These
> > already provide the proper size when requesting the decoder device, they are
> > requested when lavc has already processed some data.
> > ---
> >   src/input/decoder.c | 9 ---------
> >   1 file changed, 9 deletions(-)
> >
> > diff --git a/src/input/decoder.c b/src/input/decoder.c
> > index 17a36df3c9b..480fa6bd17c 100644
> > --- a/src/input/decoder.c
> > +++ b/src/input/decoder.c
> > @@ -550,15 +550,6 @@ static int CreateVoutIfNeeded(struct decoder_owner *p_owner,
> >           return 0; // vout unchanged
> >       }
> > -    if( !p_dec->fmt_out.video.i_width ||
> > -        !p_dec->fmt_out.video.i_height ||
> > -        p_dec->fmt_out.video.i_width < p_dec->fmt_out.video.i_visible_width ||
> > -        p_dec->fmt_out.video.i_height < p_dec->fmt_out.video.i_visible_height )
> > -    {
> > -        /* Can't create a new vout without display size */
> > -        return -1;
> > -    }
> > -
> >       vlc_mutex_lock( &p_owner->lock );
> >       vout_thread_t *p_vout = p_owner->p_vout;
> > --
> > 2.17.1
> >
> > _______________________________________________
> > 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