From 78f386ad45dc046d673fca5441dff188a7297059 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 15 Jun 2004 15:18:33 +0000 Subject: more work git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@17 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/sinkinput.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/sinkinput.h (limited to 'src/sinkinput.h') diff --git a/src/sinkinput.h b/src/sinkinput.h new file mode 100644 index 00000000..544c3318 --- /dev/null +++ b/src/sinkinput.h @@ -0,0 +1,50 @@ +#ifndef fooinputstreamhfoo +#define fooinputstreamhfoo + +#include + +#include "sink.h" +#include "sample.h" +#include "memblockq.h" + +struct input_stream { + char *name; + uint32_t index; + + struct sink *sink; + struct sample_spec spec; + + struct memblockq *memblockq; + + void (*kill)(struct input_stream* i, void *userdata); + void *kill_userdata; + + void (*notify)(struct input_stream*i, void *userdata); + void *notify_userdata; +}; + +struct input_stream* input_stream_new(struct sink *s, struct sample_spec *spec, const char *name); +void input_stream_free(struct input_stream* i); + +/* This function notifies the attached sink that new data is available + * in the memblockq */ +void input_stream_notify_sink(struct input_stream *i); + + +/* The registrant of the input stream should call this function to set a + * callback function which is called when destruction of the input stream is + * requested */ +void input_stream_set_kill_callback(struct input_stream *i, void (*kill)(struct input_stream*i, void *userdata), void *userdata); + +/* Code that didn't create the input stream should call this function to + * request destruction of it */ +void input_stream_kill(struct input_stream *i); + +/* Notify the code that created this input stream that some data has + * been removed from the memblockq */ +void input_stream_set_notify_callback(struct input_stream *i, void (*notify)(struct input_stream*i, void *userdata), void *userdata); + +void input_stream_notify(struct input_stream *i); + + +#endif -- cgit