[gst-devel] partially flushing branch of pipeline

Marc Leeman marc.leeman at gmail.com
Fri Nov 20 15:28:00 CET 2009


I am creating an application that has net-in, net-out; it does some
transformations on on packaging and partial transcoding.

I'd like to add an add on that does 'sampling', recodes it and sends it
back out. Basically converting a continuous slideshow.

The input stream format is unknown, so using decodebin with a callback
to new-decoded-pad provides a nice way of implicitly triggering on the
first encountered I-frame.

The catch is that I cannot afford letting decodebin run continously; I
need to disable it as soon as possible to minimise the overhead.

I set up the following system that works (kindof).

+---------+ +-------+ +-----+   +------+ +-------+
|  udpsrc |-| demux |-| tee |-+-|rtppay|-|udpsink|
+---------+ +-------+ +-----+ | +------+ +-------+
                              |
                              | +-----------------+   +-----------+ +---------+ +---------+ 
                              +-| output-selector |-+-| decodebin |-| jpegenc |-| udpsink |
                                +-----------------+ | +-----------+ +---------+ +---------+
                                                    |
                                                    | +----------+
                                                    +-| fakesink |
                                                      +----------+

I add an output-selector to a decodebin; from the moment I get an
encoded-frame (jpegenc); I toggle the output from the selector to a
fakesink.

The overhead is minimal. Unfortunately; I seem to have an issue with the
buffers in decodebin.

The first image is always perfect; but it start being corrupted since the
decoder keeps working on the old data (combining data from before the
select switch and the re-connection of it to the decodebin). The effect
is, dependent on the stream; that one image is good and a number
afterwards are corrupt.

Basically, before reconnnecting the data feed to the decodebin; I would
need to send a signal to the sink pad of decode bin; that all currently
stored data should be discarted; just as it did with the first image
creation.

I have experimented with flushing and resetting timestamps; but in that
case; at least the way I've tried it; either my pipeline stalls or the
RTP packets get corrupted in the top branch.

The top branch really is the most important one and should not be
affected by operations on the bottom branches of the pipeline.

Does anyone have feedback on how to tackle this and possibly an example
of a module that works in similar ways.

-- 
  greetz, marc
The universe is all a spin-off of the Big Bang.
crichton 2.6.26 #1 PREEMPT Tue Jul 29 21:17:59 CDT 2008 GNU/Linux
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20091120/786e9dd1/attachment.pgp>


More information about the gstreamer-devel mailing list