From f3a75e8e762a08f8498ee212745fbef0d82b0bfd Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 19 Aug 2024 21:43:00 -0500 Subject: [PATCH] Add experimental option to unlock bitrate to 500 Mbps Fixes #1375 Fixes #1343 Closes #1377 --- app/cli/commandlineparser.cpp | 4 ++-- app/gui/SettingsView.qml | 19 ++++++++++++++++++- app/settings/streamingpreferences.cpp | 3 +++ app/settings/streamingpreferences.h | 3 +++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/app/cli/commandlineparser.cpp b/app/cli/commandlineparser.cpp index f932e5c2..c5300779 100644 --- a/app/cli/commandlineparser.cpp +++ b/app/cli/commandlineparser.cpp @@ -421,8 +421,8 @@ void StreamCommandLineParser::parse(const QStringList &args, StreamingPreference // Resolve --bitrate option if (parser.isSet("bitrate")) { preferences->bitrateKbps = parser.getIntOption("bitrate"); - if (!inRange(preferences->bitrateKbps, 500, 150000)) { - parser.showError("Bitrate must be in range: 500 - 150000"); + if (!inRange(preferences->bitrateKbps, 500, 500000)) { + parser.showError("Bitrate must be in range: 500 - 500000"); } } else if (displaySet || parser.isSet("fps")) { preferences->bitrateKbps = preferences->getDefaultBitrate( diff --git a/app/gui/SettingsView.qml b/app/gui/SettingsView.qml index 4ed9d279..3e43764b 100644 --- a/app/gui/SettingsView.qml +++ b/app/gui/SettingsView.qml @@ -685,7 +685,7 @@ Flickable { stepSize: 500 from : 500 - to: 150000 + to: StreamingPreferences.unlockBitrate ? 500000 : 150000 snapMode: "SnapOnRelease" width: Math.min(bitrateDesc.implicitWidth, parent.width) @@ -1645,6 +1645,23 @@ Flickable { qsTr("YUV 4:4:4 is not supported on this PC.") } + CheckBox { + id: unlockBitrate + width: parent.width + text: qsTr("Unlock bitrate limit (Experimental)") + font.pointSize: 12 + + checked: StreamingPreferences.unlockBitrate + onCheckedChanged: { + StreamingPreferences.unlockBitrate = checked + } + + ToolTip.delay: 1000 + ToolTip.timeout: 5000 + ToolTip.visible: hovered + ToolTip.text: qsTr("This enables extremely high bitrates and should only be used when streaming over an Ethernet LAN connection.") + } + CheckBox { id: enableMdns width: parent.width diff --git a/app/settings/streamingpreferences.cpp b/app/settings/streamingpreferences.cpp index ba3d8002..b420b4f2 100644 --- a/app/settings/streamingpreferences.cpp +++ b/app/settings/streamingpreferences.cpp @@ -15,6 +15,7 @@ #define SER_HEIGHT "height" #define SER_FPS "fps" #define SER_BITRATE "bitrate" +#define SER_UNLOCK_BITRATE "unlockbitrate" #define SER_FULLSCREEN "fullscreen" #define SER_VSYNC "vsync" #define SER_GAMEOPTS "gameopts" @@ -120,6 +121,7 @@ void StreamingPreferences::reload() fps = settings.value(SER_FPS, 60).toInt(); enableYUV444 = settings.value(SER_YUV444, false).toBool(); bitrateKbps = settings.value(SER_BITRATE, getDefaultBitrate(width, height, fps, enableYUV444)).toInt(); + unlockBitrate = settings.value(SER_UNLOCK_BITRATE, false).toBool(); enableVsync = settings.value(SER_VSYNC, true).toBool(); gameOptimizations = settings.value(SER_GAMEOPTS, true).toBool(); playAudioOnHost = settings.value(SER_HOSTAUDIO, false).toBool(); @@ -307,6 +309,7 @@ void StreamingPreferences::save() settings.setValue(SER_HEIGHT, height); settings.setValue(SER_FPS, fps); settings.setValue(SER_BITRATE, bitrateKbps); + settings.setValue(SER_UNLOCK_BITRATE, unlockBitrate); settings.setValue(SER_VSYNC, enableVsync); settings.setValue(SER_GAMEOPTS, gameOptimizations); settings.setValue(SER_HOSTAUDIO, playAudioOnHost); diff --git a/app/settings/streamingpreferences.h b/app/settings/streamingpreferences.h index 14aa74a0..f2f9e320 100644 --- a/app/settings/streamingpreferences.h +++ b/app/settings/streamingpreferences.h @@ -108,6 +108,7 @@ public: Q_PROPERTY(int height MEMBER height NOTIFY displayModeChanged) Q_PROPERTY(int fps MEMBER fps NOTIFY displayModeChanged) Q_PROPERTY(int bitrateKbps MEMBER bitrateKbps NOTIFY bitrateChanged) + Q_PROPERTY(bool unlockBitrate MEMBER unlockBitrate NOTIFY unlockBitrateChanged) Q_PROPERTY(bool enableVsync MEMBER enableVsync NOTIFY enableVsyncChanged) Q_PROPERTY(bool gameOptimizations MEMBER gameOptimizations NOTIFY gameOptimizationsChanged) Q_PROPERTY(bool playAudioOnHost MEMBER playAudioOnHost NOTIFY playAudioOnHostChanged) @@ -146,6 +147,7 @@ public: int height; int fps; int bitrateKbps; + bool unlockBitrate; bool enableVsync; bool gameOptimizations; bool playAudioOnHost; @@ -181,6 +183,7 @@ public: signals: void displayModeChanged(); void bitrateChanged(); + void unlockBitrateChanged(); void enableVsyncChanged(); void gameOptimizationsChanged(); void playAudioOnHostChanged();