DarenW
DarenW

Reputation: 16906

How to change a GStreamer pipeline's topology during runtime?

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

Answers (1)

Florian Zwoch
Florian Zwoch

Reputation: 7373

Back in 2016 at the GStreamer conference I heard a talk about this topic which felt quite useful in this context.

Slides: https://gstreamer.freedesktop.org/data/events/gstreamer-conference/2016/Jose%20A.%20Santos%20-%20How%20to%20work%20with%20dynamic%20pipelines%20using%20GStreamer.pdf

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

Related Questions