mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
add a couple of additional hooks for modules to use
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1600 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
ed01e1adb5
commit
30ccf9a5c9
6 changed files with 75 additions and 13 deletions
|
|
@ -80,6 +80,9 @@ pa_sink* pa_sink_new(
|
|||
pa_return_null_if_fail(!driver || pa_utf8_valid(driver));
|
||||
pa_return_null_if_fail(name && pa_utf8_valid(name) && *name);
|
||||
|
||||
if (pa_hook_fire(&core->hook_sink_new, NULL) < 0) /* FIXME */
|
||||
return NULL;
|
||||
|
||||
s = pa_msgobject_new(pa_sink);
|
||||
|
||||
if (!(name = pa_namereg_register(core, name, PA_NAMEREG_SINK, s, fail))) {
|
||||
|
|
@ -146,6 +149,8 @@ pa_sink* pa_sink_new(
|
|||
|
||||
pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_SINK | PA_SUBSCRIPTION_EVENT_NEW, s->index);
|
||||
|
||||
pa_hook_fire(&core->hook_sink_new_post, s);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
@ -174,11 +179,11 @@ void pa_sink_disconnect(pa_sink* s) {
|
|||
pa_assert(s);
|
||||
pa_return_if_fail(s->state != PA_SINK_DISCONNECTED);
|
||||
|
||||
pa_hook_fire(&s->core->hook_sink_disconnect, s);
|
||||
|
||||
pa_namereg_unregister(s->core, s->name);
|
||||
pa_idxset_remove_by_data(s->core->sinks, s, NULL);
|
||||
|
||||
pa_hook_fire(&s->core->hook_sink_disconnect, s);
|
||||
|
||||
while ((i = pa_idxset_first(s->inputs, NULL))) {
|
||||
pa_assert(i != j);
|
||||
pa_sink_input_kill(i);
|
||||
|
|
@ -198,6 +203,8 @@ void pa_sink_disconnect(pa_sink* s) {
|
|||
s->set_state = NULL;
|
||||
|
||||
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK | PA_SUBSCRIPTION_EVENT_REMOVE, s->index);
|
||||
|
||||
pa_hook_fire(&s->core->hook_sink_disconnect_post, s);
|
||||
}
|
||||
|
||||
static void sink_free(pa_object *o) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue