multiple source pads in one thread

Sergey Mironov ierton at gmail.com
Wed Apr 6 05:46:49 PDT 2011


Hello! I'm writing a dvb-source element capabale of working with
specific hardware DVB demuxer (PES filter). In it's basic mode, the
element has to open 2 devices, read them repeatedly and pass the data
to video and audio srcpads. In general, I use guidelines from [1].

Algorithm is following:

1. start one GstTask to poll both devices
2. wait for the data to arrive
3. if it's a first data pack, send NEWSEGMENT to both pads
4. send the data to corresponding pad
5. goto 2

To try this out, I wrote simple test

gst-launch <.debug flags>\
     mdemuxsrc adapter=0 name=s \
     s.vsrc ! filesink location=$OUT1 name=vsink \
     s.asrc ! filesink location=$OUT2 name=asink \
     2>&1 | tee $LOG

hoping to get two PES streams in separate files. As it turns out (seel
log [2]), first filesink is blocking the pipeline and stopping the
task. And if I comment out, say, second filesink, test will succeed.
As I understand, thats because of some kind of synchronization applied
by the core. Is it possible to turn it out? Basically, I want 2
independent data streams for now. Or maybe gstreamer doesn't support
threads driving more than 1 pad?

Thanks in advance.
Sergey.

[1] - http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-live-source.txt
[2] - http://pastebin.com/raw.php?i=PpPnPWaj
it is a tail of log, starting at the moment of first data arrival.


More information about the gstreamer-devel mailing list