[Android] LibVLC: add function to get Android cache path using JNI

Felix Abecassis git at videolan.org
Fri Jul 4 17:07:01 CEST 2014


vlc-ports/android | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Fri Jul  4 11:48:26 2014 +0200| [fbbf859d87ce3170398e48453c0730cd1fda82ea] | committer: Felix Abecassis

LibVLC: add function to get Android cache path using JNI

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

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

diff --git a/vlc-android/src/org/videolan/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
index 157829e..a05c007 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
@@ -75,6 +75,9 @@ public class LibVLC {
     private boolean frameSkip = false;
     private int networkCaching = 0;
 
+    /** Path of application-specific cache */
+    private String mCachePath = "";
+
     /** Native crash handler */
     private OnNativeCrashListener mOnNativeCrashListener;
 
@@ -374,6 +377,8 @@ public class LibVLC {
                 Log.e(TAG, LibVlcUtil.getErrorMsg());
                 throw new LibVlcException();
             }
+
+            mCachePath = context.getCacheDir().getAbsolutePath();
             nativeInit();
             mMediaList = mPrimaryList = new MediaList(this);
             setEventHandler(EventHandler.getInstance());
@@ -701,4 +706,8 @@ public class LibVLC {
         if (mOnNativeCrashListener != null)
             mOnNativeCrashListener.onNativeCrash();
     }
+
+    public String getCachePath() {
+        return mCachePath;
+    }
 }



More information about the Android mailing list