提交 379b41aa 编写于 作者: D derrod 提交者: jp9000

UI: Add options for new socket loop

上级 f8617bd3
...@@ -605,6 +605,8 @@ Basic.Settings.Advanced.StreamDelay.Preserve="Preserve cutoff point (increase de ...@@ -605,6 +605,8 @@ Basic.Settings.Advanced.StreamDelay.Preserve="Preserve cutoff point (increase de
Basic.Settings.Advanced.StreamDelay.MemoryUsage="Estimated Memory Usage: %1 MB" Basic.Settings.Advanced.StreamDelay.MemoryUsage="Estimated Memory Usage: %1 MB"
Basic.Settings.Advanced.Network="Network" Basic.Settings.Advanced.Network="Network"
Basic.Settings.Advanced.Network.BindToIP="Bind to IP" Basic.Settings.Advanced.Network.BindToIP="Bind to IP"
Basic.Settings.Advanced.Network.EnableNewSocketLoop="Enable new networking code"
Basic.Settings.Advanced.Network.EnableLowLatencyMode="Low latency mode"
# advanced audio properties # advanced audio properties
Basic.AdvAudio="Advanced Audio Properties" Basic.AdvAudio="Advanced Audio Properties"
......
...@@ -3455,9 +3455,9 @@ ...@@ -3455,9 +3455,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>-16</y>
<width>593</width> <width>803</width>
<height>699</height> <height>738</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_16"> <layout class="QVBoxLayout" name="verticalLayout_16">
...@@ -3787,16 +3787,9 @@ ...@@ -3787,16 +3787,9 @@
<string>Basic.Settings.Advanced.StreamDelay</string> <string>Basic.Settings.Advanced.StreamDelay</string>
</property> </property>
<layout class="QFormLayout" name="formLayout_18"> <layout class="QFormLayout" name="formLayout_18">
<item row="0" column="1"> <property name="topMargin">
<widget class="QCheckBox" name="streamDelayEnable"> <number>2</number>
<property name="text"> </property>
<string>Enable</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_56"> <widget class="QLabel" name="label_56">
<property name="text"> <property name="text">
...@@ -3873,6 +3866,16 @@ ...@@ -3873,6 +3866,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="QCheckBox" name="streamDelayEnable">
<property name="text">
<string>Enable</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
...@@ -3979,6 +3982,23 @@ ...@@ -3979,6 +3982,23 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<widget class="QCheckBox" name="enableNewSocketLoop">
<property name="text">
<string>Basic.Settings.Advanced.Network.EnableNewSocketLoop</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="enableLowLatencyMode">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Basic.Settings.Advanced.Network.EnableLowLatencyMode</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
...@@ -4147,6 +4167,29 @@ ...@@ -4147,6 +4167,29 @@
<tabstop>reconnectRetryDelay</tabstop> <tabstop>reconnectRetryDelay</tabstop>
<tabstop>reconnectMaxRetries</tabstop> <tabstop>reconnectMaxRetries</tabstop>
<tabstop>bindToIP</tabstop> <tabstop>bindToIP</tabstop>
<tabstop>enableNewSocketLoop</tabstop>
<tabstop>enableLowLatencyMode</tabstop>
<tabstop>warnBeforeStreamStop</tabstop>
<tabstop>recordWhenStreaming</tabstop>
<tabstop>keepRecordStreamStops</tabstop>
<tabstop>replayWhileStreaming</tabstop>
<tabstop>keepReplayStreamStops</tabstop>
<tabstop>snappingEnabled</tabstop>
<tabstop>screenSnapping</tabstop>
<tabstop>centerSnapping</tabstop>
<tabstop>sourceSnapping</tabstop>
<tabstop>snapDistance</tabstop>
<tabstop>hideProjectorCursor</tabstop>
<tabstop>projectorAlwaysOnTop</tabstop>
<tabstop>saveProjectors</tabstop>
<tabstop>systemTrayEnabled</tabstop>
<tabstop>systemTrayWhenStarted</tabstop>
<tabstop>systemTrayAlways</tabstop>
<tabstop>enableAutoUpdates</tabstop>
<tabstop>warnBeforeStreamStart</tabstop>
<tabstop>scrollArea_2</tabstop>
<tabstop>language</tabstop>
<tabstop>theme</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="obs.qrc"/> <include location="obs.qrc"/>
...@@ -4276,7 +4319,7 @@ ...@@ -4276,7 +4319,7 @@
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>241</x> <x>241</x>
<y>54</y> <y>53</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
...@@ -4291,7 +4334,7 @@ ...@@ -4291,7 +4334,7 @@
<y>67</y> <y>67</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>243</x> <x>250</x>
<y>67</y> <y>67</y>
</hint> </hint>
</hints> </hints>
...@@ -4345,210 +4388,242 @@ ...@@ -4345,210 +4388,242 @@
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>streamDelayEnable</sender> <sender>simpleOutAdvanced</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>label_56</receiver> <receiver>simpleOutEnforce</receiver>
<slot>setEnabled(bool)</slot> <slot>setVisible(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>503</x> <x>240</x>
<y>450</y> <y>46</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>269</x> <x>240</x>
<y>476</y> <y>45</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>streamDelayEnable</sender> <sender>systemTrayEnabled</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>streamDelayPreserve</receiver> <receiver>systemTrayWhenStarted</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>503</x> <x>730</x>
<y>450</y> <y>556</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>503</x> <x>746</x>
<y>499</y> <y>579</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>streamDelayEnable</sender> <sender>systemTrayEnabled</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>widget_12</receiver> <receiver>systemTrayAlways</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>503</x> <x>830</x>
<y>450</y> <y>556</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>503</x> <x>826</x>
<y>476</y> <y>602</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>simpleOutAdvanced</sender> <sender>enableNewSocketLoop</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>simpleOutEnforce</receiver> <receiver>enableLowLatencyMode</receiver>
<slot>setVisible(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>240</x> <x>403</x>
<y>46</y> <y>642</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>240</x> <x>403</x>
<y>45</y> <y>665</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>systemTrayEnabled</sender> <sender>snappingEnabled</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>systemTrayWhenStarted</receiver> <receiver>label_9</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>384</x> <x>733</x>
<y>559</y> <y>317</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>400</x> <x>347</x>
<y>585</y> <y>343</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>systemTrayEnabled</sender> <sender>snappingEnabled</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>systemTrayAlways</receiver> <receiver>snapDistance</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>484</x> <x>774</x>
<y>566</y> <y>317</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>480</x> <x>782</x>
<y>605</y> <y>343</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>snappingEnabled</sender> <sender>snappingEnabled</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>label_9</receiver> <receiver>screenSnapping</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>380</x> <x>820</x>
<y>322</y> <y>317</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>330</x> <x>837</x>
<y>350</y> <y>366</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>snappingEnabled</sender> <sender>snappingEnabled</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>snapDistance</receiver> <receiver>sourceSnapping</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>421</x> <x>881</x>
<y>325</y> <y>317</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>429</x> <x>890</x>
<y>346</y> <y>389</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>snappingEnabled</sender> <sender>snappingEnabled</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>screenSnapping</receiver> <receiver>centerSnapping</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>467</x> <x>928</x>
<y>325</y> <y>317</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>484</x> <x>915</x>
<y>378</y> <y>412</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>snappingEnabled</sender> <sender>recordWhenStreaming</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>sourceSnapping</receiver> <receiver>keepRecordStreamStops</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>528</x> <x>803</x>
<y>329</y> <y>199</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>537</x> <x>820</x>
<y>392</y> <y>222</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>snappingEnabled</sender> <sender>replayWhileStreaming</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>centerSnapping</receiver> <receiver>keepReplayStreamStops</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>575</x> <x>747</x>
<y>328</y> <y>245</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>562</x> <x>753</x>
<y>268</y>
</hint>
</hints>
</connection>
<connection>
<sender>streamDelayEnable</sender>
<signal>toggled(bool)</signal>
<receiver>label_56</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>431</x>
<y>422</y> <y>422</y>
</hint> </hint>
<hint type="destinationlabel">
<x>356</x>
<y>443</y>
</hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>recordWhenStreaming</sender> <sender>streamDelayEnable</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>keepRecordStreamStops</receiver> <receiver>streamDelaySec</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>457</x> <x>465</x>
<y>205</y> <y>420</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>474</x> <x>463</x>
<y>226</y> <y>447</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>replayWhileStreaming</sender> <sender>streamDelayEnable</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>keepReplayStreamStops</receiver> <receiver>streamDelayInfo</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>533</x>
<y>420</y>
</hint>
<hint type="destinationlabel">
<x>557</x>
<y>446</y>
</hint>
</hints>
</connection>
<connection>
<sender>streamDelayEnable</sender>
<signal>toggled(bool)</signal>
<receiver>streamDelayPreserve</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>401</x> <x>504</x>
<y>247</y> <y>420</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>407</x> <x>494</x>
<y>270</y> <y>465</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
......
...@@ -665,9 +665,17 @@ bool SimpleOutput::StartStreaming(obs_service_t *service) ...@@ -665,9 +665,17 @@ bool SimpleOutput::StartStreaming(obs_service_t *service)
"DelayPreserve"); "DelayPreserve");
const char *bindIP = config_get_string(main->Config(), "Output", const char *bindIP = config_get_string(main->Config(), "Output",
"BindIP"); "BindIP");
bool enableNewSocketLoop = config_get_bool(main->Config(), "Output",
"NewSocketLoopEnable");
bool enableLowLatencyMode = config_get_bool(main->Config(), "Output",
"LowLatencyEnable");
obs_data_t *settings = obs_data_create(); obs_data_t *settings = obs_data_create();
obs_data_set_string(settings, "bind_ip", bindIP); obs_data_set_string(settings, "bind_ip", bindIP);
obs_data_set_bool(settings, "new_socket_loop_enabled",
enableNewSocketLoop);
obs_data_set_bool(settings, "low_latency_mode_enabled",
enableLowLatencyMode);
obs_output_update(streamOutput, settings); obs_output_update(streamOutput, settings);
obs_data_release(settings); obs_data_release(settings);
...@@ -1314,9 +1322,17 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service) ...@@ -1314,9 +1322,17 @@ bool AdvancedOutput::StartStreaming(obs_service_t *service)
"DelayPreserve"); "DelayPreserve");
const char *bindIP = config_get_string(main->Config(), "Output", const char *bindIP = config_get_string(main->Config(), "Output",
"BindIP"); "BindIP");
bool enableNewSocketLoop = config_get_bool(main->Config(), "Output",
"NewSocketLoopEnable");
bool enableLowLatencyMode = config_get_bool(main->Config(), "Output",
"LowLatencyEnable");
obs_data_t *settings = obs_data_create(); obs_data_t *settings = obs_data_create();
obs_data_set_string(settings, "bind_ip", bindIP); obs_data_set_string(settings, "bind_ip", bindIP);
obs_data_set_bool(settings, "new_socket_loop_enabled",
enableNewSocketLoop);
obs_data_set_bool(settings, "low_latency_mode_enabled",
enableLowLatencyMode);
obs_output_update(streamOutput, settings); obs_output_update(streamOutput, settings);
obs_data_release(settings); obs_data_release(settings);
......
...@@ -1001,6 +1001,10 @@ bool OBSBasic::InitBasicConfigDefaults() ...@@ -1001,6 +1001,10 @@ bool OBSBasic::InitBasicConfigDefaults()
config_set_default_uint (basicConfig, "Output", "MaxRetries", 20); config_set_default_uint (basicConfig, "Output", "MaxRetries", 20);
config_set_default_string(basicConfig, "Output", "BindIP", "default"); config_set_default_string(basicConfig, "Output", "BindIP", "default");
config_set_default_bool (basicConfig, "Output", "NewSocketLoopEnable",
false);
config_set_default_bool (basicConfig, "Output", "LowLatencyEnable",
false);
int i = 0; int i = 0;
uint32_t scale_cx = cx; uint32_t scale_cx = cx;
......
...@@ -403,6 +403,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) ...@@ -403,6 +403,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
HookWidget(ui->reconnectMaxRetries, SCROLL_CHANGED, ADV_CHANGED); HookWidget(ui->reconnectMaxRetries, SCROLL_CHANGED, ADV_CHANGED);
HookWidget(ui->processPriority, COMBO_CHANGED, ADV_CHANGED); HookWidget(ui->processPriority, COMBO_CHANGED, ADV_CHANGED);
HookWidget(ui->bindToIP, COMBO_CHANGED, ADV_CHANGED); HookWidget(ui->bindToIP, COMBO_CHANGED, ADV_CHANGED);
HookWidget(ui->enableNewSocketLoop, CHECK_CHANGED, ADV_CHANGED);
HookWidget(ui->enableLowLatencyMode, CHECK_CHANGED, ADV_CHANGED);
#if !defined(_WIN32) && !defined(__APPLE__) #if !defined(_WIN32) && !defined(__APPLE__)
delete ui->monitoringDevice; delete ui->monitoringDevice;
...@@ -453,6 +455,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) ...@@ -453,6 +455,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
delete ui->processPriorityLabel; delete ui->processPriorityLabel;
delete ui->processPriority; delete ui->processPriority;
delete ui->advancedGeneralGroupBox; delete ui->advancedGeneralGroupBox;
delete ui->enableNewSocketLoop;
delete ui->enableLowLatencyMode;
ui->rendererLabel = nullptr; ui->rendererLabel = nullptr;
ui->renderer = nullptr; ui->renderer = nullptr;
ui->adapterLabel = nullptr; ui->adapterLabel = nullptr;
...@@ -460,6 +464,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) ...@@ -460,6 +464,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
ui->processPriorityLabel = nullptr; ui->processPriorityLabel = nullptr;
ui->processPriority = nullptr; ui->processPriority = nullptr;
ui->advancedGeneralGroupBox = nullptr; ui->advancedGeneralGroupBox = nullptr;
ui->enableNewSocketLoop = nullptr;
ui->enableLowLatencyMode = nullptr;
#endif #endif
#ifndef __APPLE__ #ifndef __APPLE__
...@@ -2004,6 +2010,7 @@ void OBSBasicSettings::LoadAdvancedSettings() ...@@ -2004,6 +2010,7 @@ void OBSBasicSettings::LoadAdvancedSettings()
ui->streamDelayPreserve->setChecked(preserveDelay); ui->streamDelayPreserve->setChecked(preserveDelay);
ui->streamDelayEnable->setChecked(enableDelay); ui->streamDelayEnable->setChecked(enableDelay);
SetComboByName(ui->colorFormat, videoColorFormat); SetComboByName(ui->colorFormat, videoColorFormat);
SetComboByName(ui->colorSpace, videoColorSpace); SetComboByName(ui->colorSpace, videoColorSpace);
SetComboByValue(ui->colorRange, videoColorRange); SetComboByValue(ui->colorRange, videoColorRange);
...@@ -2025,10 +2032,18 @@ void OBSBasicSettings::LoadAdvancedSettings() ...@@ -2025,10 +2032,18 @@ void OBSBasicSettings::LoadAdvancedSettings()
#elif _WIN32 #elif _WIN32
const char *processPriority = config_get_string(App()->GlobalConfig(), const char *processPriority = config_get_string(App()->GlobalConfig(),
"General", "ProcessPriority"); "General", "ProcessPriority");
bool enableNewSocketLoop = config_get_bool(main->Config(), "Output",
"NewSocketLoopEnable");
bool enableLowLatencyMode = config_get_bool(main->Config(), "Output",
"LowLatencyEnable");
idx = ui->processPriority->findData(processPriority); idx = ui->processPriority->findData(processPriority);
if (idx == -1) if (idx == -1)
idx = ui->processPriority->findData("Normal"); idx = ui->processPriority->findData("Normal");
ui->processPriority->setCurrentIndex(idx); ui->processPriority->setCurrentIndex(idx);
ui->enableNewSocketLoop->setChecked(enableNewSocketLoop);
ui->enableLowLatencyMode->setChecked(enableLowLatencyMode);
#endif #endif
loading = false; loading = false;
...@@ -2505,6 +2520,9 @@ void OBSBasicSettings::SaveAdvancedSettings() ...@@ -2505,6 +2520,9 @@ void OBSBasicSettings::SaveAdvancedSettings()
priority.c_str()); priority.c_str());
if (main->Active()) if (main->Active())
SetProcessPriority(priority.c_str()); SetProcessPriority(priority.c_str());
SaveCheckBox(ui->enableNewSocketLoop, "Output", "NewSocketLoopEnable");
SaveCheckBox(ui->enableLowLatencyMode, "Output", "LowLatencyEnable");
#endif #endif
#ifdef __APPLE__ #ifdef __APPLE__
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册