[Android] LibVLC: use symbolic constants

Edward Wang git at videolan.org
Sat Feb 22 21:47:37 CET 2014


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sat Feb 22 15:47:33 2014 -0500| [34a9bcde573ec03615e43ebb8cc6e1f1d311a892] | committer: Edward Wang

LibVLC: use symbolic constants

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=34a9bcde573ec03615e43ebb8cc6e1f1d311a892
---

 vlc-android/src/org/videolan/libvlc/LibVLC.java |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
index 8838d04..e5635e7 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
@@ -37,6 +37,11 @@ public class LibVLC {
     public static final int VOUT_ANDROID_SURFACE = 0;
     public static final int VOUT_OPEGLES2 = 1;
 
+    public static final int HW_ACCELERATION_AUTOMATIC = -1;
+    public static final int HW_ACCELERATION_DISABLED = 0;
+    public static final int HW_ACCELERATION_DECODING = 1;
+    public static final int HW_ACCELERATION_FULL = 2;
+
     private static LibVLC sInstance;
 
     /** libVLC instance C pointer */
@@ -58,7 +63,7 @@ public class LibVLC {
     //private WakeLock mWakeLock;
 
     /** Settings */
-    private int hardwareAcceleration = -1;
+    private int hardwareAcceleration = HW_ACCELERATION_AUTOMATIC;
     private String subtitlesEncoding = "";
     private int aout = LibVlcUtil.isGingerbreadOrLater() ? AOUT_OPENSLES : AOUT_AUDIOTRACK_JAVA;
     private int vout = VOUT_ANDROID_SURFACE;
@@ -227,9 +232,9 @@ public class LibVLC {
         if (hardwareAcceleration < 0) {
             // Automatic mode: activate MediaCodec opaque direct rendering for 4.3 and above.
             if (LibVlcUtil.isJellyBeanMR2OrLater())
-                this.hardwareAcceleration = 2;
+                this.hardwareAcceleration = HW_ACCELERATION_FULL;
             else
-                this.hardwareAcceleration = 0;
+                this.hardwareAcceleration = HW_ACCELERATION_DISABLED;
         }
         else
             this.hardwareAcceleration = hardwareAcceleration;



More information about the Android mailing list