[gst-devel] a stupid question
Leif Johnson
leif at ambient.2y.net
Tue Mar 18 10:49:20 CET 2003
Hi Thomas -
>I would think that it would be best to create an element (say, "buffer" or
>"delay") that based on the caps/time properties would be able to figure
>out how many buffers it should hold. This element would not output
>anything until it's buffer is completely full, then output buffers from
>that internal buffer at the same speed they're coming in. Would this work
>without threads if the element itself has the logic to output zero buffers
>in it's chain function ?
This sounds a lot like the (only) filter I've written : playondemand. I
hate to use my own code as an example (particularly because it's kind of a
poor example), but it might help for inspiration. :)
So far it's been working fine for me, but I recently screwed around a bit
with it and at the moment the output's borked ...
>[snipped from above] I would want to make the prerecord buffer a given
>size in audio duration.
The playondemand element has a 'buffer-time' or similar property,
specifiable in seconds. It uses the rate and other caps information to set
the actual length of the internal buffer in bytes.
Actually, now that I think of it, you might be able to add a 'buffer-full'
signal to the playondemand element, and then when your app receives it, the
app could send the playondemand element a 'play' signal. Just thinking off
the top of my head.
Cheers,
leif
--
Leif Morgan Johnson . http://ambient.2y.net/leif/
IAESTE trainee . http://www.iaeste.org/
Salomon Automation . http://www.salomon.at/
More information about the gstreamer-devel
mailing list