Commit 867d063e authored by Uwe L. Korn's avatar Uwe L. Korn Committed by Edward Wang

jni: Add HTTP reconnect option on LibVLC instantiation

Signed-off-by: Edward Wang's avatarEdward Wang <edward.c.wang@compdigitec.com>
parent 991e7f20
......@@ -252,6 +252,9 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
LOGD("Using network caching of %d ms", networkCaching);
}
methodId = (*env)->GetMethodID(env, cls, "getHttpReconnect", "()Z");
bool enable_http_reconnect = (*env)->CallBooleanMethod(env, thiz, methodId);
methodId = (*env)->GetMethodID(env, cls, "getChroma", "()Ljava/lang/String;");
jstring chroma = (*env)->CallObjectMethod(env, thiz, methodId);
const char *chromastr = (*env)->GetStringUTFChars(env, chroma, 0);
......@@ -308,6 +311,9 @@ void Java_org_videolan_libvlc_LibVLC_nativeInit(JNIEnv *env, jobject thiz)
/* XXX: we can't recover from direct rendering failure */
(hardwareAcceleration == HW_ACCELERATION_FULL) ? "" : "--no-mediacodec-dr",
(hardwareAcceleration == HW_ACCELERATION_FULL) ? "" : NO_IOMX_DR,
/* Reconnect on lost HTTP streams, e.g. network change */
enable_http_reconnect ? "--http-reconnect" : "",
};
libvlc_instance_t *instance = libvlc_new(sizeof(argv) / sizeof(*argv), argv);
......
......@@ -75,6 +75,7 @@ public class LibVLC {
private float[] equalizer = null;
private boolean frameSkip = false;
private int networkCaching = 0;
private boolean httpReconnect = false;
/** Path of application-specific cache */
private String mCachePath = "";
......@@ -372,6 +373,14 @@ public class LibVLC {
this.networkCaching = networkcaching;
}
public boolean getHttpReconnect() {
return httpReconnect;
}
public void setHttpReconnect(boolean httpReconnect) {
this.httpReconnect = httpReconnect;
}
/**
* Initialize the libVLC class.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment