Reputation: 16906
I have a GStreamer pipeline whose topology is changed on occasion. What we do is:
gst_element_set_state(pipeline, GST_STATE_READY);
gst_element_unlink(node1, tee);
gst_element_link(node1, oldfilm);
gst_element_link(oldfilm, tee);
gst_element_set_state(pipeline, GST_STATE_PLAYING);
We assume the pipeline must be stopped while elements are re-connected. Problem: Our app hangs, typically video stops streaming after the first few times we change topology, and then the next call to gst_element_set_state(pipeline, GST_STATE_PLAYING) never returns. The app still responds to ^C, which of course kills it.
We conclude we are not doing this right. What is the right way to alter pipeline topology while the application is running?
Upvotes: 0
Views: 818
Reputation: 7373
Back in 2016 at the GStreamer conference I heard a talk about this topic which felt quite useful in this context.
Talk: https://gstconf.ubicast.tv/videos/how-to-work-dynamic-pipelines/
I hope this explains how to work with these type of problems.
Upvotes: 2