[vlc-devel] [PATCH 2/2] android: use common function LoadNativeWindowAPI instead of duplicating code in vout modules.

Martin Storsjö martin at martin.st
Wed Jan 15 11:19:53 CET 2014

On Wed, 15 Jan 2014, Felix Abecassis wrote:

> 2014/1/15 Martin Storsjö <martin at martin.st>:
>> On Tue, 14 Jan 2014, Felix Abecassis wrote:
>>> ---
>>> modules/video_output/Modules.am             |  4 +--
>>> modules/video_output/android/nativewindow.c | 41 +++------------------
>>> modules/video_output/android/surface.c      | 55
>>> ++++++-----------------------
>>> 3 files changed, 18 insertions(+), 82 deletions(-)
>> These patches look ok to me.
>> However, I'm not sure how much point these is in loading these functions
>> dynamically any longer. Since we already link to EGL (which only is
>> available since 2.3 - native GL functions are available since much earlier
>> but EGL was exposed only at that point) the binary can't be loaded on
>> pre-2.3 devices. Therefore there's no point in doing all this extra work for
>> the ANativeWindow functions either, which could be linked directly and the
>> old hacky stuff could be removed from surface.c (and the OpenSL ES output
>> could be simplified as well).
> But we only link for EGL for the OpenGL vout I think, in this case we
> should simply disable this vout for 2.2 devices (if it's not the case
> already) and the rest of the code should run fine.

It's not about just disabling the vout at runtime - libvlcjni.so requires 
libEGL.so in order to be loaded at all, so even if we don't use the vouts 
that use EGL, we won't be able to load the JNI lib at all on pre-2.3 
devices. We would have to do a separate APK build for pre-2.3 devices with 
these modules disabled.

Then again, since the APK only supports armv7, and there IMO are not very 
many armv7 devices that haven't gotten updated to 2.3, so there might not 
be much use for it. Separate builds for armv6 might be built with these 
modules disabled...

// Martin

More information about the vlc-devel mailing list