mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
add new pa_card object as a way to logically combine multiple sinks and sources
This commit is contained in:
parent
aeb0707f12
commit
b6deb0cc4c
12 changed files with 327 additions and 4 deletions
|
|
@ -174,6 +174,7 @@ pa_source* pa_source_new(
|
|||
s->proplist = pa_proplist_copy(data->proplist);
|
||||
s->driver = pa_xstrdup(data->driver);
|
||||
s->module = data->module;
|
||||
s->card = data->card;
|
||||
|
||||
s->sample_spec = data->sample_spec;
|
||||
s->channel_map = data->channel_map;
|
||||
|
|
@ -212,6 +213,9 @@ pa_source* pa_source_new(
|
|||
|
||||
pa_assert_se(pa_idxset_put(core->sources, s, &s->index) >= 0);
|
||||
|
||||
if (s->card)
|
||||
pa_assert_se(pa_idxset_put(s->card->sources, s, NULL) >= 0);
|
||||
|
||||
pa_log_info("Created source %u \"%s\" with sample spec %s and channel map %s",
|
||||
s->index,
|
||||
s->name,
|
||||
|
|
@ -314,6 +318,9 @@ void pa_source_unlink(pa_source *s) {
|
|||
pa_namereg_unregister(s->core, s->name);
|
||||
pa_idxset_remove_by_data(s->core->sources, s, NULL);
|
||||
|
||||
if (s->card)
|
||||
pa_idxset_remove_by_data(s->card->sinks, s, NULL);
|
||||
|
||||
while ((o = pa_idxset_first(s->outputs, NULL))) {
|
||||
pa_assert(o != j);
|
||||
pa_source_output_kill(o);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue