UI: Add Amazon IVS auto config QoL changes

This doesn't generally make the speedtest work for Amazon IVS, since
most Amazon IVS channels will be disconnected if the bitrate being
sent exceeds the upper limit for that channel.
This commit is contained in:
Ruwen Hahn
2024-04-11 14:27:44 +02:00
committed by Ryan Foster
parent fc60ca63dc
commit adcaf539c9
3 changed files with 30 additions and 4 deletions

View File

@@ -411,6 +411,8 @@ bool AutoConfigStreamPage::validatePage()
else if (IsYouTubeService(wiz->serviceName))
wiz->service = AutoConfig::Service::YouTube;
#endif
else if (wiz->serviceName == "Amazon IVS")
wiz->service = AutoConfig::Service::AmazonIVS;
else
wiz->service = AutoConfig::Service::Other;
} else {
@@ -498,6 +500,7 @@ bool AutoConfigStreamPage::validatePage()
if (wiz->service != AutoConfig::Service::Twitch &&
wiz->service != AutoConfig::Service::YouTube &&
wiz->service != AutoConfig::Service::AmazonIVS &&
wiz->bandwidthTest) {
QMessageBox::StandardButton button;
#define WARNING_TEXT(x) QTStr("Basic.AutoConfig.StreamPage.StreamWarning." x)
@@ -774,7 +777,8 @@ void AutoConfigStreamPage::ServiceChanged()
reset_service_ui_fields(service);
/* Test three closest servers if "Auto" is available for Twitch */
if (service == "Twitch" && wiz->twitchAuto)
if ((service == "Twitch" && wiz->twitchAuto) ||
(service == "Amazon IVS" && wiz->amazonIVSAuto))
regionBased = false;
ui->streamkeyPageLayout->removeWidget(ui->serverLabel);
@@ -1025,6 +1029,7 @@ AutoConfig::AutoConfig(QWidget *parent) : QWizard(parent)
proc_handler_t *ph = obs_get_proc_handler();
proc_handler_call(ph, "twitch_ingests_refresh", &cd);
proc_handler_call(ph, "amazon_ivs_ingests_refresh", &cd);
calldata_free(&cd);
OBSBasic *main = reinterpret_cast<OBSBasic *>(parent);
@@ -1068,6 +1073,22 @@ AutoConfig::AutoConfig(QWidget *parent) : QWizard(parent)
obs_properties_destroy(props);
/* ----------------------------------------- */
/* check to see if Amazon IVS "auto" entries are available */
OBSDataAutoRelease amazonIVSSettings = obs_data_create();
obs_data_set_string(amazonIVSSettings, "service", "Amazon IVS");
props = obs_get_service_properties("rtmp_common");
obs_properties_apply_settings(props, amazonIVSSettings);
p = obs_properties_get(props, "server");
first = obs_property_list_item_string(p, 0);
amazonIVSAuto = strncmp(first, "auto", 4) == 0;
obs_properties_destroy(props);
/* ----------------------------------------- */
/* load service/servers */