diff --git a/app/backend/systemproperties.cpp b/app/backend/systemproperties.cpp index ccc885d3..815588f0 100644 --- a/app/backend/systemproperties.cpp +++ b/app/backend/systemproperties.cpp @@ -64,6 +64,16 @@ SystemProperties::SystemProperties() hasDiscordIntegration = false; #endif + // TODO: Do something smarter than this. We should be able to query + // this from the decoder (or just try VIDEO_FORMAT_H265_MAIN10 and + // fail if we don't get a hardware accelerated decoder). +#ifdef Q_OS_DARWIN + // HDR is supported by the VideoToolbox renderer + supportsHdr = true; +#else + supportsHdr = false; +#endif + unmappedGamepads = SdlInputHandler::getUnmappedGamepads(); // Populate data that requires talking to SDL. We do it all in one shot diff --git a/app/backend/systemproperties.h b/app/backend/systemproperties.h index 539efbc0..4018bc1c 100644 --- a/app/backend/systemproperties.h +++ b/app/backend/systemproperties.h @@ -26,6 +26,7 @@ public: Q_PROPERTY(int maximumStreamingFrameRate MEMBER maximumStreamingFrameRate CONSTANT) Q_PROPERTY(QSize maximumResolution MEMBER maximumResolution CONSTANT) Q_PROPERTY(QString versionString MEMBER versionString CONSTANT) + Q_PROPERTY(bool supportsHdr MEMBER supportsHdr CONSTANT) Q_INVOKABLE void refreshDisplays(); Q_INVOKABLE QRect getDesktopResolution(int displayIndex); @@ -54,5 +55,6 @@ private: QList monitorDesktopResolutions; QList monitorNativeResolutions; QString versionString; + bool supportsHdr; }; diff --git a/app/gui/SettingsView.qml b/app/gui/SettingsView.qml index f282a185..7b6be0b1 100644 --- a/app/gui/SettingsView.qml +++ b/app/gui/SettingsView.qml @@ -1284,6 +1284,13 @@ Flickable { AutoResizingComboBox { // ignore setting the index at first, and actually set it when the component is loaded Component.onCompleted: { + if (SystemProperties.supportsHdr) { + codecListModel.append({ + "text": qsTr("HEVC HDR (Experimental)"), + "val": StreamingPreferences.VCC_FORCE_HEVC_HDR + }); + } + var saved_vcc = StreamingPreferences.videoCodecConfig currentIndex = 0 for(var i = 0; i < codecListModel.count; i++) { @@ -1312,10 +1319,7 @@ Flickable { text: qsTr("HEVC (H.265)") val: StreamingPreferences.VCC_FORCE_HEVC } - ListElement { - text: qsTr("HEVC HDR (Experimental)") - val: StreamingPreferences.VCC_FORCE_HEVC_HDR - } + /* HEVC HDR will be appended here */ } // ::onActivated must be used, as it only listens for when the index is changed by a human onActivated : {