[example] A bin with tee and queues on srcpads
Andrey Utkin
andrey.krieger.utkin at gmail.com
Thu Jan 2 10:30:13 PST 2014
Hi devs, it's again me with my dynamic unlinking issues.
This time i have for you something special, not questions or help
requests, but a ready and working code example! Of course, it may be
not ideal.
I have made a sketch app using a GstBin-subclass which should behave
like a GstTee element, except the fact that each its sourcepad has its
GstQueue inside, so consuming pipeline branches process independently.
The element is named "tq" (GstTq) for "tee (t) + queue (q)".
Sources: https://github.com/krieger-od/gst_tq
How it works:
>From app context, we set a BLOCK probe callback to tq sourcepad, and
calling gst_element_release_request_pad() on it.
Inside gst_tq_release_pad() we have to do the following:
- remove bin's srcpad
- release GstTee srcpad - obviously also from probe callback;
- remove GstQueue.
Currently i do in in such way:
- unlink bin srcpad (a ghostpad) from queue srcpad
- remove bin srcpad
- setup a probe callback on tee srcpad and wait for its success
(waiting is just in case currently)
The last probe callback does this:
- release GstTee srcpad
- set related GstQueue to NULL state and remove it from bin
I would be grateful if more experienced developers check my code and
comment it, especially regarding bugs/misconceptions.
Another idea is inclusion of GstTq to some repo, maybe gst-plugins-ugliest :)
--
Andrey Utkin
More information about the gstreamer-devel
mailing list