linking error when compositor/glvidemixer connected to videoscale with caps
The following code sometimes causes an error: "pausing after gst_pad_push() = not-linked". ~5-10% fail chance.
Without "compositor" everything works fine.
Ubuntu 20.04, gstreamer 1.16.2 and current master (gst-uninstaled).
Build using: libtool --mode=link gcc `pkg-config --cflags --libs gstreamer-1.0` -o myprog main.cpp
main.cpp GST_DEBUG_6_log.txt
#include <thread>
#include <gst/gst.h>
GstPadProbeReturn callback(GstPad* srcpad, GstPadProbeInfo* info, void* pipe){
gst_pad_remove_probe (srcpad, GST_PAD_PROBE_INFO_ID (info));
GstElement* identity = gst_element_factory_make("identity", nullptr);
gst_object_ref(identity);
gst_bin_add(GST_BIN(pipe), identity);
gst_element_sync_state_with_parent(identity);
GstPad* sink = gst_pad_get_peer(srcpad);
gst_pad_unlink(srcpad, sink);
GstPad* identity_sink = gst_element_get_static_pad(identity, "sink");
GstPad* identity_src = gst_element_get_static_pad(identity, "src");
gst_pad_link(identity_src, sink);
gst_pad_link(srcpad, identity_sink);
return GST_PAD_PROBE_REMOVE;
}
int main()
{
gst_init(nullptr, nullptr);
GstElement* video_pipe = gst_parse_launch("videotestsrc is-live=true ! video/x-raw,width=500,height=500 ! videoscale ! video/x-raw,width=200,height=200 ! compositor ! ximagesink", NULL);
gst_element_set_state(video_pipe, GST_STATE_PLAYING);
std::this_thread::sleep_for(std::chrono::seconds(2));
GstElement* capsfilter = gst_bin_get_by_name(GST_BIN(video_pipe), "capsfilter0");
GstPad* src = gst_element_get_static_pad(capsfilter, "src");
gst_pad_add_probe(src, GST_PAD_PROBE_TYPE_IDLE, callback, video_pipe, nullptr);
std::this_thread::sleep_for(std::chrono::seconds(2));
}