<div dir="ltr">Please ignore this patch.<div>Will send it again in a new email.</div><div>Thanks</div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-04 23:12 GMT-02:00 Paulo Vitor Magacho da Silva <span dir="ltr"><<a href="mailto:pvmagacho@gmail.com" target="_blank">pvmagacho@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
libvlc/jni/libvlcjni-track.c | 4 ++--<br>
libvlc/jni/libvlcjni.c | 6 +++---<br>
libvlc/jni/thumbnailer.c | 2 +-<br>
libvlc/jni/utils.h | 2 +-<br>
libvlc/src/org/videolan/libvlc/LibVLC.java | 5 ++++-<br>
libvlc/src/org/videolan/libvlc/MediaList.java | 22 ++++++++++++++--------<br>
6 files changed, 25 insertions(+), 16 deletions(-)<br>
<br>
diff --git a/libvlc/jni/libvlcjni-track.c b/libvlc/jni/libvlcjni-track.c<br>
index cfc70ce..1e131f9 100644<br>
--- a/libvlc/jni/libvlcjni-track.c<br>
+++ b/libvlc/jni/libvlcjni-track.c<br>
@@ -48,7 +48,7 @@ jboolean Java_org_videolan_libvlc_LibVLC_hasVideoTrack(JNIEnv *env, jobject thiz<br>
jstring fileLocation)<br>
{<br>
/* Create a new item and assign it to the media player. */<br>
- libvlc_media_t *p_m = new_media(env, thiz, fileLocation, false, false);<br>
+ libvlc_media_t *p_m = new_media(env, thiz, fileLocation, false, false, false);<br>
if (p_m == NULL)<br>
{<br>
LOGE("Could not create the media!");<br>
@@ -186,7 +186,7 @@ jobjectArray Java_org_videolan_libvlc_LibVLC_readTracksInfo(JNIEnv *env, jobject<br>
jstring mrl)<br>
{<br>
/* Create a new item and assign it to the media player. */<br>
- libvlc_media_t *p_m = new_media(env, thiz, mrl, false, false);<br>
+ libvlc_media_t *p_m = new_media(env, thiz, mrl, false, false, false);<br>
if (p_m == NULL)<br>
{<br>
LOGE("Could not create the media!");<br>
diff --git a/libvlc/jni/libvlcjni.c b/libvlc/jni/libvlcjni.c<br>
index 94b216c..a9662db 100644<br>
--- a/libvlc/jni/libvlcjni.c<br>
+++ b/libvlc/jni/libvlcjni.c<br>
@@ -72,7 +72,7 @@ static void add_media_options(libvlc_media_t *p_md, JNIEnv *env, jobjectArray me<br>
}<br>
}<br>
<br>
-libvlc_media_t *new_media(JNIEnv *env, jobject thiz, jstring fileLocation, bool noOmx, bool noVideo)<br>
+libvlc_media_t *new_media(JNIEnv *env, jobject thiz, jstring fileLocation, bool noOmx, bool noVideo, bool useTcp)<br>
{<br>
libvlc_instance_t *libvlc = getLibVlcInstance(env, thiz);<br>
jboolean isCopy;<br>
@@ -83,10 +83,10 @@ libvlc_media_t *new_media(JNIEnv *env, jobject thiz, jstring fileLocation, bool<br>
return NULL;<br>
<br>
jclass cls = (*env)->GetObjectClass(env, thiz);<br>
- jmethodID methodId = (*env)->GetMethodID(env, cls, "getMediaOptions", "(ZZ)[Ljava/lang/String;");<br>
+ jmethodID methodId = (*env)->GetMethodID(env, cls, "getMediaOptions", "(ZZZ)[Ljava/lang/String;");<br>
if (methodId != NULL)<br>
{<br>
- jobjectArray mediaOptions = (*env)->CallObjectMethod(env, thiz, methodId, noOmx, noVideo);<br>
+ jobjectArray mediaOptions = (*env)->CallObjectMethod(env, thiz, methodId, noOmx, noVideo, useTcp);<br>
if (mediaOptions != NULL)<br>
{<br>
add_media_options(p_md, env, mediaOptions);<br>
diff --git a/libvlc/jni/thumbnailer.c b/libvlc/jni/thumbnailer.c<br>
index 0b8aae3..4f61d6f 100644<br>
--- a/libvlc/jni/thumbnailer.c<br>
+++ b/libvlc/jni/thumbnailer.c<br>
@@ -161,7 +161,7 @@ jbyteArray Java_org_videolan_libvlc_LibVLC_getThumbnail(JNIEnv *env, jobject thi<br>
libvlc_media_player_t *mp = libvlc_media_player_new(libvlc);<br>
libvlc_media_player_set_video_title_display(mp, libvlc_position_disable, 0);<br>
<br>
- libvlc_media_t *m = new_media(env, thiz, filePath, true, false);<br>
+ libvlc_media_t *m = new_media(env, thiz, filePath, true, false, false);<br>
if (m == NULL)<br>
{<br>
LOGE("Could not create the media to play!");<br>
diff --git a/libvlc/jni/utils.h b/libvlc/jni/utils.h<br>
index 5da3514..f5b9f8d 100644<br>
--- a/libvlc/jni/utils.h<br>
+++ b/libvlc/jni/utils.h<br>
@@ -21,7 +21,7 @@<br>
#ifndef LIBVLCJNI_UTILS_H<br>
#define LIBVLCJNI_UTILS_H<br>
<br>
-libvlc_media_t *new_media(JNIEnv *env, jobject thiz, jstring fileLocation, bool noOmx, bool noVideo);<br>
+libvlc_media_t *new_media(JNIEnv *env, jobject thiz, jstring fileLocation, bool noOmx, bool noVideo, bool useTcp);<br>
<br>
libvlc_instance_t *getLibVlcInstance(JNIEnv *env, jobject thiz);<br>
<br>
diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java<br>
index 8bac400..822999a 100644<br>
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java<br>
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java<br>
@@ -359,7 +359,7 @@ public class LibVLC {<br>
}<br>
}<br>
<br>
- public String[] getMediaOptions(boolean noHardwareAcceleration, boolean noVideo) {<br>
+ public String[] getMediaOptions(boolean noHardwareAcceleration, boolean noVideo, boolean useTcp) {<br>
if (this.devHardwareDecoder != DEV_HW_DECODER_AUTOMATIC)<br>
noHardwareAcceleration = noVideo = false;<br>
else if (!noHardwareAcceleration)<br>
@@ -384,6 +384,9 @@ public class LibVLC {<br>
if (noVideo)<br>
options.add(":no-video");<br>
<br>
+ if (useTcp)<br>
+ options.add(":rtsp-tcp");<br>
+<br>
return options.toArray(new String[options.size()]);<br>
}<br>
<br>
diff --git a/libvlc/src/org/videolan/libvlc/MediaList.java b/libvlc/src/org/videolan/libvlc/MediaList.java<br>
index 7888f6f..a1e057d 100644<br>
--- a/libvlc/src/org/videolan/libvlc/MediaList.java<br>
+++ b/libvlc/src/org/videolan/libvlc/MediaList.java<br>
@@ -1,7 +1,7 @@<br>
/*****************************************************************************<br>
* MediaList.java<br>
*****************************************************************************<br>
- * Copyright © 2013 VLC authors and VideoLAN<br>
+ * Copyright © 2013-2014 VLC authors and VideoLAN<br>
* Copyright © 2013 Edward Wang<br>
*<br>
* This program is free software; you can redistribute it and/or modify it<br>
@@ -36,12 +36,13 @@ public class MediaList {<br>
Media m;<br>
boolean noVideo; // default false<br>
boolean noHardwareAcceleration; // default false<br>
+ boolean useTcp; // default false<br>
<br>
public MediaHolder(Media media) {<br>
- m = media; noVideo = false; noHardwareAcceleration = false;<br>
+ m = media; noVideo = false; noHardwareAcceleration = false; useTcp = false;<br>
}<br>
- public MediaHolder(Media m_, boolean noVideo_, boolean noHardwareAcceleration_) {<br>
- m = m_; noVideo = noVideo_; noHardwareAcceleration = noHardwareAcceleration_;<br>
+ public MediaHolder(Media m_, boolean noVideo_, boolean noHardwareAcceleration_, boolean useTcp_) {<br>
+ m = m_; noVideo = noVideo_; noHardwareAcceleration = noHardwareAcceleration_; useTcp = useTcp_;<br>
}<br>
}<br>
<br>
@@ -68,13 +69,16 @@ public class MediaList {<br>
add(new Media(mLibVLC, mrl));<br>
}<br>
public void add(Media media) {<br>
- add(media, false, false);<br>
+ add(media, false, false, false);<br>
}<br>
public void add(Media media, boolean noVideo) {<br>
- add(media, noVideo, false);<br>
+ add(media, noVideo, false, false);<br>
}<br>
public void add(Media media, boolean noVideo, boolean noHardwareAcceleration) {<br>
- mInternalList.add(new MediaHolder(media, noVideo, noHardwareAcceleration));<br>
+ add(media, noVideo, false, false);<br>
+ }<br>
+ public void add(Media media, boolean noVideo, boolean noHardwareAcceleration, boolean useTcp) {<br>
+ mInternalList.add(new MediaHolder(media, noVideo, noHardwareAcceleration, useTcp));<br>
signal_list_event(EventHandler.CustomMediaListItemAdded, mInternalList.size() - 1, media.getLocation());<br>
}<br>
<br>
@@ -198,13 +202,15 @@ public class MediaList {<br>
public String[] getMediaOptions(int position) {<br>
boolean noHardwareAcceleration = false;<br>
boolean noVideo = false;<br>
+ boolean useTcp = true;<br>
if (isValid(position))<br>
{<br>
noHardwareAcceleration = mInternalList.get(position).noHardwareAcceleration;<br>
noVideo = mInternalList.get(position).noVideo;<br>
+ useTcp = mInternalList.get(position).useTcp;<br>
}<br>
<br>
- return mLibVLC.getMediaOptions(noHardwareAcceleration, noVideo);<br>
+ return mLibVLC.getMediaOptions(noHardwareAcceleration, noVideo, useTcp);<br>
}<br>
<br>
public EventHandler getEventHandler() {<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.3 (Apple Git-50)<br>
<br>
</font></span></blockquote></div><br></div>