]> code.delx.au - pulseaudio/blob - src/sinkinput.h
implement parec-simple and matching simple recording API
[pulseaudio] / src / sinkinput.h
1 #ifndef foosinkinputhfoo
2 #define foosinkinputhfoo
3
4 #include <inttypes.h>
5
6 #include "sink.h"
7 #include "sample.h"
8 #include "memblockq.h"
9 #include "resampler.h"
10
11 struct pa_sink_input {
12 uint32_t index;
13
14 char *name;
15 struct pa_sink *sink;
16 struct pa_sample_spec sample_spec;
17 uint32_t volume;
18
19 int (*peek) (struct pa_sink_input *i, struct pa_memchunk *chunk);
20 void (*drop) (struct pa_sink_input *i, size_t length);
21 void (*kill) (struct pa_sink_input *i);
22 uint32_t (*get_latency) (struct pa_sink_input *i);
23
24 void *userdata;
25
26 struct pa_memchunk resampled_chunk;
27 struct pa_resampler *resampler;
28 };
29
30 struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, const struct pa_sample_spec *spec);
31 void pa_sink_input_free(struct pa_sink_input* i);
32
33 /* Code that didn't create the input stream should call this function to
34 * request destruction of it */
35 void pa_sink_input_kill(struct pa_sink_input *i);
36
37 uint32_t pa_sink_input_get_latency(struct pa_sink_input *i);
38 char *pa_sink_input_list_to_string(struct pa_core *c);
39
40 int pa_sink_input_peek(struct pa_sink_input *i, struct pa_memchunk *chunk);
41 void pa_sink_input_drop(struct pa_sink_input *i, size_t length);
42
43 #endif