diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini index e4b0f6500..14a7092bd 100644 --- a/UI/data/locale/en-US.ini +++ b/UI/data/locale/en-US.ini @@ -1090,6 +1090,7 @@ Basic.Settings.Advanced.StreamDelay.Duration="Duration" Basic.Settings.Advanced.StreamDelay.Preserve="Preserve cutoff point (increase delay) when reconnecting" Basic.Settings.Advanced.StreamDelay.MemoryUsage="Estimated Memory Usage: %1 MB" Basic.Settings.Advanced.Network="Network" +Basic.Settings.Advanced.Network.Disabled="The currently selected streaming protocol does not support changing network settings." Basic.Settings.Advanced.Network.BindToIP="Bind to IP" Basic.Settings.Advanced.Network.EnableNewSocketLoop="Enable network optimizations" Basic.Settings.Advanced.Network.EnableLowLatencyMode="Enable TCP pacing" diff --git a/UI/forms/OBSBasicSettings.ui b/UI/forms/OBSBasicSettings.ui index a2cd2f604..46a56d68e 100644 --- a/UI/forms/OBSBasicSettings.ui +++ b/UI/forms/OBSBasicSettings.ui @@ -5572,8 +5572,15 @@ 2 - - + + + + Basic.Settings.Advanced.Network.Disabled + + + + + Basic.Settings.Advanced.Network.BindToIP @@ -5582,17 +5589,17 @@ - + - + Basic.Settings.Advanced.Network.EnableNewSocketLoop - + false @@ -5602,7 +5609,7 @@ - + Qt::Horizontal @@ -5615,7 +5622,7 @@ - + Basic.Settings.Output.DynamicBitrate.TT diff --git a/UI/window-basic-settings-stream.cpp b/UI/window-basic-settings-stream.cpp index 3e4eb15c0..f812edf81 100644 --- a/UI/window-basic-settings-stream.cpp +++ b/UI/window-basic-settings-stream.cpp @@ -96,6 +96,11 @@ void OBSBasicSettings::InitStreamPage() SLOT(UpdateResFPSLimits())); connect(ui->service, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateMoreInfoLink())); + + connect(ui->service, SIGNAL(currentIndexChanged(int)), this, + SLOT(UpdateAdvNetworkGroup())); + connect(ui->customServer, SIGNAL(textChanged(const QString &)), this, + SLOT(UpdateAdvNetworkGroup())); } void OBSBasicSettings::LoadStream1Settings() @@ -1155,3 +1160,20 @@ void OBSBasicSettings::UpdateResFPSLimits() lastIgnoreRecommended = (int)ignoreRecommended; lastServiceIdx = idx; } + +bool OBSBasicSettings::IsServiceOutputHasNetworkFeatures() +{ + if (IsCustomService()) + return ui->customServer->text().startsWith("rtmp"); + + OBSServiceAutoRelease service = SpawnTempService(); + const char *output = obs_service_get_output_type(service); + + if (!output) + return true; + + if (strcmp(output, "rtmp_output") == 0) + return true; + + return false; +} diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index 6521ab47a..f73e54553 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -939,6 +939,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) SLOT(UseStreamKeyAdvClicked())); UpdateAudioWarnings(); + UpdateAdvNetworkGroup(); } OBSBasicSettings::~OBSBasicSettings() @@ -5472,3 +5473,18 @@ void OBSBasicSettings::RecreateOutputResolutionWidget() ui->outputResolution->lineEdit()->setValidator( ui->baseResolution->lineEdit()->validator()); } + +void OBSBasicSettings::UpdateAdvNetworkGroup() +{ + bool enabled = IsServiceOutputHasNetworkFeatures(); + + ui->advNetworkDisabled->setVisible(!enabled); + + ui->bindToIPLabel->setVisible(enabled); + ui->bindToIP->setVisible(enabled); + ui->dynBitrate->setVisible(enabled); +#ifdef _WIN32 + ui->enableNewSocketLoop->setVisible(enabled); + ui->enableLowLatencyMode->setVisible(enabled); +#endif +} diff --git a/UI/window-basic-settings.hpp b/UI/window-basic-settings.hpp index 416942e0f..5c34c29d3 100644 --- a/UI/window-basic-settings.hpp +++ b/UI/window-basic-settings.hpp @@ -346,6 +346,8 @@ private: OBSService GetStream1Service(); + bool IsServiceOutputHasNetworkFeatures(); + private slots: void on_theme_activated(int idx); @@ -395,6 +397,8 @@ private slots: void UpdateStreamDelayEstimate(); + void UpdateAdvNetworkGroup(); + void UpdateAutomaticReplayBufferCheckboxes(); void AdvOutSplitFileChanged();