[Android] LibVLC: no gles2 for Android 2.3

Thomas Guillem git at videolan.org
Thu Feb 23 10:06:17 CET 2017


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Feb 23 10:01:06 2017 +0100| [a83f832f5e98ec9ec8f1369a521ab7eaf36f95f6] | committer: Thomas Guillem

LibVLC: no gles2 for Android 2.3

Video layout doesn't change when screen is rotated on Android 2.3 when
usingOpenGLES 2. We could debug it but we don't want to loose time on Android
2.3 that will be dropped after the next release.

> https://code.videolan.org/videolan/vlc-android/commit/a83f832f5e98ec9ec8f1369a521ab7eaf36f95f6
---

 libvlc/src/org/videolan/libvlc/LibVLC.java | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 6d158b1..2acd244 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -24,6 +24,7 @@ import android.content.Context;
 import android.os.Build;
 import android.util.Log;
 
+import org.videolan.libvlc.util.AndroidUtil;
 import org.videolan.libvlc.util.HWDecoderUtil;
 
 import java.util.ArrayList;
@@ -74,6 +75,19 @@ public class LibVLC extends VLCObject<LibVLC.Event> {
             }
         }
 
+        /* XXX: HACK to remove when we drop 2.3 support: force android_display vout */
+        if (!AndroidUtil.isHoneycombOrLater()) {
+            boolean setVout = true;
+            for (String option : options) {
+                if (option.startsWith("--vout")) {
+                    setVout = false;
+                    break;
+                }
+            }
+            if (setVout)
+                options.add("--vout=android_display,none");
+        }
+
         nativeNew(options.toArray(new String[options.size()]), context.getDir("vlc", Context.MODE_PRIVATE).getAbsolutePath());
     }
 



More information about the Android mailing list