1 #ifndef foosinkinputhfoo
2 #define foosinkinputhfoo
7 This file is part of polypaudio.
9 polypaudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser 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.
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.
19 You should have received a copy of the GNU Lesser 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
27 typedef struct pa_sink_input pa_sink_input;
30 #include <polyp/sample.h>
31 #include "memblockq.h"
32 #include "resampler.h"
36 typedef enum pa_sink_input_state {
37 PA_SINK_INPUT_RUNNING,
39 PA_SINK_INPUT_DISCONNECTED
40 } pa_sink_input_state_t;
42 struct pa_sink_input {
45 pa_sink_input_state_t state;
53 pa_sample_spec sample_spec;
54 pa_channel_map channel_map;
58 int (*peek) (pa_sink_input *i, pa_memchunk *chunk);
59 void (*drop) (pa_sink_input *i, const pa_memchunk *chunk, size_t length);
60 void (*kill) (pa_sink_input *i);
61 pa_usec_t (*get_latency) (pa_sink_input *i);
62 void (*underrun) (pa_sink_input *i);
68 pa_memchunk resampled_chunk;
69 pa_resampler *resampler;
72 pa_sink_input* pa_sink_input_new(
76 const pa_sample_spec *spec,
77 const pa_channel_map *map,
81 void pa_sink_input_unref(pa_sink_input* i);
82 pa_sink_input* pa_sink_input_ref(pa_sink_input* i);
84 /* To be called by the implementing module only */
85 void pa_sink_input_disconnect(pa_sink_input* i);
87 /* External code may request disconnection with this funcion */
88 void pa_sink_input_kill(pa_sink_input*i);
90 pa_usec_t pa_sink_input_get_latency(pa_sink_input *i);
92 int pa_sink_input_peek(pa_sink_input *i, pa_memchunk *chunk, pa_cvolume *volume);
93 void pa_sink_input_drop(pa_sink_input *i, const pa_memchunk *chunk, size_t length);
95 void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume);
96 const pa_cvolume * pa_sink_input_get_volume(pa_sink_input *i);
98 void pa_sink_input_cork(pa_sink_input *i, int b);
100 void pa_sink_input_set_rate(pa_sink_input *i, uint32_t rate);
102 void pa_sink_input_set_name(pa_sink_input *i, const char *name);
104 pa_resample_method_t pa_sink_input_get_resample_method(pa_sink_input *i);