BUG: dynamic element addition and deletion are not working
I have a problem with a video saving pipeline. We want to add an RTP sending bin to the pipeline, then later remove it. The pipeline while saving: | v4lsrc | --- | encoder | --- | tee | --- | saving bin |
The RTP sending bin is connected to the tee. Both the saving and RTP sending bins contain queue.
We are trying the addition the following way: 1. Put the pipeline to State1 2. Add the bin to the pipeline.
3. Link the bin to the tee 4. Put the pipeline to the PLAYING state.
The way of deletion: 1. Put the pipeline to State2 2. Unlink the bin from the tee. 3. Release the tee's request pad 4. Remove the bin from the pipeline
5. Set the bin's state to NULL 6. Unref the bin. 7. Set the state of the pipeline back to PLAYING
I'm not sure what should State1 and State2 be.
If I use READY the mux fails: avimux and matroskamux dies with Gstreamer-critical error when the pipeline is returned to PLAYING state, ffmux_mp4 simply stops saving.
If I use PAUSED state at the addition case, the pipeline sometimes stuck in ASYNC state when tries to return to playing. At the deletion case if I use individual elements instead of a single bin, the call to put the elements to NULL state not returns. If I use bin, changing to NULL state works.
In the projects there are much more complex pipelines. The common problem is the addition and deletion elements. All additions and deletions are performed at a tee.
My questions are: What should State1 and State2 be? If it is READY how can I manage to keep the saving working?
Are the lists above correct or I do something wrong?