summaryrefslogtreecommitdiffstats
path: root/src/sinkinput.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-06-15 17:05:03 +0000
committerLennart Poettering <lennart@poettering.net>2004-06-15 17:05:03 +0000
commitb24546bedee168778a7aef11200dfb0378dfae43 (patch)
tree8fc0c27f32ff7b3c3cfd517ca724444c3e59904d /src/sinkinput.c
parent78f386ad45dc046d673fca5441dff188a7297059 (diff)
cleanup
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@18 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/sinkinput.c')
-rw-r--r--src/sinkinput.c62
1 files changed, 14 insertions, 48 deletions
diff --git a/src/sinkinput.c b/src/sinkinput.c
index 6bc841ac..ae7b27ff 100644
--- a/src/sinkinput.c
+++ b/src/sinkinput.c
@@ -2,81 +2,47 @@
#include <stdlib.h>
#include <string.h>
-#include "inputstream.h"
+#include "sinkinput.h"
-struct input_stream* input_stream_new(struct sink *s, struct sample_spec *spec, const char *name) {
- struct input_stream *i;
+struct sink_input* sink_input_new(struct sink *s, struct sample_spec *spec, const char *name) {
+ struct sink_input *i;
int r;
assert(s && spec);
- i = malloc(sizeof(struct input_stream));
+ i = malloc(sizeof(struct sink_input));
assert(i);
i->name = name ? strdup(name) : NULL;
i->sink = s;
i->spec = *spec;
+ i->peek = NULL;
+ i->drop = NULL;
i->kill = NULL;
- i->kill_userdata = NULL;
- i->notify = NULL;
- i->notify_userdata = NULL;
+ i->userdata = NULL;
- i->memblockq = memblockq_new(bytes_per_second(spec)/2, sample_size(spec), (size_t) -1);
- assert(i->memblockq);
-
assert(s->core);
- r = idxset_put(s->core->input_streams, i, &i->index);
+ r = idxset_put(s->core->sink_inputs, i, &i->index);
assert(r == 0 && i->index != IDXSET_INVALID);
- r = idxset_put(s->input_streams, i, NULL);
+ r = idxset_put(s->inputs, i, NULL);
assert(r == 0);
return i;
}
-void input_stream_free(struct input_stream* i) {
+void sink_input_free(struct sink_input* i) {
assert(i);
- memblockq_free(i->memblockq);
-
assert(i->sink && i->sink->core);
- idxset_remove_by_data(i->sink->core->input_streams, i, NULL);
- idxset_remove_by_data(i->sink->input_streams, i, NULL);
+ idxset_remove_by_data(i->sink->core->sink_inputs, i, NULL);
+ idxset_remove_by_data(i->sink->inputs, i, NULL);
free(i->name);
free(i);
}
-void input_stream_notify_sink(struct input_stream *i) {
- assert(i);
-
- if (!memblockq_is_readable(i->memblockq))
- return;
-
- sink_notify(i->sink);
-}
-
-void input_stream_set_kill_callback(struct input_stream *i, void (*kill)(struct input_stream*i, void *userdata), void *userdata) {
- assert(i && kill);
- i->kill = kill;
- i->kill_userdata = userdata;
-}
-
-
-void input_stream_kill(struct input_stream*i) {
+void sink_input_kill(struct sink_input*i) {
assert(i);
if (i->kill)
- i->kill(i, i->kill_userdata);
-}
-
-void input_stream_set_notify_callback(struct input_stream *i, void (*notify)(struct input_stream*i, void *userdata), void *userdata) {
- assert(i && notify);
-
- i->notify = notify;
- i->notify_userdata = userdata;
-}
-
-void input_stream_notify(struct input_stream *i) {
- assert(i);
- if (i->notify)
- i->notify(i, i->notify_userdata);
+ i->kill(i);
}