Use LiInterruptConnection to prevent long waits for RTSP timeout

This commit is contained in:
Cameron Gutman 2017-05-21 12:25:04 -07:00
parent 7651ce5e84
commit 5d90950591
4 changed files with 11 additions and 1 deletions

View File

@ -63,6 +63,9 @@ public class NvConnection {
} }
public void stop() { public void stop() {
// Interrupt any pending connection. This is thread-safe.
MoonBridge.interruptConnection();
// Moonlight-core is not thread-safe with respect to connection start and stop, so // Moonlight-core is not thread-safe with respect to connection start and stop, so
// we must not invoke that functionality in parallel. // we must not invoke that functionality in parallel.
synchronized (MoonBridge.class) { synchronized (MoonBridge.class) {

View File

@ -141,6 +141,8 @@ public class MoonBridge {
public static native void stopConnection(); public static native void stopConnection();
public static native void interruptConnection();
public static native void sendMouseMove(short deltaX, short deltaY); public static native void sendMouseMove(short deltaX, short deltaY);
public static native void sendMouseButton(byte buttonEvent, byte mouseButton); public static native void sendMouseButton(byte buttonEvent, byte mouseButton);

@ -1 +1 @@
Subproject commit 2d7bf5be828492c2a18b4ea84b526fde60273520 Subproject commit 92951e1309a4c1f49f1a965eefff367912a07558

View File

@ -45,6 +45,11 @@ Java_com_limelight_nvstream_jni_MoonBridge_stopConnection(JNIEnv *env, jobject c
LiStopConnection(); LiStopConnection();
} }
JNIEXPORT void JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_interruptConnection(JNIEnv *env, jobject class) {
LiInterruptConnection();
}
JNIEXPORT jstring JNICALL JNIEXPORT jstring JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_getStageName(JNIEnv *env, jobject class, jint stage) { Java_com_limelight_nvstream_jni_MoonBridge_getStageName(JNIEnv *env, jobject class, jint stage) {
return (*env)->NewStringUTF(env, LiGetStageName(stage)); return (*env)->NewStringUTF(env, LiGetStageName(stage));