Skip to content

Commit

Permalink
Add new RTSP encryption flags
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Jan 14, 2024
1 parent 15b55a4 commit b6bbb4f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down
8 changes: 8 additions & 0 deletions src/Limelight-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/RtspConnection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b6bbb4f

Please sign in to comment.