mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-17 05:09:58 +01:00
Disable Broardast and inform user if SRT not available
This commit is contained in:
@@ -7623,26 +7623,28 @@ void Navigator::RenderMainPannelSettings()
|
|||||||
//
|
//
|
||||||
ImGui::Text("Stream");
|
ImGui::Text("Stream");
|
||||||
|
|
||||||
char msg[256];
|
if (VideoBroadcast::available()) {
|
||||||
ImFormatString(msg, IM_ARRAYSIZE(msg), "Broadcast SRT\n\n"
|
char msg[256];
|
||||||
"vimix is listening to SRT requests on Port %d. "
|
ImFormatString(msg, IM_ARRAYSIZE(msg), "Broadcast SRT\n\n"
|
||||||
"Example network addresses to call:\n"
|
"vimix is listening to SRT requests on Port %d. "
|
||||||
" srt//%s:%d (localhost)\n"
|
"Example network addresses to call:\n"
|
||||||
" srt//%s:%d (local IP)",
|
" srt//%s:%d (localhost)\n"
|
||||||
Settings::application.broadcast_port,
|
" srt//%s:%d (local IP)",
|
||||||
NetworkToolkit::host_ips()[0].c_str(), Settings::application.broadcast_port,
|
Settings::application.broadcast_port,
|
||||||
NetworkToolkit::host_ips()[1].c_str(), Settings::application.broadcast_port );
|
NetworkToolkit::host_ips()[0].c_str(), Settings::application.broadcast_port,
|
||||||
|
NetworkToolkit::host_ips()[1].c_str(), Settings::application.broadcast_port );
|
||||||
|
|
||||||
ImGuiToolkit::Indication(msg, ICON_FA_PODCAST);
|
ImGuiToolkit::Indication(msg, ICON_FA_PODCAST);
|
||||||
ImGui::SameLine(0);
|
ImGui::SameLine(0);
|
||||||
ImGui::SetCursorPosX(-1.f * IMGUI_RIGHT_ALIGN);
|
ImGui::SetCursorPosX(-1.f * IMGUI_RIGHT_ALIGN);
|
||||||
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
|
||||||
char bufport[7] = "";
|
char bufport[7] = "";
|
||||||
sprintf(bufport, "%d", Settings::application.broadcast_port);
|
sprintf(bufport, "%d", Settings::application.broadcast_port);
|
||||||
ImGui::InputTextWithHint("Broadcast", "7070", bufport, 6, ImGuiInputTextFlags_CharsDecimal);
|
ImGui::InputTextWithHint("Broadcast", "7070", bufport, 6, ImGuiInputTextFlags_CharsDecimal);
|
||||||
if (ImGui::IsItemDeactivatedAfterEdit()){
|
if (ImGui::IsItemDeactivatedAfterEdit()){
|
||||||
if ( BaseToolkit::is_a_number(bufport, &Settings::application.broadcast_port))
|
if ( BaseToolkit::is_a_number(bufport, &Settings::application.broadcast_port))
|
||||||
Settings::application.broadcast_port = CLAMP(Settings::application.broadcast_port, 1029, 49150);
|
Settings::application.broadcast_port = CLAMP(Settings::application.broadcast_port, 1029, 49150);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGuiToolkit::Indication("Share on local network\n\n"
|
ImGuiToolkit::Indication("Share on local network\n\n"
|
||||||
@@ -7658,6 +7660,7 @@ void Navigator::RenderMainPannelSettings()
|
|||||||
ImGuiToolkit::Spacing();
|
ImGuiToolkit::Spacing();
|
||||||
ImGui::Text("OSC");
|
ImGui::Text("OSC");
|
||||||
|
|
||||||
|
char msg[256];
|
||||||
ImFormatString(msg, IM_ARRAYSIZE(msg), "Open Sound Control\n\n"
|
ImFormatString(msg, IM_ARRAYSIZE(msg), "Open Sound Control\n\n"
|
||||||
"vimix accepts OSC messages sent by UDP on Port %d and replies on Port %d."
|
"vimix accepts OSC messages sent by UDP on Port %d and replies on Port %d."
|
||||||
"Example network addresses:\n"
|
"Example network addresses:\n"
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ std::string VideoBroadcast::srt_sink_;
|
|||||||
std::string VideoBroadcast::h264_encoder_;
|
std::string VideoBroadcast::h264_encoder_;
|
||||||
|
|
||||||
std::vector< std::pair<std::string, std::string> > pipeline_sink_ {
|
std::vector< std::pair<std::string, std::string> > pipeline_sink_ {
|
||||||
{"srtsink", "srtsink uri=srt://:XXXX name=sink"},
|
{"srtsin", "srtsink uri=srt://:XXXX name=sink"},
|
||||||
{"srtserversink", "srtserversink uri=srt://:XXXX name=sink"}
|
{"srtserversin", "srtserversink uri=srt://:XXXX name=sink"}
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector< std::pair<std::string, std::string> > pipeline_encoder_ {
|
std::vector< std::pair<std::string, std::string> > pipeline_encoder_ {
|
||||||
@@ -38,6 +38,8 @@ bool VideoBroadcast::available()
|
|||||||
static bool _tested = false;
|
static bool _tested = false;
|
||||||
if (!_tested) {
|
if (!_tested) {
|
||||||
srt_sink_.clear();
|
srt_sink_.clear();
|
||||||
|
h264_encoder_.clear();
|
||||||
|
|
||||||
for (auto config = pipeline_sink_.cbegin();
|
for (auto config = pipeline_sink_.cbegin();
|
||||||
config != pipeline_sink_.cend() && srt_sink_.empty(); ++config) {
|
config != pipeline_sink_.cend() && srt_sink_.empty(); ++config) {
|
||||||
if ( GstToolkit::has_feature(config->first) ) {
|
if ( GstToolkit::has_feature(config->first) ) {
|
||||||
@@ -45,15 +47,19 @@ bool VideoBroadcast::available()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h264_encoder_.clear();
|
if (!srt_sink_.empty())
|
||||||
for (auto config = pipeline_encoder_.cbegin();
|
{
|
||||||
config != pipeline_encoder_.cend() && h264_encoder_.empty(); ++config) {
|
for (auto config = pipeline_encoder_.cbegin();
|
||||||
if ( GstToolkit::has_feature(config->first) ) {
|
config != pipeline_encoder_.cend() && h264_encoder_.empty(); ++config) {
|
||||||
h264_encoder_ = config->second;
|
if ( GstToolkit::has_feature(config->first) ) {
|
||||||
if (config->first != pipeline_encoder_.back().first)
|
h264_encoder_ = config->second;
|
||||||
Log::Info("Video Broadcast uses hardware-accelerated encoder (%s)", config->first.c_str());
|
if (config->first != pipeline_encoder_.back().first)
|
||||||
|
Log::Info("Video Broadcast uses hardware-accelerated encoder (%s)", config->first.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
Log::Info("Video SRT Broadcast not available.");
|
||||||
|
|
||||||
// perform test only once
|
// perform test only once
|
||||||
_tested = true;
|
_tested = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user