mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
merge Colin Guthrie's module-always-sink module, and add priorization to the hook subsystem while doing so.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2516 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
1337afdee4
commit
92e4fb318e
14 changed files with 261 additions and 59 deletions
|
|
@ -7,12 +7,12 @@
|
|||
#include <pulsecore/hook-list.h>
|
||||
#include <pulsecore/log.h>
|
||||
|
||||
static pa_hook_result_t func1(const char*hook_data, const char*call_data, const char*slot_data) {
|
||||
static pa_hook_result_t func1(const char *hook_data, const char *call_data, const char *slot_data) {
|
||||
pa_log("(func1) hook=%s call=%s slot=%s", hook_data, call_data, slot_data);
|
||||
return PA_HOOK_OK;
|
||||
}
|
||||
|
||||
static pa_hook_result_t func2(const char*hook_data, const char*call_data, const char*slot_data) {
|
||||
static pa_hook_result_t func2(const char *hook_data, const char *call_data, const char *slot_data) {
|
||||
pa_log("(func2) hook=%s call=%s slot=%s", hook_data, call_data, slot_data);
|
||||
return PA_HOOK_OK;
|
||||
}
|
||||
|
|
@ -23,9 +23,9 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
pa_hook_init(&hook, (void*) "hook");
|
||||
|
||||
pa_hook_connect(&hook, (pa_hook_cb_t) func1, (void*) "slot1");
|
||||
slot = pa_hook_connect(&hook, (pa_hook_cb_t) func2, (void*) "slot2");
|
||||
pa_hook_connect(&hook, (pa_hook_cb_t) func1, (void*) "slot3");
|
||||
pa_hook_connect(&hook, PA_HOOK_LATE, (pa_hook_cb_t) func1, (void*) "slot1");
|
||||
slot = pa_hook_connect(&hook, PA_HOOK_NORMAL, (pa_hook_cb_t) func2, (void*) "slot2");
|
||||
pa_hook_connect(&hook, PA_HOOK_NORMAL, (pa_hook_cb_t) func1, (void*) "slot3");
|
||||
|
||||
pa_hook_fire(&hook, (void*) "call1");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue