[pulseaudio-discuss] Example using async API

Lennart Poettering lennart at poettering.net
Fri Oct 2 01:21:10 PDT 2009


On Thu, 01.10.09 23:29, Peter Onion (Peter.Onion at btinternet.com) wrote:

> 
> On Wed, 2009-09-30 at 21:18 +0100, Peter Onion wrote:
> > I've been looking at the tests in the source distribution to get some
> > more ideas on how things fit together.
> > 
> > BUT, I still can't figure out how to use the threaded mainloop.  There
> > are some examples of using bits of it, but at the moment I can't see how
> > to put them together in a coherent way.
> 
> After some more study of the gstreamer pulse plugin sources things have
> started to fall into place.
> 
> A question for Lennart...  
> 
> In the gstreamer plugin the write callback just calls
> pa_threaded_mainloop_signal() and the data is written from the other
> thread.
> 
> Is it OK to actually call pa_stream_write() in the callback if the
> sample data is to hand ?

Yes, absolutely. In fact this is actually the intended way. Doing
things indirectly by synching with things like p_t_m_signal() should
only be done if it really doesn't make sense to do it otherwise.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list