Added Stream Discoverer to detect frame size from a gstreamer pipeline

Previous use of Stream are not affected (the discoverer is passively returning the given width and height). But if the Stream is created without dimensions, it will run a discoverer to try to get preroll frames and detect width and height from there.
This commit is contained in:
Bruno Herbelin
2021-12-30 00:15:43 +01:00
parent bc540044ac
commit 033d41863a
5 changed files with 153 additions and 19 deletions

View File

@@ -5819,13 +5819,24 @@ void ShowSandbox(bool* p_open)
ImGui::Separator();
static char buf1[1280] = "videotestsrc pattern=smpte";
static Source *tmp = nullptr;
// static char buf1[1280] = "videotestsrc pattern=smpte";
// static char buf1[1280] = "udpsrc port=5000 buffer-size=200000 ! h264parse ! avdec_h264";
static char buf1[1280] = "srtsrc uri=\"srt://192.168.0.37:5000?mode=listener\" ! decodebin ";
ImGui::InputText("gstreamer pipeline", buf1, 1280);
if (ImGui::Button("Create Generic Stream Source") )
{
Mixer::manager().addSource(Mixer::manager().createSourceStream(buf1));
tmp = Mixer::manager().createSourceStream(buf1);
Mixer::manager().addSource( tmp );
}
ImGui::SameLine();
if ( tmp && ImGui::Button("delete") )
{
Mixer::manager().deleteSource( tmp );
tmp = nullptr;
}
ImGui::Separator();
static char str[128] = "";
ImGui::InputText("Command", str, IM_ARRAYSIZE(str));
if ( ImGui::Button("Execute") )