2004-06-15 17:05:03 +00:00
|
|
|
#ifndef foosinkinputhfoo
|
|
|
|
|
#define foosinkinputhfoo
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-07-16 19:56:36 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
This file is part of polypaudio.
|
|
|
|
|
|
|
|
|
|
polypaudio is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published
|
|
|
|
|
by the Free Software Foundation; either version 2 of the License,
|
|
|
|
|
or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
polypaudio is distributed in the hope that it will be useful, but
|
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with polypaudio; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
|
USA.
|
|
|
|
|
***/
|
|
|
|
|
|
2004-06-08 23:54:24 +00:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
|
|
#include "sink.h"
|
|
|
|
|
#include "sample.h"
|
|
|
|
|
#include "memblockq.h"
|
2004-07-03 00:19:17 +00:00
|
|
|
#include "resampler.h"
|
2004-07-10 20:56:38 +00:00
|
|
|
#include "module.h"
|
|
|
|
|
#include "client.h"
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
struct pa_sink_input {
|
2004-06-08 23:54:24 +00:00
|
|
|
uint32_t index;
|
|
|
|
|
|
2004-08-22 21:13:58 +00:00
|
|
|
int corked;
|
|
|
|
|
|
2004-06-15 17:05:03 +00:00
|
|
|
char *name;
|
2004-07-10 20:56:38 +00:00
|
|
|
struct pa_module *owner;
|
|
|
|
|
struct pa_client *client;
|
2004-07-03 23:35:12 +00:00
|
|
|
struct pa_sink *sink;
|
2004-06-23 23:17:30 +00:00
|
|
|
struct pa_sample_spec sample_spec;
|
2004-06-29 20:37:24 +00:00
|
|
|
uint32_t volume;
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
int (*peek) (struct pa_sink_input *i, struct pa_memchunk *chunk);
|
2004-08-22 21:13:58 +00:00
|
|
|
void (*drop) (struct pa_sink_input *i, const struct pa_memchunk *chunk, size_t length);
|
2004-07-03 23:35:12 +00:00
|
|
|
void (*kill) (struct pa_sink_input *i);
|
2004-09-12 13:14:49 +00:00
|
|
|
pa_usec_t (*get_latency) (struct pa_sink_input *i);
|
2004-06-14 20:30:50 +00:00
|
|
|
|
2004-06-15 17:05:03 +00:00
|
|
|
void *userdata;
|
2004-07-03 00:19:17 +00:00
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
struct pa_memchunk resampled_chunk;
|
|
|
|
|
struct pa_resampler *resampler;
|
2004-06-08 23:54:24 +00:00
|
|
|
};
|
|
|
|
|
|
2004-09-14 17:52:11 +00:00
|
|
|
struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, const struct pa_sample_spec *spec, int variable_rate);
|
2004-07-03 23:35:12 +00:00
|
|
|
void pa_sink_input_free(struct pa_sink_input* i);
|
2004-06-14 20:30:50 +00:00
|
|
|
|
|
|
|
|
/* Code that didn't create the input stream should call this function to
|
|
|
|
|
* request destruction of it */
|
2004-07-03 23:35:12 +00:00
|
|
|
void pa_sink_input_kill(struct pa_sink_input *i);
|
2004-06-15 00:29:01 +00:00
|
|
|
|
2004-08-27 01:29:49 +00:00
|
|
|
pa_usec_t pa_sink_input_get_latency(struct pa_sink_input *i);
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
int pa_sink_input_peek(struct pa_sink_input *i, struct pa_memchunk *chunk);
|
2004-08-22 21:13:58 +00:00
|
|
|
void pa_sink_input_drop(struct pa_sink_input *i, const struct pa_memchunk *chunk, size_t length);
|
2004-07-02 18:47:03 +00:00
|
|
|
|
2004-08-17 17:17:22 +00:00
|
|
|
void pa_sink_input_set_volume(struct pa_sink_input *i, pa_volume_t volume);
|
2004-08-15 13:15:51 +00:00
|
|
|
|
2004-08-22 21:13:58 +00:00
|
|
|
void pa_sink_input_cork(struct pa_sink_input *i, int b);
|
|
|
|
|
|
2004-09-14 17:52:11 +00:00
|
|
|
void pa_sink_input_set_rate(struct pa_sink_input *i, uint32_t rate);
|
|
|
|
|
|
2004-06-08 23:54:24 +00:00
|
|
|
#endif
|