Set NULL state to queue results in deadlock
I am working on the attached pipeline created using the Python interface for Gstreamer. The pipeline uses some plugins from Nvidia Deepstream, but I believe the issue I am having in unrelated.
In brief: the pipeline ingests some rtsp video streams, put them into a leaky queue, and then it sends the frames to some Deepstream custom plugins that will run some AI models on them (but I suspect Deepstream plugins are probably not important for this issue).
Sometime I need to stop processing a video frame. Therefore, I want to remove the elements in charge of processing the stream. Suppose I want to stop stream number 50
(first row in the pipeline attached). I'll start by setting its elements' state to NULL
. What I do is the following:
- I set to
NULL
the state of theGstBin
calledsource-bin-50
(see pipeline). This bin contains the elements that decode the rtsp video stream. - I set to
NULL
the state of thequeue
calledframe_queue_50
. The problem is that this sometime results in a deadlock during the theset_state
function.
I read online that the issue could be caused by the queue still having some content and therefore not willing to move to NULL
state. However, as of now, I haven't found a solution. Should I send any signal to the queue
?