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