mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-01 15:25:59 +00:00
Move encryption enablement logic into JNI code
This commit is contained in:
parent
7b13f12817
commit
f7520ba40c
@ -478,7 +478,6 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
.setAttachedGamepadMask(gamepadMask)
|
.setAttachedGamepadMask(gamepadMask)
|
||||||
.setClientRefreshRateX100((int)(displayRefreshRate * 100))
|
.setClientRefreshRateX100((int)(displayRefreshRate * 100))
|
||||||
.setAudioConfiguration(prefConfig.audioConfiguration)
|
.setAudioConfiguration(prefConfig.audioConfiguration)
|
||||||
.setAudioEncryption(true)
|
|
||||||
.setColorSpace(decoderRenderer.getPreferredColorSpace())
|
.setColorSpace(decoderRenderer.getPreferredColorSpace())
|
||||||
.setColorRange(decoderRenderer.getPreferredColorRange())
|
.setColorRange(decoderRenderer.getPreferredColorRange())
|
||||||
.setPersistGamepadsAfterDisconnect(!prefConfig.multiController)
|
.setPersistGamepadsAfterDisconnect(!prefConfig.multiController)
|
||||||
|
@ -434,7 +434,6 @@ public class NvConnection {
|
|||||||
context.streamConfig.getAudioConfiguration().toInt(),
|
context.streamConfig.getAudioConfiguration().toInt(),
|
||||||
context.streamConfig.getSupportedVideoFormats(),
|
context.streamConfig.getSupportedVideoFormats(),
|
||||||
context.streamConfig.getClientRefreshRateX100(),
|
context.streamConfig.getClientRefreshRateX100(),
|
||||||
context.streamConfig.getEncryptionFlags(),
|
|
||||||
context.riKey.getEncoded(), ib.array(),
|
context.riKey.getEncoded(), ib.array(),
|
||||||
context.videoCapabilities,
|
context.videoCapabilities,
|
||||||
context.streamConfig.getColorSpace(),
|
context.streamConfig.getColorSpace(),
|
||||||
|
@ -108,16 +108,6 @@ public class StreamConfiguration {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StreamConfiguration.Builder setAudioEncryption(boolean enable) {
|
|
||||||
if (enable) {
|
|
||||||
config.encryptionFlags |= MoonBridge.ENCFLG_AUDIO;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
config.encryptionFlags &= ~MoonBridge.ENCFLG_AUDIO;
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public StreamConfiguration.Builder setAudioConfiguration(MoonBridge.AudioConfiguration audioConfig) {
|
public StreamConfiguration.Builder setAudioConfiguration(MoonBridge.AudioConfiguration audioConfig) {
|
||||||
config.audioConfiguration = audioConfig;
|
config.audioConfiguration = audioConfig;
|
||||||
return this;
|
return this;
|
||||||
@ -224,10 +214,6 @@ public class StreamConfiguration {
|
|||||||
return clientRefreshRateX100;
|
return clientRefreshRateX100;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getEncryptionFlags() {
|
|
||||||
return encryptionFlags;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getColorRange() {
|
public int getColorRange() {
|
||||||
return colorRange;
|
return colorRange;
|
||||||
}
|
}
|
||||||
|
@ -22,10 +22,6 @@ public class MoonBridge {
|
|||||||
public static final int VIDEO_FORMAT_MASK_AV1 = 0xF000;
|
public static final int VIDEO_FORMAT_MASK_AV1 = 0xF000;
|
||||||
public static final int VIDEO_FORMAT_MASK_10BIT = 0x2200;
|
public static final int VIDEO_FORMAT_MASK_10BIT = 0x2200;
|
||||||
|
|
||||||
public static final int ENCFLG_NONE = 0;
|
|
||||||
public static final int ENCFLG_AUDIO = 1;
|
|
||||||
public static final int ENCFLG_ALL = 0xFFFFFFFF;
|
|
||||||
|
|
||||||
public static final int BUFFER_TYPE_PICDATA = 0;
|
public static final int BUFFER_TYPE_PICDATA = 0;
|
||||||
public static final int BUFFER_TYPE_SPS = 1;
|
public static final int BUFFER_TYPE_SPS = 1;
|
||||||
public static final int BUFFER_TYPE_PPS = 2;
|
public static final int BUFFER_TYPE_PPS = 2;
|
||||||
@ -348,7 +344,6 @@ public class MoonBridge {
|
|||||||
int bitrate, int packetSize, int streamingRemotely,
|
int bitrate, int packetSize, int streamingRemotely,
|
||||||
int audioConfiguration, int supportedVideoFormats,
|
int audioConfiguration, int supportedVideoFormats,
|
||||||
int clientRefreshRateX100,
|
int clientRefreshRateX100,
|
||||||
int encryptionFlags,
|
|
||||||
byte[] riAesKey, byte[] riAesIv,
|
byte[] riAesKey, byte[] riAesIv,
|
||||||
int videoCapabilities,
|
int videoCapabilities,
|
||||||
int colorSpace, int colorRange);
|
int colorSpace, int colorRange);
|
||||||
|
@ -434,7 +434,6 @@ Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass c
|
|||||||
jint bitrate, jint packetSize, jint streamingRemotely,
|
jint bitrate, jint packetSize, jint streamingRemotely,
|
||||||
jint audioConfiguration, jint supportedVideoFormats,
|
jint audioConfiguration, jint supportedVideoFormats,
|
||||||
jint clientRefreshRateX100,
|
jint clientRefreshRateX100,
|
||||||
jint encryptionFlags,
|
|
||||||
jbyteArray riAesKey, jbyteArray riAesIv,
|
jbyteArray riAesKey, jbyteArray riAesIv,
|
||||||
jint videoCapabilities,
|
jint videoCapabilities,
|
||||||
jint colorSpace, jint colorRange) {
|
jint colorSpace, jint colorRange) {
|
||||||
@ -455,7 +454,7 @@ Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass c
|
|||||||
.audioConfiguration = audioConfiguration,
|
.audioConfiguration = audioConfiguration,
|
||||||
.supportedVideoFormats = supportedVideoFormats,
|
.supportedVideoFormats = supportedVideoFormats,
|
||||||
.clientRefreshRateX100 = clientRefreshRateX100,
|
.clientRefreshRateX100 = clientRefreshRateX100,
|
||||||
.encryptionFlags = encryptionFlags,
|
.encryptionFlags = ENCFLG_AUDIO,
|
||||||
.colorSpace = colorSpace,
|
.colorSpace = colorSpace,
|
||||||
.colorRange = colorRange
|
.colorRange = colorRange
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user