[Android] Add a LibVLC_getMeta method

Jean-Baptiste Kempf git at videolan.org
Tue Nov 25 11:39:02 CET 2014


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Nov 24 18:34:21 2014 +0100| [a1d7d1f8d30264765a4bfb0b45192c6cb925de2c] | committer: Jean-Baptiste Kempf

Add a LibVLC_getMeta method

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 libvlc/jni/libvlcjni.c                     |   13 +++++++++++++
 libvlc/src/org/videolan/libvlc/LibVLC.java |    2 ++
 2 files changed, 15 insertions(+)

diff --git a/libvlc/jni/libvlcjni.c b/libvlc/jni/libvlcjni.c
index 6b28667..3fab373 100644
--- a/libvlc/jni/libvlcjni.c
+++ b/libvlc/jni/libvlcjni.c
@@ -593,6 +593,19 @@ jstring Java_org_videolan_libvlc_LibVLC_changeset(JNIEnv* env, jobject thiz)
     return (*env)->NewStringUTF(env, libvlc_get_changeset());
 }
 
+jstring Java_org_videolan_libvlc_LibVLC_getMeta(JNIEnv *env, jobject thiz, int meta)
+{
+    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+    if (!mp)
+        return NULL;
+
+    libvlc_media_t *p_mp = libvlc_media_player_get_media(mp);
+    if (!p_mp)
+        return NULL;
+
+    return (*env)->NewStringUTF(env, libvlc_media_get_meta(p_mp, meta));
+}
+
 jint Java_org_videolan_libvlc_LibVLC_getTitle(JNIEnv *env, jobject thiz)
 {
     libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 5dffb47..7efd1af 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -881,4 +881,6 @@ public class LibVLC {
     public native int getTitleCount();
     public native void playerNavigate(int navigate);
 
+    public native String getMeta(int meta);
+
 }



More information about the Android mailing list