int max_input_queue_frames = 6;
int http_port = DEFAULT_HTTPD_PORT;
int srt_port = DEFAULT_SRT_PORT; // -1 for none.
+ bool enable_srt = true; // UI toggle; not settable from the command line. See also srt_port.
bool display_timecode_in_stream = false;
bool display_timecode_on_stdout = false;
bool enable_quick_cut_keys = false;
global_flags.enable_quick_cut_keys = ui->quick_cut_enable_action->isChecked();
});
+#if HAVE_SRT
+ if (global_flags.srt_port >= 0) {
+ char title[256];
+ snprintf(title, sizeof(title), "Accept new SRT connections on port %d", global_flags.srt_port);
+ ui->srt_enable_action->setChecked(true);
+ ui->srt_enable_action->setText(title);
+ connect(ui->srt_enable_action, &QAction::changed, [this](){
+ global_flags.enable_srt = ui->srt_enable_action->isChecked();
+ });
+ } else {
+ ui->srt_enable_action->setChecked(false);
+ ui->srt_enable_action->setEnabled(false);
+ ui->srt_enable_action->setText("Accept new SRT connections");
+ }
+#else
+ ui->srt_enable_action->setChecked(false);
+ ui->srt_enable_action->setEnabled(false);
+ ui->srt_enable_action->setText("Accept new SRT connections");
+#endif
+
last_audio_level_callback = steady_clock::now() - seconds(1);
if (!global_flags.midi_mapping_filename.empty()) {
<addaction name="hdmi_sdi_output_resolution_menu"/>
<addaction name="display_timecode_menu"/>
<addaction name="quick_cut_enable_action"/>
+ <addaction name="srt_enable_action"/>
<addaction name="exit_action"/>
</widget>
<widget class="QMenu" name="menu_Help">
<string>Enable &quick-cut keys (Q, W, E, etc.)</string>
</property>
</action>
+ <action name="srt_enable_action">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Accept new SRT connections on port 9710</string>
+ </property>
+ </action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
}
break;
}
+ if (!global_flags.enable_srt) { // Runtime UI toggle.
+ // Perhaps not as good as never listening in the first place,
+ // but much simpler to turn on and off.
+ srt_close(clientsock);
+ continue;
+ }
lock_guard<mutex> lock(hotplug_mutex);
hotplugged_srt_cards.push_back(clientsock);
}