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

Steve Lhomme robux4 at ycbcr.xyz
Wed Aug 22 11:34:37 CEST 2018


On 22/08/2018 10:01, Zhao Zhili wrote:
>
>
> On 2018年08月22日 15:44, Steve Lhomme wrote:
>> On 22/08/2018 09:26, Zhao Zhili wrote:
>>>
>>>
>>> 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.
>>
>> Not only that but it's probably wrong. It pretends to transform from 
>> one projection to the other when in fact it doesn't.
>
> It doesn't make much sense for VLC as an application, but make
> sense for libvlc. It's a clean way to let libvlc render to
> android-display and the user get the texture via SurfaceTexture.
> The user of libvlc can do render itself and handle projection as
> far as it can get the projection info.

Then in that case the vout shouldn't change the value of the projection, 
it will be handled elsewhere. It may be an option of the vout set by libvlc.

But if it changes the value, when/if there are filters that can actually 
do the conversion it will be done in VLC and then again in the host app. 
That's not going to work well. So the fmt.projection_mode should reflect 
what is actually done (internally or externally) so the core doesn't try 
to do it for you.

>
>>
>>>
>>>> ---
>>>>   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);
>>>>   }
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>
> _______________________________________________
> 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