]> code.delx.au - pulseaudio/blob - src/pulsecore/pstream.h
5900eceabb5eba887d3fc195688c091545ea0f96
[pulseaudio] / src / pulsecore / pstream.h
1 #ifndef foopstreamhfoo
2 #define foopstreamhfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of PulseAudio.
8
9 Copyright 2004-2006 Lennart Poettering
10 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
11
12 PulseAudio is free software; you can redistribute it and/or modify
13 it under the terms of the GNU Lesser General Public License as
14 published by the Free Software Foundation; either version 2.1 of the
15 License, or (at your option) any later version.
16
17 PulseAudio is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
21
22 You should have received a copy of the GNU Lesser General Public
23 License along with PulseAudio; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 USA.
26 ***/
27
28 #include <inttypes.h>
29
30 #include <pulse/mainloop-api.h>
31 #include <pulse/def.h>
32
33 #include <pulsecore/packet.h>
34 #include <pulsecore/memblock.h>
35 #include <pulsecore/iochannel.h>
36 #include <pulsecore/memchunk.h>
37 #include <pulsecore/creds.h>
38
39 typedef struct pa_pstream pa_pstream;
40
41 typedef void (*pa_pstream_packet_cb_t)(pa_pstream *p, pa_packet *packet, const pa_creds *creds, void *userdata);
42 typedef void (*pa_pstream_memblock_cb_t)(pa_pstream *p, uint32_t channel, int64_t offset, pa_seek_mode_t seek, const pa_memchunk *chunk, void *userdata);
43 typedef void (*pa_pstream_notify_cb_t)(pa_pstream *p, void *userdata);
44
45 pa_pstream* pa_pstream_new(pa_mainloop_api *m, pa_iochannel *io, pa_mempool *p);
46 void pa_pstream_unref(pa_pstream*p);
47 pa_pstream* pa_pstream_ref(pa_pstream*p);
48
49 void pa_pstream_send_packet(pa_pstream*p, pa_packet *packet, const pa_creds *creds);
50 void pa_pstream_send_memblock(pa_pstream*p, uint32_t channel, int64_t offset, pa_seek_mode_t seek, const pa_memchunk *chunk);
51
52 void pa_pstream_set_recieve_packet_callback(pa_pstream *p, pa_pstream_packet_cb_t cb, void *userdata);
53 void pa_pstream_set_recieve_memblock_callback(pa_pstream *p, pa_pstream_memblock_cb_t cb, void *userdata);
54 void pa_pstream_set_drain_callback(pa_pstream *p, pa_pstream_notify_cb_t cb, void *userdata);
55
56 void pa_pstream_set_die_callback(pa_pstream *p, pa_pstream_notify_cb_t cb, void *userdata);
57
58 int pa_pstream_is_pending(pa_pstream *p);
59
60 void pa_pstream_use_shm(pa_pstream *p, int enable);
61
62 void pa_pstream_close(pa_pstream *p);
63
64 #endif