[Android] jni: remove glue code for libvlc_media_list_t

Edward Wang git at videolan.org
Mon Oct 28 04:14:42 CET 2013


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sun Oct 27 22:29:10 2013 -0400| [cd25e3a38eab0ff7b4a71e45bb6b5dd09162154e] | committer: Edward Wang

jni: remove glue code for libvlc_media_list_t

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

 vlc-android/jni/libvlcjni-util.c                |    5 -----
 vlc-android/jni/libvlcjni.c                     |   27 -----------------------
 vlc-android/jni/utils.h                         |    2 --
 vlc-android/src/org/videolan/libvlc/LibVLC.java |    5 -----
 4 files changed, 39 deletions(-)

diff --git a/vlc-android/jni/libvlcjni-util.c b/vlc-android/jni/libvlcjni-util.c
index 37a8ed4..37f4d2d 100644
--- a/vlc-android/jni/libvlcjni-util.c
+++ b/vlc-android/jni/libvlcjni-util.c
@@ -129,11 +129,6 @@ void arrayListStringAdd(JNIEnv *env, jclass class, jmethodID methodID, jobject a
     (*env)->DeleteLocalRef(env, jstr);
 }
 
-// Returns the libvlc_media_list_t of a MediaList object
-libvlc_media_list_t* getMediaListFromJava(JNIEnv *env, jobject obj) {
-    return (libvlc_media_list_t*)(intptr_t)getLong(env, obj, "mMediaListInstance");
-}
-
 jobject getEventHandlerReference(JNIEnv *env, jobject thiz, jobject eventHandler)
 {
     jclass cls = (*env)->GetObjectClass(env, eventHandler);
diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index 40e4ca1..7b244e6 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -74,15 +74,6 @@ libvlc_media_t *new_media(jlong instance, JNIEnv *env, jobject thiz, jstring fil
     return p_md;
 }
 
-// Get the current media list being followed
-libvlc_media_list_t* getMediaList(JNIEnv *env, jobject thiz) {
-    jclass clazz = (*env)->GetObjectClass(env, thiz);
-    jfieldID fieldMP = (*env)->GetFieldID(env, clazz,
-                                          "mMediaList", "Lorg/videolan/libvlc/MediaList;");
-    jobject javaML = (*env)->GetObjectField(env, thiz, fieldMP);
-    return getMediaListFromJava(env, javaML);
-}
-
 libvlc_media_player_t *getMediaPlayer(JNIEnv *env, jobject thiz)
 {
     return (libvlc_media_player_t*)(intptr_t)getLong(env, thiz, "mInternalMediaPlayerInstance");
@@ -402,24 +393,6 @@ void Java_org_videolan_libvlc_LibVLC_playIndex(JNIEnv *env, jobject thiz,
     create_player_and_play(env, thiz, instance, position);
 }
 
-void Java_org_videolan_libvlc_LibVLC_getMediaListItems(
-                JNIEnv *env, jobject thiz, jobject arrayList) {
-    jclass arrayClass = (*env)->FindClass(env, "java/util/ArrayList");
-    jmethodID methodID = (*env)->GetMethodID(env, arrayClass, "add", "(Ljava/lang/Object;)Z");
-    jstring str;
-
-    libvlc_media_list_t* p_mlist = getMediaList(env, thiz);
-    libvlc_media_list_lock( p_mlist );
-    for(int i = 0; i < libvlc_media_list_count( p_mlist ); i++) {
-        char* mrl = libvlc_media_get_mrl( libvlc_media_list_item_at_index( p_mlist, i ) );
-        str = (*env)->NewStringUTF(env, mrl);
-        (*env)->CallBooleanMethod(env, arrayList, methodID, str);
-        (*env)->DeleteLocalRef(env, str);
-        free(mrl);
-    }
-    libvlc_media_list_unlock( p_mlist );
-}
-
 jfloat Java_org_videolan_libvlc_LibVLC_getRate(JNIEnv *env, jobject thiz) {
     libvlc_media_player_t* mp = getMediaPlayer(env, thiz);
     if(mp)
diff --git a/vlc-android/jni/utils.h b/vlc-android/jni/utils.h
index 03f64ce..f8502d9 100644
--- a/vlc-android/jni/utils.h
+++ b/vlc-android/jni/utils.h
@@ -23,8 +23,6 @@
 
 libvlc_media_t *new_media(jlong instance, JNIEnv *env, jobject thiz, jstring fileLocation, bool noOmx, bool noVideo);
 
-libvlc_media_list_t* getMediaListFromJava(JNIEnv *env, jobject obj);
-
 libvlc_media_player_t *getMediaPlayer(JNIEnv *env, jobject thiz);
 
 jint getInt(JNIEnv *env, jobject thiz, const char* field);
diff --git a/vlc-android/src/org/videolan/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
index c558f87..884065b 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
@@ -593,11 +593,6 @@ public class LibVLC {
 
     public native static boolean nativeIsPathDirectory(String path);
 
-    /**
-     * Get the list of existing items in the media list (playlist)
-     */
-    public native void getMediaListItems(ArrayList<String> arl);
-
      /**
       * Expand and continue playing the current media.
       *



More information about the Android mailing list