Add network connection test

This commit is contained in:
Cameron Gutman
2020-08-01 22:19:40 -07:00
parent e8fc91191f
commit 770f1a1ca0
8 changed files with 116 additions and 8 deletions

View File

@@ -101,4 +101,32 @@ Java_com_limelight_nvstream_jni_MoonBridge_getPendingAudioDuration(JNIEnv *env,
JNIEXPORT jint JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_getPendingVideoFrames(JNIEnv *env, jclass clazz) {
return LiGetPendingVideoFrames();
}
JNIEXPORT jint JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_testClientConnectivity(JNIEnv *env, jclass clazz, jstring testServerHostName, jint referencePort, jint testFlags) {
int ret;
const char* testServerHostNameStr = (*env)->GetStringUTFChars(env, testServerHostName, NULL);
ret = LiTestClientConnectivity(testServerHostNameStr, (unsigned short)referencePort, testFlags);
(*env)->ReleaseStringUTFChars(env, testServerHostName, testServerHostNameStr);
return ret;
}
JNIEXPORT jint JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_getPortFromPortFlagIndex(JNIEnv *env, jclass clazz, jint portFlagIndex) {
return LiGetPortFromPortFlagIndex(portFlagIndex);
}
JNIEXPORT jstring JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_getProtocolFromPortFlagIndex(JNIEnv *env, jclass clazz, jint portFlagIndex) {
int protocol = LiGetProtocolFromPortFlagIndex(portFlagIndex);
return (*env)->NewStringUTF(env, protocol == IPPROTO_TCP ? "TCP" : "UDP");
}
JNIEXPORT jint JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_getPortFlagsFromStage(JNIEnv *env, jclass clazz, jint stage) {
return LiGetPortFlagsFromStage(stage);
}