[Android] Expose chapters navigation methods
Geoffrey Métais
git at videolan.org
Mon Mar 30 19:02:37 CEST 2015
vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Mar 30 18:53:00 2015 +0200| [0e3d2ece6e7922bb3d2914dbd18fcd7d782bf97e] | committer: Geoffrey Métais
Expose chapters navigation methods
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=0e3d2ece6e7922bb3d2914dbd18fcd7d782bf97e
---
libvlc/jni/libvlcjni.c | 37 ++++++++++++++++++++++++++++
libvlc/src/org/videolan/libvlc/LibVLC.java | 5 ++++
2 files changed, 42 insertions(+)
diff --git a/libvlc/jni/libvlcjni.c b/libvlc/jni/libvlcjni.c
index e28fae4..d0923c1 100644
--- a/libvlc/jni/libvlcjni.c
+++ b/libvlc/jni/libvlcjni.c
@@ -759,6 +759,14 @@ void Java_org_videolan_libvlc_LibVLC_setTitle(JNIEnv *env, jobject thiz, jint ti
libvlc_media_player_set_title(mp, title);
}
+jint Java_org_videolan_libvlc_LibVLC_getChapterCount(JNIEnv *env, jobject thiz)
+{
+ libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+ if (mp)
+ return libvlc_media_player_get_chapter_count(mp);
+ return -1;
+}
+
jint Java_org_videolan_libvlc_LibVLC_getChapterCountForTitle(JNIEnv *env, jobject thiz, jint title)
{
libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
@@ -767,6 +775,35 @@ jint Java_org_videolan_libvlc_LibVLC_getChapterCountForTitle(JNIEnv *env, jobjec
return -1;
}
+jint Java_org_videolan_libvlc_LibVLC_getChapter(JNIEnv *env, jobject thiz)
+{
+ libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+ if (mp)
+ return libvlc_media_player_get_chapter(mp);
+ return -1;
+}
+
+void Java_org_videolan_libvlc_LibVLC_setChapter(JNIEnv *env, jobject thiz, jint chapter)
+{
+ libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+ if (mp)
+ libvlc_media_player_set_chapter(mp, chapter);
+}
+
+void Java_org_videolan_libvlc_LibVLC_previousChapter(JNIEnv *env, jobject thiz)
+{
+ libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+ if (mp)
+ libvlc_media_player_previous_chapter(mp);
+}
+
+void Java_org_videolan_libvlc_LibVLC_nextChapter(JNIEnv *env, jobject thiz)
+{
+ libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+ if (mp)
+ libvlc_media_player_next_chapter(mp);
+}
+
jint Java_org_videolan_libvlc_LibVLC_getTitleCount(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 d4240a5..1061aec 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -695,6 +695,11 @@ public class LibVLC {
public native int getTitle();
public native void setTitle(int title);
public native int getChapterCountForTitle(int title);
+ public native int getChapterCount();
+ public native int getChapter();
+ public native int previousChapter();
+ public native int nextChapter();
+ public native void setChapter(int chapter);
public native int getTitleCount();
public native void playerNavigate(int navigate);
More information about the Android
mailing list