mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-01 23:35:28 +00:00
Update to new HDR support option in moonlight-common-c
This commit is contained in:
parent
458460515d
commit
f1bcc217a9
@ -424,13 +424,13 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
int supportedVideoFormats = MoonBridge.VIDEO_FORMAT_H264;
|
||||
if (decoderRenderer.isHevcSupported()) {
|
||||
supportedVideoFormats |= MoonBridge.VIDEO_FORMAT_H265;
|
||||
if (decoderRenderer.isHevcMain10Hdr10Supported()) {
|
||||
if (willStreamHdr && decoderRenderer.isHevcMain10Hdr10Supported()) {
|
||||
supportedVideoFormats |= MoonBridge.VIDEO_FORMAT_H265_MAIN10;
|
||||
}
|
||||
}
|
||||
if (decoderRenderer.isAv1Supported()) {
|
||||
supportedVideoFormats |= MoonBridge.VIDEO_FORMAT_AV1_MAIN8;
|
||||
if (decoderRenderer.isAv1Main10Supported()) {
|
||||
if (willStreamHdr && decoderRenderer.isAv1Main10Supported()) {
|
||||
supportedVideoFormats |= MoonBridge.VIDEO_FORMAT_AV1_MAIN10;
|
||||
}
|
||||
}
|
||||
@ -486,7 +486,6 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
.setHevcBitratePercentageMultiplier(75)
|
||||
.setAv1BitratePercentageMultiplier(60)
|
||||
.setSupportedVideoFormats(supportedVideoFormats)
|
||||
.setEnableHdr(willStreamHdr)
|
||||
.setAttachedGamepadMask(gamepadMask)
|
||||
.setClientRefreshRateX100((int)(displayRefreshRate * 100))
|
||||
.setAudioConfiguration(prefConfig.audioConfiguration)
|
||||
|
@ -19,6 +19,7 @@ public class ConnectionContext {
|
||||
// This is the version quad from the appversion tag of /serverinfo
|
||||
public String serverAppVersion;
|
||||
public String serverGfeVersion;
|
||||
public int serverCodecModeSupport;
|
||||
|
||||
// This is the sessionUrl0 tag from /resume and /launch
|
||||
public String rtspSessionUrl;
|
||||
|
@ -242,9 +242,11 @@ public class NvConnection {
|
||||
return false;
|
||||
}
|
||||
|
||||
context.negotiatedHdr = context.streamConfig.getEnableHdr();
|
||||
if ((h.getServerCodecModeSupport(serverInfo) & 0x200) == 0 && context.negotiatedHdr) {
|
||||
context.connListener.displayTransientMessage("Your GPU does not support streaming HDR. The stream will be SDR.");
|
||||
context.serverCodecModeSupport = (int)h.getServerCodecModeSupport(serverInfo);
|
||||
|
||||
context.negotiatedHdr = (context.streamConfig.getSupportedVideoFormats() & MoonBridge.VIDEO_FORMAT_MASK_10BIT) != 0;
|
||||
if ((context.serverCodecModeSupport & 0x20200) == 0 && context.negotiatedHdr) {
|
||||
context.connListener.displayTransientMessage("Your PC GPU does not support streaming HDR. The stream will be SDR.");
|
||||
context.negotiatedHdr = false;
|
||||
}
|
||||
|
||||
@ -254,7 +256,7 @@ public class NvConnection {
|
||||
|
||||
// Check for a supported stream resolution
|
||||
if ((context.streamConfig.getWidth() > 4096 || context.streamConfig.getHeight() > 4096) &&
|
||||
(h.getServerCodecModeSupport(serverInfo) & 0x200) == 0) {
|
||||
(h.getServerCodecModeSupport(serverInfo) & 0x200) == 0 && context.isNvidiaServerSoftware) {
|
||||
context.connListener.displayMessage("Your host PC does not support streaming at resolutions above 4K.");
|
||||
return false;
|
||||
}
|
||||
@ -430,7 +432,7 @@ public class NvConnection {
|
||||
context.negotiatedPacketSize, context.negotiatedRemoteStreaming,
|
||||
context.streamConfig.getAudioConfiguration().toInt(),
|
||||
context.streamConfig.getSupportedVideoFormats(),
|
||||
context.negotiatedHdr,
|
||||
context.serverCodecModeSupport,
|
||||
context.streamConfig.getHevcBitratePercentageMultiplier(),
|
||||
context.streamConfig.getAv1BitratePercentageMultiplier(),
|
||||
context.streamConfig.getClientRefreshRateX100(),
|
||||
|
@ -25,7 +25,6 @@ public class StreamConfiguration {
|
||||
private int supportedVideoFormats;
|
||||
private int hevcBitratePercentageMultiplier;
|
||||
private int av1BitratePercentageMultiplier;
|
||||
private boolean enableHdr;
|
||||
private int attachedGamepadMask;
|
||||
private int encryptionFlags;
|
||||
private int colorRange;
|
||||
@ -96,11 +95,6 @@ public class StreamConfiguration {
|
||||
return this;
|
||||
}
|
||||
|
||||
public StreamConfiguration.Builder setEnableHdr(boolean enableHdr) {
|
||||
config.enableHdr = enableHdr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StreamConfiguration.Builder setAttachedGamepadMask(int attachedGamepadMask) {
|
||||
config.attachedGamepadMask = attachedGamepadMask;
|
||||
return this;
|
||||
@ -238,10 +232,6 @@ public class StreamConfiguration {
|
||||
return av1BitratePercentageMultiplier;
|
||||
}
|
||||
|
||||
public boolean getEnableHdr() {
|
||||
return enableHdr;
|
||||
}
|
||||
|
||||
public int getAttachedGamepadMask() {
|
||||
return attachedGamepadMask;
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ public class MoonBridge {
|
||||
int width, int height, int fps,
|
||||
int bitrate, int packetSize, int streamingRemotely,
|
||||
int audioConfiguration, int supportedVideoFormats,
|
||||
boolean enableHdr,
|
||||
int serverCodecModeSupport,
|
||||
int hevcBitratePercentageMultiplier,
|
||||
int av1BitratePercentageMultiplier,
|
||||
int clientRefreshRateX100,
|
||||
|
@ -433,7 +433,7 @@ Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass c
|
||||
jint width, jint height, jint fps,
|
||||
jint bitrate, jint packetSize, jint streamingRemotely,
|
||||
jint audioConfiguration, jint supportedVideoFormats,
|
||||
jboolean enableHdr,
|
||||
jint serverCodecModeSupport,
|
||||
jint hevcBitratePercentageMultiplier,
|
||||
jint av1BitratePercentageMultiplier,
|
||||
jint clientRefreshRateX100,
|
||||
@ -456,7 +456,7 @@ Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass c
|
||||
.streamingRemotely = streamingRemotely,
|
||||
.audioConfiguration = audioConfiguration,
|
||||
.supportedVideoFormats = supportedVideoFormats,
|
||||
.enableHdr = enableHdr,
|
||||
.serverCodecModeSupport = serverCodecModeSupport,
|
||||
.hevcBitratePercentageMultiplier = hevcBitratePercentageMultiplier,
|
||||
.av1BitratePercentageMultiplier = av1BitratePercentageMultiplier,
|
||||
.clientRefreshRateX100 = clientRefreshRateX100,
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit e36bde4acce48c21c79a57fb29727d96fdae6503
|
||||
Subproject commit effba1a16fab4f72ac52e14b99bb90c08b96b582
|
Loading…
x
Reference in New Issue
Block a user