[Android] libvlc: move HAS_WINDOW_VOUT to HWDecoderUtil

Thomas Guillem git at videolan.org
Fri May 29 12:04:07 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri May 29 11:57:16 2015 +0200| [314dcaa6c95f95fd5a3eccef4abce0fb8c4e6318] | committer: Thomas Guillem

libvlc: move HAS_WINDOW_VOUT to HWDecoderUtil

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

 libvlc/src/org/videolan/libvlc/LibVLC.java                     |    8 +-------
 libvlc/src/org/videolan/libvlc/util/HWDecoderUtil.java         |    2 ++
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java    |    7 ++++---
 vlc-android/src/org/videolan/vlc/util/VLCOptions.java          |    3 +--
 4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 941d2fb..f3aa450 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -20,23 +20,17 @@
 
 package org.videolan.libvlc;
 
-import java.io.File;
 import java.util.ArrayList;
 
-import android.content.Context;
-import android.net.Uri;
 import android.os.Build;
 import android.util.Log;
 import android.view.Surface;
 
-import org.videolan.libvlc.util.AndroidUtil;
-import org.videolan.libvlc.util.VLCUtil;
+import org.videolan.libvlc.util.HWDecoderUtil;
 
 public class LibVLC extends VLCObject {
     private static final String TAG = "VLC/LibVLC";
 
-    public static final boolean HAS_WINDOW_VOUT = AndroidUtil.isGingerbreadOrLater();
-
     /** Native crash handler */
     private static OnNativeCrashListener sOnNativeCrashListener;
 
diff --git a/libvlc/src/org/videolan/libvlc/util/HWDecoderUtil.java b/libvlc/src/org/videolan/libvlc/util/HWDecoderUtil.java
index 9c67913..1fe0655 100644
--- a/libvlc/src/org/videolan/libvlc/util/HWDecoderUtil.java
+++ b/libvlc/src/org/videolan/libvlc/util/HWDecoderUtil.java
@@ -28,6 +28,8 @@ import java.util.HashMap;
  */
 public class HWDecoderUtil {
 
+    public static final boolean HAS_WINDOW_VOUT = AndroidUtil.isGingerbreadOrLater();
+
     public enum Decoder {
         UNKNOWN, NONE, OMX, MEDIACODEC, ALL
     }
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index cb0c566..33daa67 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -101,6 +101,7 @@ import org.videolan.libvlc.LibVLC;
 import org.videolan.libvlc.Media;
 import org.videolan.libvlc.MediaPlayer;
 import org.videolan.libvlc.util.AndroidUtil;
+import org.videolan.libvlc.util.HWDecoderUtil;
 import org.videolan.vlc.BuildConfig;
 import org.videolan.vlc.MediaDatabase;
 import org.videolan.vlc.MediaWrapper;
@@ -455,7 +456,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
         mSubtitlesSurfaceView.setZOrderMediaOverlay(true);
         mSubtitlesSurfaceHolder.setFormat(PixelFormat.TRANSLUCENT);
 
-        if (!LibVLC.HAS_WINDOW_VOUT) {
+        if (!HWDecoderUtil.HAS_WINDOW_VOUT) {
             mSubtitlesSurfaceView.setVisibility(View.GONE);
             mSubtitleSurfaceReady = true;
         }
@@ -1708,7 +1709,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
             sw = mPresentation.getWindow().getDecorView().getWidth();
             sh = mPresentation.getWindow().getDecorView().getHeight();
         }
-        if (LibVLC() != null && LibVLC.HAS_WINDOW_VOUT)
+        if (LibVLC() != null && HWDecoderUtil.HAS_WINDOW_VOUT)
             LibVLC().setWindowSize(sw, sh);
 
         double dw = sw, dh = sh;
@@ -3116,7 +3117,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
             mSubtitlesSurfaceHolder.setFormat(PixelFormat.TRANSLUCENT);
             mSubtitlesSurfaceHolder.addCallback(activity.mSubtitlesSurfaceCallback);
 
-            if (!LibVLC.HAS_WINDOW_VOUT)
+            if (!HWDecoderUtil.HAS_WINDOW_VOUT)
                 mSubtitlesSurfaceView.setVisibility(View.GONE);
             Log.i(TAG, "Secondary display created");
         }
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
index ea343e6..7dcb94e 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
@@ -25,7 +25,6 @@ import android.content.SharedPreferences;
 import android.preference.PreferenceManager;
 import android.util.Log;
 
-import org.videolan.libvlc.LibVLC;
 import org.videolan.libvlc.util.VLCUtil;
 import org.videolan.libvlc.util.AndroidUtil;
 import org.videolan.libvlc.util.HWDecoderUtil;
@@ -139,7 +138,7 @@ public class VLCOptions {
         if (vout < 0 || vout > VOUT_ANDROID_WINDOW)
             vout = VOUT_ANDROID_SURFACE;
 
-        if (vout == VOUT_ANDROID_SURFACE && LibVLC.HAS_WINDOW_VOUT)
+        if (vout == VOUT_ANDROID_SURFACE && HWDecoderUtil.HAS_WINDOW_VOUT)
             return VOUT_ANDROID_WINDOW;
         else
             return vout;



More information about the Android mailing list