From de5377a95d089298e1fd5bd79333d16d2db4b94b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 14 Sep 2017 19:50:53 -0700 Subject: [PATCH] Only use HEVC if the client has hardware-accelerated decoding --- Limelight/Stream/Connection.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Limelight/Stream/Connection.m b/Limelight/Stream/Connection.m index 6e21864..77e21b5 100644 --- a/Limelight/Stream/Connection.m +++ b/Limelight/Stream/Connection.m @@ -10,6 +10,7 @@ #import #import +#import #include "Limelight.h" #include "opus.h" @@ -321,8 +322,9 @@ void ClLogMessage(const char* format, ...) _streamConfig.bitrate = config.bitRate; // On iOS 11, we can use HEVC if the server supports encoding it + // and this device has hardware decode for it (A9 and later) if (@available(iOS 11.0, *)) { - _streamConfig.supportsHevc = 1; + _streamConfig.supportsHevc = VTIsHardwareDecodeSupported(kCMVideoCodecType_HEVC); } // FIXME: We should use 1024 when streaming remotely