From 9b28981b59cb44e6b10c4c6ac56b1a54ab351d92 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 15 Jan 2024 15:21:56 -0600 Subject: [PATCH] Opt in for video encryption on A10 and later SoCs --- Limelight/Stream/Connection.m | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Limelight/Stream/Connection.m b/Limelight/Stream/Connection.m index 2443311..a26687a 100644 --- a/Limelight/Stream/Connection.m +++ b/Limelight/Stream/Connection.m @@ -420,9 +420,16 @@ void ClSetControllerLED(uint16_t controllerNumber, uint8_t r, uint8_t g, uint8_t _streamConfig.supportedVideoFormats = config.supportedVideoFormats; _streamConfig.audioConfiguration = config.audioConfiguration; - // TODO: If/when video encryption is added, we'll probably want to - // limit that to devices that support the ARMv8 AES instructions. - _streamConfig.encryptionFlags = ENCFLG_AUDIO; + // Since we require iOS 12 or above, we're guaranteed to be running + // on a 64-bit device with ARMv8 crypto instructions, so we don't + // need to check for that here. Instead, we'll just check for more + // than 2 cores, which eliminates the early dual-core CPUs (A7-A9). + if (NSProcessInfo.processInfo.processorCount > 2) { + _streamConfig.encryptionFlags = ENCFLG_ALL; + } + else { + _streamConfig.encryptionFlags = ENCFLG_AUDIO; + } if ([Utils isActiveNetworkVPN]) { // Force remote streaming mode when a VPN is connected