[Android] libvlc: move LibVlcUtil to util/VLCUtil

Thomas Guillem git at videolan.org
Thu May 28 15:34:09 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu May 28 14:58:15 2015 +0200| [b3fc5a9e146ef5f03a5ec3957ecfdfe729021dcb] | committer: Thomas Guillem

libvlc: move LibVlcUtil to util/VLCUtil

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

 libvlc/src/org/videolan/libvlc/LibVLC.java                |    5 +++--
 .../libvlc/{LibVlcUtil.java => util/VLCUtil.java}         |    4 ++--
 vlc-android/src/org/videolan/vlc/MediaWrapper.java        |    2 --
 .../src/org/videolan/vlc/gui/CompatErrorActivity.java     |    4 ++--
 vlc-android/src/org/videolan/vlc/util/VLCInstance.java    |   13 ++++---------
 vlc-android/src/org/videolan/vlc/util/VLCOptions.java     |    4 ++--
 6 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index bb133e0..02a052f 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -29,6 +29,7 @@ import android.util.Log;
 import android.view.Surface;
 
 import org.videolan.libvlc.util.AndroidUtil;
+import org.videolan.libvlc.util.VLCUtil;
 
 public class LibVLC {
     private static final String TAG = "VLC/LibVLC";
@@ -141,8 +142,8 @@ public class LibVLC {
     public void init(Context context, String options[]) throws LibVlcException {
         Log.v(TAG, "Initializing LibVLC");
         if (!mIsInitialized) {
-            if(!LibVlcUtil.hasCompatibleCPU(context)) {
-                Log.e(TAG, LibVlcUtil.getErrorMsg());
+            if(!VLCUtil.hasCompatibleCPU(context)) {
+                Log.e(TAG, VLCUtil.getErrorMsg());
                 throw new LibVlcException();
             }
 
diff --git a/libvlc/src/org/videolan/libvlc/LibVlcUtil.java b/libvlc/src/org/videolan/libvlc/util/VLCUtil.java
similarity index 99%
rename from libvlc/src/org/videolan/libvlc/LibVlcUtil.java
rename to libvlc/src/org/videolan/libvlc/util/VLCUtil.java
index a3ccaba..a4b6b2e 100644
--- a/libvlc/src/org/videolan/libvlc/LibVlcUtil.java
+++ b/libvlc/src/org/videolan/libvlc/util/VLCUtil.java
@@ -18,7 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-package org.videolan.libvlc;
+package org.videolan.libvlc.util;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -38,7 +38,7 @@ import android.util.Log;
 
 import org.videolan.libvlc.util.AndroidUtil;
 
-public class LibVlcUtil {
+public class VLCUtil {
     public final static String TAG = "VLC/LibVLC/Util";
 
     private static String errorMsg = null;
diff --git a/vlc-android/src/org/videolan/vlc/MediaWrapper.java b/vlc-android/src/org/videolan/vlc/MediaWrapper.java
index 32b4990..0a3e2f0 100644
--- a/vlc-android/src/org/videolan/vlc/MediaWrapper.java
+++ b/vlc-android/src/org/videolan/vlc/MediaWrapper.java
@@ -24,8 +24,6 @@ import java.util.Locale;
 
 import org.videolan.libvlc.MediaPlayer;
 import org.videolan.libvlc.util.Extensions;
-import org.videolan.libvlc.LibVLC;
-import org.videolan.libvlc.LibVlcUtil;
 import org.videolan.libvlc.Media;
 import org.videolan.libvlc.Media.VideoTrack;
 import org.videolan.libvlc.Media.Meta;
diff --git a/vlc-android/src/org/videolan/vlc/gui/CompatErrorActivity.java b/vlc-android/src/org/videolan/vlc/gui/CompatErrorActivity.java
index 9724686..6c94360 100644
--- a/vlc-android/src/org/videolan/vlc/gui/CompatErrorActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/CompatErrorActivity.java
@@ -13,7 +13,7 @@ import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.message.BasicNameValuePair;
-import org.videolan.libvlc.LibVlcUtil;
+import org.videolan.libvlc.util.VLCUtil;
 import org.videolan.vlc.R;
 
 import java.io.IOException;
@@ -36,7 +36,7 @@ public class CompatErrorActivity extends Activity {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.not_compatible);
 
-        String errorMsg = LibVlcUtil.getErrorMsg();
+        String errorMsg = VLCUtil.getErrorMsg();
         if(getIntent().getBooleanExtra("runtimeError", false))
             if(getIntent().getStringExtra("message") != null) {
                 errorMsg = getIntent().getStringExtra("message");
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCInstance.java b/vlc-android/src/org/videolan/vlc/util/VLCInstance.java
index d74080f..c401cb9 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCInstance.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCInstance.java
@@ -24,21 +24,16 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.preference.PreferenceManager;
-import android.util.Log;
 
 import org.videolan.libvlc.LibVLC;
 import org.videolan.libvlc.LibVlcException;
-import org.videolan.libvlc.LibVlcUtil;
+import org.videolan.libvlc.util.VLCUtil;
 import org.videolan.libvlc.MediaPlayer;
-import org.videolan.libvlc.util.HWDecoderUtil;
-import org.videolan.vlc.R;
 import org.videolan.vlc.VLCApplication;
 import org.videolan.vlc.VLCCrashHandler;
 import org.videolan.vlc.gui.CompatErrorActivity;
 import org.videolan.vlc.gui.NativeCrashActivity;
 
-import java.util.ArrayList;
-
 public class VLCInstance {
     public final static String TAG = "VLC/Util/VLCInstance";
 
@@ -56,7 +51,7 @@ public class VLCInstance {
             try {
                 sLibVLC.init(context, VLCOptions.getLibOptions(pref));
             } catch (LibVlcException e) {
-                throw new IllegalStateException("LibVLC initialisation failed: " + LibVlcUtil.getErrorMsg());
+                throw new IllegalStateException("LibVLC initialisation failed: " + VLCUtil.getErrorMsg());
             }
             LibVLC.setOnNativeCrashListener(new LibVLC.OnNativeCrashListener() {
                 @Override
@@ -87,13 +82,13 @@ public class VLCInstance {
                 sLibVLC.destroy();
                 sLibVLC.init(context, VLCOptions.getLibOptions(pref));
             } catch (LibVlcException lve) {
-                throw new IllegalStateException("LibVLC initialisation failed: " + LibVlcUtil.getErrorMsg());
+                throw new IllegalStateException("LibVLC initialisation failed: " + VLCUtil.getErrorMsg());
             }
         }
     }
 
     public static synchronized boolean testCompatibleCPU(Context context) {
-        if (sLibVLC == null && !LibVlcUtil.hasCompatibleCPU(context)) {
+        if (sLibVLC == null && !VLCUtil.hasCompatibleCPU(context)) {
             final Intent i = new Intent(context, CompatErrorActivity.class);
             context.startActivity(i);
             return false;
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
index c4476e7..1f89554 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
@@ -26,7 +26,7 @@ import android.preference.PreferenceManager;
 import android.util.Log;
 
 import org.videolan.libvlc.LibVLC;
-import org.videolan.libvlc.LibVlcUtil;
+import org.videolan.libvlc.util.VLCUtil;
 import org.videolan.libvlc.util.AndroidUtil;
 import org.videolan.libvlc.util.HWDecoderUtil;
 import org.videolan.vlc.R;
@@ -155,7 +155,7 @@ public class VLCOptions {
              * Skip non-ref (1) for all armv7 more than 1.2 Ghz and more than 2 cores
              * Skip non-key (3) for all devices that don't meet anything above
              */
-            LibVlcUtil.MachineSpecs m = LibVlcUtil.getMachineSpecs();
+            VLCUtil.MachineSpecs m = VLCUtil.getMachineSpecs();
             if (m == null)
                 return ret;
             if ((m.hasArmV6 && !(m.hasArmV7)) || m.hasMips)



More information about the Android mailing list