diff --git a/src/Connection.c b/src/Connection.c index 2b4d70e..ff0b9b4 100644 --- a/src/Connection.c +++ b/src/Connection.c @@ -33,6 +33,9 @@ SS_PING AudioPingPayload; SS_PING VideoPingPayload; uint32_t ControlConnectData; uint32_t SunshineFeatureFlags; +uint32_t EncryptionFeaturesSupported; +uint32_t EncryptionFeaturesRequested; +uint32_t EncryptionFeaturesEnabled; // Connection stages static const char* stageNames[STAGE_MAX] = { diff --git a/src/Limelight-internal.h b/src/Limelight-internal.h index e8a9784..cee74cd 100644 --- a/src/Limelight-internal.h +++ b/src/Limelight-internal.h @@ -44,6 +44,14 @@ extern uint32_t ControlConnectData; extern uint32_t SunshineFeatureFlags; +// Encryption flags shared by Sunshine and Moonlight in RTSP +#define SS_ENC_CONTROL_V2 0x01 +#define SS_ENC_VIDEO 0x02 + +extern uint32_t EncryptionFeaturesSupported; +extern uint32_t EncryptionFeaturesRequested; +extern uint32_t EncryptionFeaturesEnabled; + // ENet channel ID values #define CTRL_CHANNEL_GENERIC 0x00 #define CTRL_CHANNEL_URGENT 0x01 // IDR and reference frame invalidation requests diff --git a/src/RtspConnection.c b/src/RtspConnection.c index a37ce23..78789ac 100644 --- a/src/RtspConnection.c +++ b/src/RtspConnection.c @@ -942,6 +942,15 @@ int performRtspHandshake(PSERVER_INFORMATION serverInfo) { SunshineFeatureFlags = 0; } + // Look for the Sunshine encryption flags in the SDP attributes + if (!parseSdpAttributeToUInt(response.payload, "x-ss-general.encryptionSupported", &EncryptionFeaturesSupported)) { + EncryptionFeaturesSupported = 0; + } + if (!parseSdpAttributeToUInt(response.payload, "x-ss-general.encryptionRequested", &EncryptionFeaturesRequested)) { + EncryptionFeaturesRequested = 0; + } + EncryptionFeaturesEnabled = 0; + // Parse the Opus surround parameters out of the RTSP DESCRIBE response. ret = parseOpusConfigurations(&response); if (ret != 0) {