static_cast<GstElement *>(data);
const auto sink_pad = gst_element_get_static_pad(decodebin_ref, "sink");
if (gst_pad_link(src_pad, sink_pad) != GST_PAD_LINK_OK)
{
std::cerr << "Failed to link source to decodebin" << std::endl;
}
gst_object_unref(sink_pad);
}),
decodebin);
// Dynamic pad linking for decodebin -> videoconvert
// ReSharper disable once CppParameterMayBeConst
g_signal_connect(decodebin, "pad-added", G_CALLBACK(+[]([[maybe_unused]] GstElement *src, GstPad *new_pad, gpointer data)
{
const auto videoconvert_ref = static_cast<GstElement *>(data);
if (g_str_has_prefix(GST_PAD_NAME(new_pad), "src"))
{
const auto sink_pad = gst_element_get_static_pad(videoconvert_ref, "sink");
if (gst_pad_link(new_pad, sink_pad) != GST_PAD_LINK_OK)
{
std::cerr << "Failed to link decodebin to videoconvert" << std::endl;
}
gst_object_unref(sink_pad);
}
}),
videoconvert);
gst_element_link(videoconvert, x264enc);
gst_element_link(x264enc, h264parse);
gst_element_link(h264parse, rtph264pay);
gst_element_link(rtph264pay, tee);
gst_element_link(fakeQueue, fakesink);
gst_element_link(tee, fakeQueue);
```
Please, if someone know what I'm doing wrong or how can I fix it, this issue is consuming a lot of time and I don't know what to do :')
https://redd.it/1puw1xi
@r_cpp
Post #24567
21