[Android] libvlc: add setVideoTrack

Thomas Guillem git at videolan.org
Thu Apr 9 17:45:05 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Apr  8 18:57:26 2015 +0200| [129804a8089e4a4a24d92048ddfe0d5ea314acac] | committer: Thomas Guillem

libvlc: add setVideoTrack

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

 libvlc/jni/libvlcjni-track.c               |    8 ++++++++
 libvlc/src/org/videolan/libvlc/LibVLC.java |    2 ++
 2 files changed, 10 insertions(+)

diff --git a/libvlc/jni/libvlcjni-track.c b/libvlc/jni/libvlcjni-track.c
index 359f9d5..ffa6723 100644
--- a/libvlc/jni/libvlcjni-track.c
+++ b/libvlc/jni/libvlcjni-track.c
@@ -278,6 +278,14 @@ jint Java_org_videolan_libvlc_LibVLC_getVideoTracksCount(JNIEnv *env, jobject th
     return -1;
 }
 
+jint Java_org_videolan_libvlc_LibVLC_setVideoTrack(JNIEnv *env, jobject thiz, jint index)
+{
+    libvlc_media_player_t *mp = getMediaPlayer(env, thiz);
+    if (mp)
+        return libvlc_video_set_track(mp, index);
+    return -1;
+}
+
 jobject Java_org_videolan_libvlc_LibVLC_getSpuTrackDescription(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 2f4d6f6..4cde814 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -633,6 +633,8 @@ public class LibVLC {
 
     public native int getVideoTracksCount();
 
+    public native int setVideoTrack(int index);
+
     public native int addSubtitleTrack(String path);
 
     public native Map<Integer,String> getSpuTrackDescription();



More information about the Android mailing list