pstream: Allow reading/writing through srbchannel

For writing, we prefer writing through the srbchannel if one is available,
and we have no ancil data to send.

For reading, we support reading from both in parallel. This meant replicating
a struct used for reading, so a lot of this patch is just a search/replace in
do_read to use the appropriate channel for reading.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
David Henningsson 2014-04-25 16:58:03 +02:00
parent b06e616525
commit 4931637f82
2 changed files with 158 additions and 77 deletions

View file

@ -31,6 +31,7 @@
#include <pulsecore/packet.h>
#include <pulsecore/memblock.h>
#include <pulsecore/iochannel.h>
#include <pulsecore/srbchannel.h>
#include <pulsecore/memchunk.h>
#include <pulsecore/creds.h>
#include <pulsecore/macro.h>
@ -66,4 +67,8 @@ bool pa_pstream_is_pending(pa_pstream *p);
void pa_pstream_enable_shm(pa_pstream *p, bool enable);
bool pa_pstream_get_shm(pa_pstream *p);
/* Enables shared ringbuffer channel. Note that the srbchannel is now owned by the pstream.
Setting srb to NULL will free any existing srbchannel. */
void pa_pstream_set_srbchannel(pa_pstream *p, pa_srbchannel *srb);
#endif