From 6e019795bff589ef0a867772975e34da78fffefb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 14 Sep 2004 20:53:25 +0000 Subject: add refernce counting for sinks, sources, sink-inputs and source-outputs git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@200 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/sink-input.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'polyp/sink-input.h') diff --git a/polyp/sink-input.h b/polyp/sink-input.h index e5b06387..37678300 100644 --- a/polyp/sink-input.h +++ b/polyp/sink-input.h @@ -31,7 +31,15 @@ #include "module.h" #include "client.h" +enum pa_sink_input_state { + PA_SINK_INPUT_RUNNING, + PA_SINK_INPUT_DISCONNECTED +}; + struct pa_sink_input { + int ref; + enum pa_sink_input_state state; + uint32_t index; int corked; @@ -55,11 +63,14 @@ struct pa_sink_input { }; struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, const struct pa_sample_spec *spec, int variable_rate); -void pa_sink_input_free(struct pa_sink_input* i); +void pa_sink_input_unref(struct pa_sink_input* i); +struct pa_sink_input* pa_sink_input_ref(struct pa_sink_input* i); -/* Code that didn't create the input stream should call this function to - * request destruction of it */ -void pa_sink_input_kill(struct pa_sink_input *i); +/* To be called by the implementing module only */ +void pa_sink_input_disconnect(struct pa_sink_input* i); + +/* External code may request disconnection with this funcion */ +void pa_sink_input_kill(struct pa_sink_input*i); pa_usec_t pa_sink_input_get_latency(struct pa_sink_input *i); @@ -72,4 +83,6 @@ void pa_sink_input_cork(struct pa_sink_input *i, int b); void pa_sink_input_set_rate(struct pa_sink_input *i, uint32_t rate); +void pa_sink_input_set_name(struct pa_sink_input *i, const char *name); + #endif -- cgit