mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-06-17 14:21:08 +00:00
Add support for automatic remote streaming detection
This commit is contained in:
@@ -6,6 +6,10 @@ import com.limelight.nvstream.jni.MoonBridge;
|
|||||||
public class StreamConfiguration {
|
public class StreamConfiguration {
|
||||||
public static final int INVALID_APP_ID = 0;
|
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_STEREO = 2;
|
||||||
private static final int CHANNEL_COUNT_5_1 = 6;
|
private static final int CHANNEL_COUNT_5_1 = 6;
|
||||||
|
|
||||||
@@ -21,7 +25,7 @@ public class StreamConfiguration {
|
|||||||
private boolean enableAdaptiveResolution;
|
private boolean enableAdaptiveResolution;
|
||||||
private boolean playLocalAudio;
|
private boolean playLocalAudio;
|
||||||
private int maxPacketSize;
|
private int maxPacketSize;
|
||||||
private boolean remote;
|
private int remote;
|
||||||
private int audioChannelMask;
|
private int audioChannelMask;
|
||||||
private int audioChannelCount;
|
private int audioChannelCount;
|
||||||
private int audioConfiguration;
|
private int audioConfiguration;
|
||||||
@@ -38,7 +42,7 @@ public class StreamConfiguration {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StreamConfiguration.Builder setRemote(boolean remote) {
|
public StreamConfiguration.Builder setRemoteConfiguration(int remote) {
|
||||||
config.remote = remote;
|
config.remote = remote;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -145,6 +149,7 @@ public class StreamConfiguration {
|
|||||||
this.refreshRate = 60;
|
this.refreshRate = 60;
|
||||||
this.bitrate = 10000;
|
this.bitrate = 10000;
|
||||||
this.maxPacketSize = 1024;
|
this.maxPacketSize = 1024;
|
||||||
|
this.remote = STREAM_CFG_AUTO;
|
||||||
this.sops = true;
|
this.sops = true;
|
||||||
this.enableAdaptiveResolution = false;
|
this.enableAdaptiveResolution = false;
|
||||||
this.audioChannelCount = CHANNEL_COUNT_STEREO;
|
this.audioChannelCount = CHANNEL_COUNT_STEREO;
|
||||||
@@ -190,7 +195,7 @@ public class StreamConfiguration {
|
|||||||
return playLocalAudio;
|
return playLocalAudio;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getRemote() {
|
public int getRemote() {
|
||||||
return remote;
|
return remote;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ public class MoonBridge {
|
|||||||
|
|
||||||
public static native int startConnection(String address, String appVersion, String gfeVersion,
|
public static native int startConnection(String address, String appVersion, String gfeVersion,
|
||||||
int width, int height, int fps,
|
int width, int height, int fps,
|
||||||
int bitrate, int packetSize, boolean streamingRemotely,
|
int bitrate, int packetSize, int streamingRemotely,
|
||||||
int audioConfiguration, boolean supportsHevc,
|
int audioConfiguration, boolean supportsHevc,
|
||||||
boolean enableHdr,
|
boolean enableHdr,
|
||||||
int hevcBitratePercentageMultiplier,
|
int hevcBitratePercentageMultiplier,
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ JNIEXPORT jint JNICALL
|
|||||||
Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass clazz,
|
Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass clazz,
|
||||||
jstring address, jstring appVersion, jstring gfeVersion,
|
jstring address, jstring appVersion, jstring gfeVersion,
|
||||||
jint width, jint height, jint fps,
|
jint width, jint height, jint fps,
|
||||||
jint bitrate, jint packetSize, jboolean streamingRemotely,
|
jint bitrate, jint packetSize, jint streamingRemotely,
|
||||||
jint audioConfiguration, jboolean supportsHevc,
|
jint audioConfiguration, jboolean supportsHevc,
|
||||||
jboolean enableHdr,
|
jboolean enableHdr,
|
||||||
jint hevcBitratePercentageMultiplier,
|
jint hevcBitratePercentageMultiplier,
|
||||||
|
|||||||
Submodule moonlight-common/src/main/jni/moonlight-core/moonlight-common-c updated: 8665d80697...639ff18dbb
Reference in New Issue
Block a user