[Android] LibVLC: provide access to libvlc functions for titles/chapters handling

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


vlc-ports/android | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Fri Jul  4 15:47:09 2014 +0200| [fbe5350ffa7166682698a446444107a4f0d1390c] | committer: Felix Abecassis

LibVLC: provide access to libvlc functions for titles/chapters handling

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

 vlc-android/jni/libvlcjni.c                     |   23 +++++++++++++++++++++++
 vlc-android/src/org/videolan/libvlc/LibVLC.java |    5 +++++
 2 files changed, 28 insertions(+)

diff --git a/vlc-android/jni/libvlcjni.c b/vlc-android/jni/libvlcjni.c
index 0f787be..98025b1 100644
--- a/vlc-android/jni/libvlcjni.c
+++ b/vlc-android/jni/libvlcjni.c
@@ -539,3 +539,26 @@ jstring Java_org_videolan_libvlc_LibVLC_changeset(JNIEnv* env, jobject thiz)
 {
     return (*env)->NewStringUTF(env, libvlc_get_changeset());
 }
+
+jint Java_org_videolan_libvlc_LibVLC_getTitle(JNIEnv *env, jobject thiz)
+{
+    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+    if (mp)
+        return libvlc_media_player_get_title(mp);
+    return -1;
+}
+
+void Java_org_videolan_libvlc_LibVLC_setTitle(JNIEnv *env, jobject thiz, jint title)
+{
+    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+    if (mp)
+        libvlc_media_player_set_title(mp, title);
+}
+
+jint Java_org_videolan_libvlc_LibVLC_getChapterCountForTitle(JNIEnv *env, jobject thiz, jint title)
+{
+    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+    if (mp)
+        return libvlc_media_player_get_chapter_count_for_title(mp, title);
+    return -1;
+}
diff --git a/vlc-android/src/org/videolan/libvlc/LibVLC.java b/vlc-android/src/org/videolan/libvlc/LibVLC.java
index a05c007..38fe3e5 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVLC.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVLC.java
@@ -710,4 +710,9 @@ public class LibVLC {
     public String getCachePath() {
         return mCachePath;
     }
+
+    public native int getTitle();
+    public native void setTitle(int title);
+    public native int getChapterCountForTitle(int title);
+
 }



More information about the Android mailing list