Add support for automatic remote streaming detection

This commit is contained in:
Cameron Gutman 2018-11-21 21:19:10 -08:00
parent bae3b4a6e8
commit 68028242b4
4 changed files with 12 additions and 7 deletions

View File

@ -5,7 +5,11 @@ import com.limelight.nvstream.jni.MoonBridge;
public class StreamConfiguration {
public static final int INVALID_APP_ID = 0;
public static final int STREAM_CFG_LOCAL = 0;
public static final int STREAM_CFG_REMOTE = 1;
public static final int STREAM_CFG_AUTO = 2;
private static final int CHANNEL_COUNT_STEREO = 2;
private static final int CHANNEL_COUNT_5_1 = 6;
@ -21,7 +25,7 @@ public class StreamConfiguration {
private boolean enableAdaptiveResolution;
private boolean playLocalAudio;
private int maxPacketSize;
private boolean remote;
private int remote;
private int audioChannelMask;
private int audioChannelCount;
private int audioConfiguration;
@ -38,7 +42,7 @@ public class StreamConfiguration {
return this;
}
public StreamConfiguration.Builder setRemote(boolean remote) {
public StreamConfiguration.Builder setRemoteConfiguration(int remote) {
config.remote = remote;
return this;
}
@ -145,6 +149,7 @@ public class StreamConfiguration {
this.refreshRate = 60;
this.bitrate = 10000;
this.maxPacketSize = 1024;
this.remote = STREAM_CFG_AUTO;
this.sops = true;
this.enableAdaptiveResolution = false;
this.audioChannelCount = CHANNEL_COUNT_STEREO;
@ -190,7 +195,7 @@ public class StreamConfiguration {
return playLocalAudio;
}
public boolean getRemote() {
public int getRemote() {
return remote;
}

View File

@ -170,7 +170,7 @@ public class MoonBridge {
public static native int startConnection(String address, String appVersion, String gfeVersion,
int width, int height, int fps,
int bitrate, int packetSize, boolean streamingRemotely,
int bitrate, int packetSize, int streamingRemotely,
int audioConfiguration, boolean supportsHevc,
boolean enableHdr,
int hevcBitratePercentageMultiplier,

View File

@ -401,7 +401,7 @@ JNIEXPORT jint JNICALL
Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass clazz,
jstring address, jstring appVersion, jstring gfeVersion,
jint width, jint height, jint fps,
jint bitrate, jint packetSize, jboolean streamingRemotely,
jint bitrate, jint packetSize, jint streamingRemotely,
jint audioConfiguration, jboolean supportsHevc,
jboolean enableHdr,
jint hevcBitratePercentageMultiplier,

@ -1 +1 @@
Subproject commit 8665d806978d2cba9c9040183a3686f4d87d402c
Subproject commit 639ff18dbbcde35ca918c2e898e20bd2a624fdc5