UI: Hide network features if a non-RTMP service is set

Reimplementation of bc80d0c and f2e6122, because they have to be
reverted by 0b9a8aa.
This commit is contained in:
tytan652
2022-07-19 07:44:12 +02:00
committed by Jim
parent 57c9844f15
commit fc7af80f84
5 changed files with 57 additions and 7 deletions

View File

@@ -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;
}