TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 229 subscribers
Post #24567 21
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
Reddit From the cpp community on Reddit Explore this post and more from the cpp community
More from @r_cpp
  1. Oct 8, 2026Profiles for simplicity and guarantees - Bjarne Stroustrup - CppCon 2026 https://youtu.be/…
  2. Oct 8, 2026How to Fix autoconf-style Configuration Probing https://build2.org/blog/fix-autoconf.xhtml…
  3. Oct 8, 2026owl – a header-only C++23 HTTP framework where route patterns and handler extractors are c…
  4. Oct 8, 2026Removed by Reddit Removed by Reddit on account of violating the [content policy. ] https:/…
  5. Oct 8, 2026Is there a way to search across all P and N papers throughout standardization history? It…
  6. Oct 8, 2026CppCast Episode 412 : Safety and Interoperability with Rust and C++ https://cppcast.com/sa…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →