[gst-devel] chain function - pad_push different contexts

Arnout Vandecappelle arnout at mind.be
Fri Jul 3 09:50:23 CEST 2009


On Thursday 02 July 2009 09:24:26 Mattias Barthel wrote:
> Hi,
>
> I would like to implement an element (encoder) that calls two methods,
> send and recv, from its chain function.
> Now, there is a inconsistency between the number of times each method
> needs to be called.
> So they need to be called from different threads I believe.
>
> I would like to call send from chain function and then pad_push from
> another thread.

 Not necessarily - in the chain function, you could loop over the recv calls 
and several buffers.  Or you can skip the recv and not send anything.  I 
don't see much point in creating an additional thread.  Of course, if the 
underlying encoder library runs in a separate thread anyway, that's another 
issue.  But then it probably has a callback function, and you can call 
pad_push from there.


> Is there some constraints against doing something like that in a
> gstreamer element?

 You could look at the queue and queue2 elements - they spawn a new thread to 
push buffers out.

 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  D206 D44B 5155 DF98 550D  3F2A 2213 88AA A1C7 C933




More information about the gstreamer-devel mailing list