]> code.delx.au - pulseaudio/blob - polyp/sink-input.h
new features:
[pulseaudio] / polyp / sink-input.h
1 #ifndef foosinkinputhfoo
2 #define foosinkinputhfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of polypaudio.
8
9 polypaudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published
11 by the Free Software Foundation; either version 2 of the License,
12 or (at your option) any later version.
13
14 polypaudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with polypaudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
23 ***/
24
25 #include <inttypes.h>
26
27 #include "sink.h"
28 #include "sample.h"
29 #include "memblockq.h"
30 #include "resampler.h"
31 #include "module.h"
32 #include "client.h"
33
34 struct pa_sink_input {
35 uint32_t index;
36
37 int corked;
38
39 char *name;
40 struct pa_module *owner;
41 struct pa_client *client;
42 struct pa_sink *sink;
43 struct pa_sample_spec sample_spec;
44 uint32_t volume;
45
46 int (*peek) (struct pa_sink_input *i, struct pa_memchunk *chunk);
47 void (*drop) (struct pa_sink_input *i, const struct pa_memchunk *chunk, size_t length);
48 void (*kill) (struct pa_sink_input *i);
49 uint32_t (*get_latency) (struct pa_sink_input *i);
50
51 void *userdata;
52
53 struct pa_memchunk resampled_chunk;
54 struct pa_resampler *resampler;
55 };
56
57 struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, const struct pa_sample_spec *spec);
58 void pa_sink_input_free(struct pa_sink_input* i);
59
60 /* Code that didn't create the input stream should call this function to
61 * request destruction of it */
62 void pa_sink_input_kill(struct pa_sink_input *i);
63
64 uint32_t pa_sink_input_get_latency(struct pa_sink_input *i);
65
66 int pa_sink_input_peek(struct pa_sink_input *i, struct pa_memchunk *chunk);
67 void pa_sink_input_drop(struct pa_sink_input *i, const struct pa_memchunk *chunk, size_t length);
68
69 void pa_sink_input_set_volume(struct pa_sink_input *i, pa_volume_t volume);
70
71 void pa_sink_input_cork(struct pa_sink_input *i, int b);
72
73 #endif