[Android] libvlcjni: remove unused & deprecated functions

Sébastien Toque git at videolan.org
Sun Jul 28 09:51:54 CEST 2013


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Sun Jul 28 08:10:57 2013 +0200| [a66e94f1c6a2e20bc2daf1f11c6f3039092a2826] | committer: Sébastien Toque

libvlcjni: remove unused & deprecated functions

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

 vlc-android/jni/libvlcjni.c                     |   93 -----------------------
 vlc-android/src/org/videolan/libvlc/LibVLC.java |   23 ------
 2 files changed, 116 deletions(-)

diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index 2389b6b..46cbcb0 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -629,48 +629,6 @@ void Java_org_videolan_libvlc_LibVLC_setEventHandler(JNIEnv *env, jobject thiz,
     eventHandlerInstance = (*env)->NewGlobalRef(env, eventHandler);
 }
 
-jobjectArray Java_org_videolan_libvlc_LibVLC_readMediaMeta(JNIEnv *env,
-                                                        jobject thiz, jlong instance, jstring mrl)
-{
-    jobjectArray array = (*env)->NewObjectArray(env, 8,
-            (*env)->FindClass(env, "java/lang/String"),
-            (*env)->NewStringUTF(env, ""));
-
-    libvlc_media_t *m = new_media(instance, env, thiz, mrl, false, false);
-    if (!m)
-    {
-        LOGE("readMediaMeta: Could not create the media!");
-        return array;
-    }
-
-    libvlc_media_parse(m);
-
-    static const char str[][7] = {
-        "artist", "album", "title", "genre",
-    };
-    static const libvlc_meta_t meta_id[] = {
-        libvlc_meta_Artist,
-        libvlc_meta_Album,
-        libvlc_meta_Title,
-        libvlc_meta_Genre,
-    };
-    for (int i=0; i < sizeof(str) / sizeof(*str); i++) {
-        char *meta = libvlc_media_get_meta(m, meta_id[i]);
-        if (!meta)
-            meta = strdup("");
-
-        jstring k = (*env)->NewStringUTF(env, str[i]);
-        (*env)->SetObjectArrayElement(env, array, 2*i, k);
-        jstring v = (*env)->NewStringUTF(env, meta);
-        (*env)->SetObjectArrayElement(env, array, 2*i+1, v);
-
-        free(meta);
-   }
-
-   libvlc_media_release(m);
-   return array;
-}
-
 static void create_player_and_play(JNIEnv* env, jobject thiz,
                                    jlong instance, int position) {
     /* Release previous media player, if any */
@@ -990,57 +948,6 @@ jobjectArray Java_org_videolan_libvlc_LibVLC_readTracksInfoPosition(JNIEnv *env,
         return read_track_info_internal(env, thiz, p_m);
 }
 
-jlong Java_org_videolan_libvlc_LibVLC_getLengthFromLocation(JNIEnv *env, jobject thiz,
-                                                     jlong i_instance, jstring fileLocation)
-{
-    jlong length = 0;
-    struct length_change_monitor *monitor;
-    monitor = malloc(sizeof(*monitor));
-    if (!monitor)
-        return 0;
-
-    /* Initialize pthread variables. */
-    pthread_mutex_init(&monitor->doneMutex, NULL);
-    pthread_cond_init(&monitor->doneCondVar, NULL);
-    monitor->length_changed = false;
-
-    /* Create a new item and assign it to the media player. */
-    libvlc_media_t *m = new_media(i_instance, env, thiz, fileLocation, false, false);
-    if (m == NULL)
-    {
-        LOGE("Could not create the media to play!");
-        goto end;
-    }
-
-    /* Create a media player playing environment */
-    libvlc_media_player_t *mp = libvlc_media_player_new_from_media (m);
-    libvlc_event_manager_t *ev = libvlc_media_player_event_manager(mp);
-    libvlc_event_attach(ev, libvlc_MediaPlayerLengthChanged, length_changed_callback, monitor);
-    libvlc_media_release (m);
-    libvlc_media_player_play( mp );
-
-    pthread_mutex_lock(&monitor->doneMutex);
-    while (!monitor->length_changed)
-        pthread_cond_wait(&monitor->doneCondVar, &monitor->doneMutex);
-    pthread_mutex_unlock(&monitor->doneMutex);
-
-    length = libvlc_media_player_get_length( mp );
-    libvlc_media_player_stop( mp );
-    libvlc_media_player_release( mp );
-
-end:
-    pthread_mutex_destroy(&monitor->doneMutex);
-    pthread_cond_destroy(&monitor->doneCondVar);
-    free(monitor);
-
-    return length;
-}
-
-jboolean Java_org_videolan_libvlc_LibVLC_hasMediaPlayer(JNIEnv *env, jobject thiz)
-{
-    return !!getMediaPlayer(env, thiz);
-}
-
 jboolean Java_org_videolan_libvlc_LibVLC_isPlaying(JNIEnv *env, jobject thiz)
 {
     libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
diff --git a/vlc-android/src/org/videolan/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
index a60ed4e..92330fa 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
@@ -327,10 +327,6 @@ public class LibVLC {
         playIndex(mLibVlcInstance, position);
     }
 
-    public String[] readMediaMeta(String mrl) {
-        return readMediaMeta(mLibVlcInstance, mrl);
-    }
-
     public TrackInfo[] readTracksInfo(String mrl) {
         return readTracksInfo(mLibVlcInstance, mrl);
     }
@@ -350,13 +346,6 @@ public class LibVLC {
     }
 
     /**
-     * Return the length of the stream, in milliseconds
-     */
-    public long getLengthFromLocation(String mrl) {
-        return getLengthFromLocation(mLibVlcInstance, mrl);
-    }
-
-    /**
      * Sets the speed of playback (1 being normal speed, 2 being twice as fast)
      *
      * @param rate
@@ -418,11 +407,6 @@ public class LibVLC {
     private native void playIndex(long instance, int position);
 
     /**
-     * Return true if there is currently a running media player.
-     */
-    public native boolean hasMediaPlayer();
-
-    /**
      * Returns true if any media is playing
      */
     public native boolean isPlaying();
@@ -528,8 +512,6 @@ public class LibVLC {
      */
     private native boolean hasVideoTrack(long instance, String mrl);
 
-    private native String[] readMediaMeta(long instance, String mrl);
-
     private native TrackInfo[] readTracksInfo(long instance, String mrl);
 
     public native TrackInfo[] readTracksInfoPosition(int position);
@@ -581,11 +563,6 @@ public class LibVLC {
       */
     public native int expandMedia();
 
-    /**
-     * Return the length of the stream, in milliseconds
-     */
-    private native long getLengthFromLocation(long instance, String mrl);
-
     private native void setEventHandler(EventHandler eventHandler);
 
     private native void detachEventHandler();



More information about the Android mailing list