[vlc-devel] [PATCH] vout: android: don't overwrite projection_mode for opaque

Zhao Zhili quinkblack at foxmail.com
Wed Aug 22 09:26:05 CEST 2018



On 2018年08月22日 11:52, Zhao Zhili wrote:
> Fix "Failed to adapt decoder format to display" and fallback to software
> decoder.

Overwrite projection_mode can affect software decoder too, although it 
doesn't fail. For example:

  libvlc vout display: A filter to adapt decoder I420 to display I420 is 
needed
  libvlc filter: 2048x1024 (2048x1026) chroma: I420 -> 2048x1024 
(2048x1026) chroma: I420 with scaling using Bicubic (good quality)
  libvlc filter: using video converter module "swscale"

The swscale is almost useless.

> ---
>   modules/video_output/android/display.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
> index 78c2331..7f22c41 100644
> --- a/modules/video_output/android/display.c
> +++ b/modules/video_output/android/display.c
> @@ -505,12 +505,6 @@ static int OpenCommon(vout_display_t *vd)
>       vout_display_sys_t *sys;
>       video_format_t sub_fmt;
>   
> -    /* There are three cases:
> -     * 1. the projection_mode is PROJECTION_MODE_RECTANGULAR
> -     * 2. gles2 vout failed
> -     * 3. the module is forced */
> -    vd->fmt.projection_mode = PROJECTION_MODE_RECTANGULAR;
> -
>       vout_window_t *embed =
>           vout_display_NewWindow(vd, VOUT_WINDOW_TYPE_ANDROID_NATIVE);
>   
> @@ -619,6 +613,12 @@ static int Open(vlc_object_t *p_this)
>       if (vd->fmt.i_chroma == VLC_CODEC_ANDROID_OPAQUE)
>           return VLC_EGENERIC;
>   
> +    /* There are three cases:
> +     * 1. the projection_mode is PROJECTION_MODE_RECTANGULAR
> +     * 2. gles2 vout failed
> +     * 3. the module is forced */
> +    vd->fmt.projection_mode = PROJECTION_MODE_RECTANGULAR;
> +
>       return OpenCommon(vd);
>   }
>   





More information about the vlc-devel mailing list