Dispose Elements in Dynamic Pipeline Question

Bo-Kai Huang lightbulb01 at gmail.com
Thu Apr 21 06:48:31 UTC 2022


Hello all,



I am trying a program with a dynamic pipeline.

In this program, an appsink data branch will be linked and unlinked to the
tee dynamically.

The pipeline looks like:

                                                              /  queue ---
fakesink

videotestsrc --- x264enc --- tee ---

                                                              \  queue ---
appsink



At the beginning of the program, there is only the fakesink data branch.

Then another thread is created and does the following process periodically:

1. If the appsink branch is not linked, the thread will create elements and
link them to the tee.

2. If the appsink branch is linked, the thread will unlink them from the
tee and release elements.



When unlinking the appsink branch, I set the queue and appsink to
GST_STATE_NULL before removing them from the pipeline:

gst_element_set_state(queue_appsink, GST_STATE_NULL);

gst_element_set_state(appsink, GST_STATE_NULL);

gst_bin_remove_many(GST_BIN(pipeline), queue_appsink, appsink, NULL);



However, GStreamer complains the states of elements are not NULL when
disposing them randomly…

e.g.:

Trying to dispose element queue10, but it is in PLAYING instead of the NULL
state.

Trying to dispose element appsink9, but it is in READY instead of the NULL
state.


This example  can be run and reproduce this problem:
https://dci2l49av9uew.cloudfront.net/gst_test.cpp


Would anyone help to figure out how I can fix this problem?

Thanks for your help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220421/92ef0db8/attachment-0001.htm>


More information about the gstreamer-devel mailing list