[Android] Expose getChapterDescription method

Geoffrey Métais git at videolan.org
Mon Mar 30 19:29:21 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Mar 30 19:27:38 2015 +0200| [434725579ea48c4518202ec12050de27ac865912] | committer: Geoffrey Métais

Expose getChapterDescription method

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

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

diff --git a/libvlc/jni/libvlcjni.c b/libvlc/jni/libvlcjni.c
index d0923c1..8be824d 100644
--- a/libvlc/jni/libvlcjni.c
+++ b/libvlc/jni/libvlcjni.c
@@ -783,6 +783,21 @@ jint Java_org_videolan_libvlc_LibVLC_getChapter(JNIEnv *env, jobject thiz)
     return -1;
 }
 
+jstring Java_org_videolan_libvlc_LibVLC_getChapterDescription(JNIEnv *env, jobject thiz, jint title)
+{
+    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+    libvlc_track_description_t *description;
+    jstring string = NULL;
+    if (!mp)
+        return NULL;
+    description = libvlc_video_get_chapter_description(mp, title);
+    if (description) {
+        string = (*env)->NewStringUTF(env, description->psz_name);
+        free(description);
+    }
+    return string;
+}
+
 void Java_org_videolan_libvlc_LibVLC_setChapter(JNIEnv *env, jobject thiz, jint chapter)
 {
     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 1061aec..0dfe95b 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -697,6 +697,7 @@ public class LibVLC {
     public native int getChapterCountForTitle(int title);
     public native int getChapterCount();
     public native int getChapter();
+    public native String getChapterDescription(int title);
     public native int previousChapter();
     public native int nextChapter();
     public native void setChapter(int chapter);



More information about the Android mailing list