[vlc-devel] [PATCH] decoder: remove the size requirement to create a vout
Steve Lhomme
robux4 at ycbcr.xyz
Mon Jan 13 11:39:13 CET 2020
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
>
More information about the vlc-devel
mailing list