summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/protocol-native.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-08-30 22:57:53 +0000
committerLennart Poettering <lennart@poettering.net>2007-08-30 22:57:53 +0000
commit4d623f0d4442148f20f2ffdc85cf95e54ef83721 (patch)
treef758269ece89edac69365e19317ee221af7a6889 /src/pulsecore/protocol-native.c
parentb552541dd1f65646a5963e7a8c8ec43e4ea416c8 (diff)
Lots of assorted minor cleanups and fixes:
* s/disconnect/unlink/ at many places where it makes sense * make "start_corked" a normal pa_sink_input/pa_source_output flag instead of a seperate boolean variable * add generic process() function to pa_sink_input/pa_source_output vtable that can be used by streams to do some arbitrary processing in each rt loop iteration even the sink/source is suspended * add detach()/attach() functions to pa_sink_input/pa_source_output vtable that are called when ever the rtpoll object of the event thread changes * add suspend() functions to pa_sink_input/pa_source_output vtable which are called whenever the sink/source they are attached to suspends/resumes * add PA_SINK_INIT/PA_SOURCE_INIT/PA_SINK_INPUT_INIT/PA_SINK_OUTPUT_INIT states to state machines which is active between _new() and _put() * seperate _put() from _new() for pa_sink/pa_source * add PA_SOURCE_OUTPUT_DONT_MOVE/PA_SINK_INPUT_DONT_MOVE flags * make the pa_rtpoll object a property of pa_sink/pa_source to allow streams attached to them make use of it * fix skipping over move_silence * update module-pipe-source to make use of pa_rtpoll * add pa_sink_skip() as optimization in cases where the actualy data returned by pa_sink_render() doesn't matter git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1733 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/protocol-native.c')
-rw-r--r--src/pulsecore/protocol-native.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index a0b70669..ea7f43ca 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -387,7 +387,7 @@ static void record_stream_unlink(record_stream *s) {
return;
if (s->source_output) {
- pa_source_output_disconnect(s->source_output);
+ pa_source_output_unlink(s->source_output);
pa_source_output_unref(s->source_output);
s->source_output = NULL;
}
@@ -460,11 +460,10 @@ static record_stream* record_stream_new(
data.source = source;
data.driver = __FILE__;
data.name = name;
- data.start_corked = corked;
pa_source_output_new_data_set_sample_spec(&data, ss);
pa_source_output_new_data_set_channel_map(&data, map);
- if (!(source_output = pa_source_output_new(c->protocol->core, &data, 0)))
+ if (!(source_output = pa_source_output_new(c->protocol->core, &data, corked ? PA_SOURCE_OUTPUT_START_CORKED : 0)))
return NULL;
s = pa_msgobject_new(record_stream);
@@ -504,7 +503,7 @@ static void playback_stream_unlink(playback_stream *s) {
return;
if (s->sink_input) {
- pa_sink_input_disconnect(s->sink_input);
+ pa_sink_input_unlink(s->sink_input);
pa_sink_input_unref(s->sink_input);
s->sink_input = NULL;
}
@@ -653,10 +652,9 @@ static playback_stream* playback_stream_new(
pa_sink_input_new_data_set_volume(&data, volume);
data.module = c->protocol->module;
data.client = c->client;
- data.start_corked = corked;
data.sync_base = ssync ? ssync->sink_input : NULL;
- if (!(sink_input = pa_sink_input_new(c->protocol->core, &data, 0)))
+ if (!(sink_input = pa_sink_input_new(c->protocol->core, &data, corked ? PA_SINK_INPUT_START_CORKED : 0)))
return NULL;
s = pa_msgobject_new(playback_stream);
@@ -1729,10 +1727,7 @@ static void sink_fill_tagstruct(pa_tagstruct *t, pa_sink *sink) {
PA_TAG_STRING, sink->monitor_source ? sink->monitor_source->name : NULL,
PA_TAG_USEC, pa_sink_get_latency(sink),
PA_TAG_STRING, sink->driver,
- PA_TAG_U32,
- (sink->get_volume ? PA_SINK_HW_VOLUME_CTRL : 0) | /* FIXME */
- (sink->get_latency ? PA_SINK_LATENCY : 0) | /* FIXME */
- (sink->is_hardware ? PA_SINK_HARDWARE : 0),
+ PA_TAG_U32, sink->flags,
PA_TAG_INVALID);
}
@@ -1754,10 +1749,7 @@ static void source_fill_tagstruct(pa_tagstruct *t, pa_source *source) {
PA_TAG_STRING, source->monitor_of ? source->monitor_of->name : NULL,
PA_TAG_USEC, pa_source_get_latency(source),
PA_TAG_STRING, source->driver,
- PA_TAG_U32,
- (source->get_volume ? PA_SOURCE_HW_VOLUME_CTRL : 0) | /* FIXME */
- (source->get_latency ? PA_SOURCE_LATENCY : 0) | /* FIXME */
- (source->is_hardware ? PA_SOURCE_HARDWARE : 0),
+ PA_TAG_U32, source->flags,
PA_TAG_INVALID);
}