[pulseaudio-discuss] [PATCH v2 20/21] Add PA_CORE_HOOK_NODE_SET_INITIAL_ROUTING

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Thu Dec 5 06:19:20 PST 2013


---
 src/pulsecore/core.h | 5 +++++
 src/pulsecore/node.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index b2df5b5..8b4bf05 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -120,6 +120,11 @@ typedef enum pa_core_hook {
     PA_CORE_HOOK_CARD_PROFILE_AVAILABLE_CHANGED,
     PA_CORE_HOOK_PORT_AVAILABLE_CHANGED,
     PA_CORE_HOOK_PORT_LATENCY_OFFSET_CHANGED,
+
+    /* Fired when a new node is added to the system. Router modules can use
+     * this to set the initial routing for the new node. Call data: pa_node. */
+    PA_CORE_HOOK_NODE_SET_INITIAL_ROUTING,
+
     PA_CORE_HOOK_MAX
 } pa_core_hook_t;
 
diff --git a/src/pulsecore/node.c b/src/pulsecore/node.c
index 7b4d61f..18249d2 100644
--- a/src/pulsecore/node.c
+++ b/src/pulsecore/node.c
@@ -157,9 +157,10 @@ void pa_node_put(pa_node *node) {
     pa_assert(node->owner);
 
     pa_assert_se(pa_idxset_put(node->core->nodes, node, &node->index) >= 0);
-
     node->state = PA_NODE_STATE_LINKED;
 
+    pa_hook_fire(&node->core->hooks[PA_CORE_HOOK_NODE_SET_INITIAL_ROUTING], node);
+
     pa_log_debug("Created node %s.", node->name);
 }
 
-- 
1.8.3.1



More information about the pulseaudio-discuss mailing list