mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
capture: Remove support for synchronised capture streams.
This was added to ensure symmetry between playback and recording streams code, but in reality this makes little sense practically speaking and thus it is removed.
This commit is contained in:
parent
4eb513cbf4
commit
b837d04057
3 changed files with 2 additions and 86 deletions
|
|
@ -423,16 +423,6 @@ int pa_source_output_new(
|
||||||
|
|
||||||
o->muted = data->muted;
|
o->muted = data->muted;
|
||||||
|
|
||||||
if (data->sync_base) {
|
|
||||||
o->sync_next = data->sync_base->sync_next;
|
|
||||||
o->sync_prev = data->sync_base;
|
|
||||||
|
|
||||||
if (data->sync_base->sync_next)
|
|
||||||
data->sync_base->sync_next->sync_prev = o;
|
|
||||||
data->sync_base->sync_next = o;
|
|
||||||
} else
|
|
||||||
o->sync_next = o->sync_prev = NULL;
|
|
||||||
|
|
||||||
o->direct_on_input = data->direct_on_input;
|
o->direct_on_input = data->direct_on_input;
|
||||||
|
|
||||||
reset_callbacks(o);
|
reset_callbacks(o);
|
||||||
|
|
@ -498,7 +488,7 @@ static void update_n_corked(pa_source_output *o, pa_source_output_state_t state)
|
||||||
|
|
||||||
/* Called from main context */
|
/* Called from main context */
|
||||||
static void source_output_set_state(pa_source_output *o, pa_source_output_state_t state) {
|
static void source_output_set_state(pa_source_output *o, pa_source_output_state_t state) {
|
||||||
pa_source_output *ssync;
|
|
||||||
pa_assert(o);
|
pa_assert(o);
|
||||||
pa_assert_ctl_context();
|
pa_assert_ctl_context();
|
||||||
|
|
||||||
|
|
@ -510,24 +500,9 @@ static void source_output_set_state(pa_source_output *o, pa_source_output_state_
|
||||||
update_n_corked(o, state);
|
update_n_corked(o, state);
|
||||||
o->state = state;
|
o->state = state;
|
||||||
|
|
||||||
for (ssync = o->sync_prev; ssync; ssync = ssync->sync_prev) {
|
|
||||||
update_n_corked(ssync, state);
|
|
||||||
ssync->state = state;
|
|
||||||
}
|
|
||||||
for (ssync = o->sync_next; ssync; ssync = ssync->sync_next) {
|
|
||||||
update_n_corked(ssync, state);
|
|
||||||
ssync->state = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state != PA_SOURCE_OUTPUT_UNLINKED) {
|
if (state != PA_SOURCE_OUTPUT_UNLINKED) {
|
||||||
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED], o);
|
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED], o);
|
||||||
|
|
||||||
for (ssync = o->sync_prev; ssync; ssync = ssync->sync_prev)
|
|
||||||
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED], ssync);
|
|
||||||
|
|
||||||
for (ssync = o->sync_next; ssync; ssync = ssync->sync_next)
|
|
||||||
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_STATE_CHANGED], ssync);
|
|
||||||
|
|
||||||
if (PA_SOURCE_OUTPUT_IS_LINKED(state))
|
if (PA_SOURCE_OUTPUT_IS_LINKED(state))
|
||||||
pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
|
pa_subscription_post(o->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, o->index);
|
||||||
}
|
}
|
||||||
|
|
@ -551,13 +526,6 @@ void pa_source_output_unlink(pa_source_output*o) {
|
||||||
if (linked)
|
if (linked)
|
||||||
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK], o);
|
pa_hook_fire(&o->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK], o);
|
||||||
|
|
||||||
if (o->sync_prev)
|
|
||||||
o->sync_prev->sync_next = o->sync_next;
|
|
||||||
if (o->sync_next)
|
|
||||||
o->sync_next->sync_prev = o->sync_prev;
|
|
||||||
|
|
||||||
o->sync_prev = o->sync_next = NULL;
|
|
||||||
|
|
||||||
if (o->direct_on_input)
|
if (o->direct_on_input)
|
||||||
pa_idxset_remove_by_data(o->direct_on_input->direct_outputs, o, NULL);
|
pa_idxset_remove_by_data(o->direct_on_input->direct_outputs, o, NULL);
|
||||||
|
|
||||||
|
|
@ -1160,11 +1128,6 @@ pa_bool_t pa_source_output_may_move(pa_source_output *o) {
|
||||||
if (o->direct_on_input)
|
if (o->direct_on_input)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (o->sync_next || o->sync_prev) {
|
|
||||||
pa_log_warn("Moving synchronized streams not supported.");
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1567,19 +1530,11 @@ int pa_source_output_process_msg(pa_msgobject *mo, int code, void *userdata, int
|
||||||
pa_resampler_set_output_rate(o->thread_info.resampler, PA_PTR_TO_UINT(userdata));
|
pa_resampler_set_output_rate(o->thread_info.resampler, PA_PTR_TO_UINT(userdata));
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case PA_SOURCE_OUTPUT_MESSAGE_SET_STATE: {
|
case PA_SOURCE_OUTPUT_MESSAGE_SET_STATE:
|
||||||
pa_source_output *ssync;
|
|
||||||
|
|
||||||
pa_source_output_set_state_within_thread(o, PA_PTR_TO_UINT(userdata));
|
pa_source_output_set_state_within_thread(o, PA_PTR_TO_UINT(userdata));
|
||||||
|
|
||||||
for (ssync = o->thread_info.sync_prev; ssync; ssync = ssync->thread_info.sync_prev)
|
|
||||||
pa_source_output_set_state_within_thread(ssync, PA_PTR_TO_UINT(userdata));
|
|
||||||
|
|
||||||
for (ssync = o->thread_info.sync_next; ssync; ssync = ssync->thread_info.sync_next)
|
|
||||||
pa_source_output_set_state_within_thread(ssync, PA_PTR_TO_UINT(userdata));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
case PA_SOURCE_OUTPUT_MESSAGE_SET_REQUESTED_LATENCY: {
|
case PA_SOURCE_OUTPUT_MESSAGE_SET_REQUESTED_LATENCY: {
|
||||||
pa_usec_t *usec = userdata;
|
pa_usec_t *usec = userdata;
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,6 @@ struct pa_source_output {
|
||||||
pa_channel_map channel_map;
|
pa_channel_map channel_map;
|
||||||
pa_format_info *format;
|
pa_format_info *format;
|
||||||
|
|
||||||
pa_source_output *sync_prev, *sync_next;
|
|
||||||
|
|
||||||
/* Also see http://pulseaudio.org/wiki/InternalVolumes */
|
/* Also see http://pulseaudio.org/wiki/InternalVolumes */
|
||||||
pa_cvolume volume; /* The volume clients are informed about */
|
pa_cvolume volume; /* The volume clients are informed about */
|
||||||
pa_cvolume reference_ratio; /* The ratio of the stream's volume to the source's reference volume */
|
pa_cvolume reference_ratio; /* The ratio of the stream's volume to the source's reference volume */
|
||||||
|
|
@ -208,8 +206,6 @@ struct pa_source_output {
|
||||||
* don't implement rewind() */
|
* don't implement rewind() */
|
||||||
pa_memblockq *delay_memblockq;
|
pa_memblockq *delay_memblockq;
|
||||||
|
|
||||||
pa_source_output *sync_prev, *sync_next;
|
|
||||||
|
|
||||||
/* The requested latency for the source */
|
/* The requested latency for the source */
|
||||||
pa_usec_t requested_source_latency;
|
pa_usec_t requested_source_latency;
|
||||||
|
|
||||||
|
|
@ -254,8 +250,6 @@ typedef struct pa_source_output_new_data {
|
||||||
|
|
||||||
pa_resample_method_t resample_method;
|
pa_resample_method_t resample_method;
|
||||||
|
|
||||||
pa_source_output *sync_base;
|
|
||||||
|
|
||||||
pa_sample_spec sample_spec;
|
pa_sample_spec sample_spec;
|
||||||
pa_channel_map channel_map;
|
pa_channel_map channel_map;
|
||||||
pa_format_info *format;
|
pa_format_info *format;
|
||||||
|
|
|
||||||
|
|
@ -1665,22 +1665,6 @@ int pa_source_process_msg(pa_msgobject *object, int code, void *userdata, int64_
|
||||||
|
|
||||||
pa_hashmap_put(s->thread_info.outputs, PA_UINT32_TO_PTR(o->index), pa_source_output_ref(o));
|
pa_hashmap_put(s->thread_info.outputs, PA_UINT32_TO_PTR(o->index), pa_source_output_ref(o));
|
||||||
|
|
||||||
/* Since the caller sleeps in pa_source_output_put(), we can
|
|
||||||
* safely access data outside of thread_info even though
|
|
||||||
* it is mutable */
|
|
||||||
|
|
||||||
if ((o->thread_info.sync_prev = o->sync_prev)) {
|
|
||||||
pa_assert(o->source == o->thread_info.sync_prev->source);
|
|
||||||
pa_assert(o->sync_prev->sync_next == o);
|
|
||||||
o->thread_info.sync_prev->thread_info.sync_next = o;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((o->thread_info.sync_next = o->sync_next)) {
|
|
||||||
pa_assert(o->source == o->thread_info.sync_next->source);
|
|
||||||
pa_assert(o->sync_next->sync_prev == o);
|
|
||||||
o->thread_info.sync_next->thread_info.sync_prev = o;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (o->direct_on_input) {
|
if (o->direct_on_input) {
|
||||||
o->thread_info.direct_on_input = o->direct_on_input;
|
o->thread_info.direct_on_input = o->direct_on_input;
|
||||||
pa_hashmap_put(o->thread_info.direct_on_input->thread_info.direct_outputs, PA_UINT32_TO_PTR(o->index), o);
|
pa_hashmap_put(o->thread_info.direct_on_input->thread_info.direct_outputs, PA_UINT32_TO_PTR(o->index), o);
|
||||||
|
|
@ -1720,23 +1704,6 @@ int pa_source_process_msg(pa_msgobject *object, int code, void *userdata, int64_
|
||||||
pa_assert(o->thread_info.attached);
|
pa_assert(o->thread_info.attached);
|
||||||
o->thread_info.attached = FALSE;
|
o->thread_info.attached = FALSE;
|
||||||
|
|
||||||
/* Since the caller sleeps in pa_sink_input_unlink(),
|
|
||||||
* we can safely access data outside of thread_info even
|
|
||||||
* though it is mutable */
|
|
||||||
|
|
||||||
pa_assert(!o->sync_prev);
|
|
||||||
pa_assert(!o->sync_next);
|
|
||||||
|
|
||||||
if (o->thread_info.sync_prev) {
|
|
||||||
o->thread_info.sync_prev->thread_info.sync_next = o->thread_info.sync_prev->sync_next;
|
|
||||||
o->thread_info.sync_prev = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (o->thread_info.sync_next) {
|
|
||||||
o->thread_info.sync_next->thread_info.sync_prev = o->thread_info.sync_next->sync_prev;
|
|
||||||
o->thread_info.sync_next = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (o->thread_info.direct_on_input) {
|
if (o->thread_info.direct_on_input) {
|
||||||
pa_hashmap_remove(o->thread_info.direct_on_input->thread_info.direct_outputs, PA_UINT32_TO_PTR(o->index));
|
pa_hashmap_remove(o->thread_info.direct_on_input->thread_info.direct_outputs, PA_UINT32_TO_PTR(o->index));
|
||||||
o->thread_info.direct_on_input = NULL;
|
o->thread_info.direct_on_input = NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue