mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Add "Bind to IP" setting to advanced settings
This commit is contained in:
parent
289ccee447
commit
2a343955a2
|
@ -527,6 +527,8 @@ Basic.Settings.Advanced.StreamDelay="Stream Delay"
|
|||
Basic.Settings.Advanced.StreamDelay.Duration="Duration (seconds)"
|
||||
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.BindToIP="Bind to IP"
|
||||
|
||||
# advanced audio properties
|
||||
Basic.AdvAudio="Advanced Audio Properties"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>896</width>
|
||||
<width>981</width>
|
||||
<height>667</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -2886,9 +2886,9 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>718</width>
|
||||
<height>622</height>
|
||||
<y>-206</y>
|
||||
<width>803</width>
|
||||
<height>820</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
|
@ -3258,6 +3258,28 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_11">
|
||||
<property name="title">
|
||||
<string>Basic.Settings.Advanced.Network</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_23">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="bindToIP"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_27">
|
||||
<property name="text">
|
||||
<string>Basic.Settings.Advanced.Network.BindToIP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="advancedMsg">
|
||||
<property name="styleSheet">
|
||||
|
|
|
@ -540,6 +540,14 @@ bool SimpleOutput::StartStreaming(obs_service_t *service)
|
|||
"DelaySec");
|
||||
bool preserveDelay = config_get_bool(main->Config(), "Output",
|
||||
"DelayPreserve");
|
||||
const char *bindIP = config_get_string(main->Config(), "Output",
|
||||
"BindIP");
|
||||
|
||||
obs_data_t *settings = obs_data_create();
|
||||
obs_data_set_string(settings, "bind_ip", bindIP);
|
||||
obs_output_update(streamOutput, settings);
|
||||
obs_data_release(settings);
|
||||
|
||||
if (!reconnect)
|
||||
maxRetries = 0;
|
||||
|
||||
|
@ -1079,6 +1087,14 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service)
|
|||
"DelaySec");
|
||||
bool preserveDelay = config_get_bool(main->Config(), "Output",
|
||||
"DelayPreserve");
|
||||
const char *bindIP = config_get_string(main->Config(), "Output",
|
||||
"BindIP");
|
||||
|
||||
obs_data_t *settings = obs_data_create();
|
||||
obs_data_set_string(settings, "bind_ip", bindIP);
|
||||
obs_output_update(streamOutput, settings);
|
||||
obs_data_release(settings);
|
||||
|
||||
if (!reconnect)
|
||||
maxRetries = 0;
|
||||
|
||||
|
|
|
@ -819,6 +819,8 @@ bool OBSBasic::InitBasicConfigDefaults()
|
|||
config_set_default_uint (basicConfig, "Output", "RetryDelay", 10);
|
||||
config_set_default_uint (basicConfig, "Output", "MaxRetries", 20);
|
||||
|
||||
config_set_default_string(basicConfig, "Output", "BindIP", "default");
|
||||
|
||||
int i = 0;
|
||||
uint32_t scale_cx = cx;
|
||||
uint32_t scale_cy = cy;
|
||||
|
|
|
@ -372,6 +372,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
HookWidget(ui->reconnectRetryDelay, SCROLL_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->reconnectMaxRetries, SCROLL_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->processPriority, COMBO_CHANGED, ADV_CHANGED);
|
||||
HookWidget(ui->bindToIP, COMBO_CHANGED, ADV_CHANGED);
|
||||
|
||||
#ifdef _WIN32
|
||||
uint32_t winVer = GetWindowsVersion();
|
||||
|
@ -522,6 +523,20 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||
connect(ui->listWidget, SIGNAL(currentRowChanged(int)),
|
||||
this, SLOT(SimpleRecordingEncoderChanged()));
|
||||
|
||||
// Get Bind to IP Addresses
|
||||
obs_properties_t *ppts = obs_get_output_properties("rtmp_output");
|
||||
obs_property_t *p = obs_properties_get(ppts, "bind_ip");
|
||||
|
||||
size_t count = obs_property_list_item_count(p);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
const char *name = obs_property_list_item_name(p, i);
|
||||
const char *val = obs_property_list_item_string(p, i);
|
||||
|
||||
ui->bindToIP->addItem(QT_UTF8(name), val);
|
||||
}
|
||||
|
||||
obs_properties_destroy(ppts);
|
||||
|
||||
LoadSettings(false);
|
||||
|
||||
// Add warning checks to advanced output recording section controls
|
||||
|
@ -1810,6 +1825,8 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
"FilenameFormatting");
|
||||
bool overwriteIfExists = config_get_bool(main->Config(), "Output",
|
||||
"OverwriteIfExists");
|
||||
const char *bindIP = config_get_string(main->Config(), "Output",
|
||||
"BindIP");
|
||||
|
||||
loading = true;
|
||||
|
||||
|
@ -1830,6 +1847,8 @@ void OBSBasicSettings::LoadAdvancedSettings()
|
|||
SetComboByName(ui->colorSpace, videoColorSpace);
|
||||
SetComboByValue(ui->colorRange, videoColorRange);
|
||||
|
||||
SetComboByValue(ui->bindToIP, bindIP);
|
||||
|
||||
if (video_output_active(obs_get_video())) {
|
||||
ui->advancedVideoContainer->setEnabled(false);
|
||||
}
|
||||
|
@ -2315,6 +2334,7 @@ void OBSBasicSettings::SaveAdvancedSettings()
|
|||
SaveCheckBox(ui->reconnectEnable, "Output", "Reconnect");
|
||||
SaveSpinBox(ui->reconnectRetryDelay, "Output", "RetryDelay");
|
||||
SaveSpinBox(ui->reconnectMaxRetries, "Output", "MaxRetries");
|
||||
SaveComboData(ui->bindToIP, "Output", "BindIP");
|
||||
}
|
||||
|
||||
static inline const char *OutputModeFromIdx(int idx)
|
||||
|
|
Loading…
Reference in a new issue