-enum bt_graph_add_listener_status
-bt_graph_add_source_filter_component_ports_connected_listener(
- struct bt_graph *graph,
- bt_graph_source_filter_component_ports_connected_listener_func func,
- bt_graph_listener_removed_func listener_removed, void *data,
- bt_listener_id *out_listener_id)
-{
- struct bt_graph_listener_ports_connected listener = {
- .base = {
- .removed = listener_removed,
- .data = data,
- },
- .func = (ports_connected_func_t) func,
- };
- bt_listener_id listener_id;
-
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
- BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
- BT_ASSERT_PRE(!graph->in_remove_listener,
- "Graph currently executing a \"listener removed\" listener: "
- "%!+g", graph);
- g_array_append_val(graph->listeners.source_filter_ports_connected,
- listener);
- listener_id = graph->listeners.source_filter_ports_connected->len - 1;
- BT_LIB_LOGD("Added \"source to filter component ports connected\" listener to graph: "
- "%![graph-]+g, listener-addr=%p, id=%d", graph, listener,
- listener_id);
-
- if (listener_id) {
- *out_listener_id = listener_id;
- }
-
- return BT_FUNC_STATUS_OK;
-}
-
-enum bt_graph_add_listener_status
-bt_graph_add_source_sink_component_ports_connected_listener(
- struct bt_graph *graph,
- bt_graph_source_sink_component_ports_connected_listener_func func,
- bt_graph_listener_removed_func listener_removed, void *data,
- bt_listener_id *out_listener_id)
-{
- struct bt_graph_listener_ports_connected listener = {
- .base = {
- .removed = listener_removed,
- .data = data,
- },
- .func = (ports_connected_func_t) func,
- };
- bt_listener_id listener_id;
-
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
- BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
- BT_ASSERT_PRE(!graph->in_remove_listener,
- "Graph currently executing a \"listener removed\" listener: "
- "%!+g", graph);
- g_array_append_val(graph->listeners.source_sink_ports_connected,
- listener);
- listener_id = graph->listeners.source_sink_ports_connected->len - 1;
- BT_LIB_LOGD("Added \"source to sink component ports connected\" listener to graph: "
- "%![graph-]+g, listener-addr=%p, id=%d", graph, listener,
- listener_id);
-
- if (listener_id) {
- *out_listener_id = listener_id;
- }
-
- return BT_FUNC_STATUS_OK;
-}
-
-enum bt_graph_add_listener_status
-bt_graph_add_filter_filter_component_ports_connected_listener(
- struct bt_graph *graph,
- bt_graph_filter_filter_component_ports_connected_listener_func func,
- bt_graph_listener_removed_func listener_removed, void *data,
- bt_listener_id *out_listener_id)
-{
- struct bt_graph_listener_ports_connected listener = {
- .base = {
- .removed = listener_removed,
- .data = data,
- },
- .func = (ports_connected_func_t) func,
- };
- bt_listener_id listener_id;
-
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
- BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
- BT_ASSERT_PRE(!graph->in_remove_listener,
- "Graph currently executing a \"listener removed\" listener: "
- "%!+g", graph);
- g_array_append_val(graph->listeners.filter_filter_ports_connected,
- listener);
- listener_id = graph->listeners.filter_filter_ports_connected->len - 1;
- BT_LIB_LOGD("Added \"filter to filter component ports connected\" listener to graph: "
- "%![graph-]+g, listener-addr=%p, id=%d", graph, listener,
- listener_id);
-
- if (listener_id) {
- *out_listener_id = listener_id;
- }
-
- return BT_FUNC_STATUS_OK;
-}
-
-enum bt_graph_add_listener_status
-bt_graph_add_filter_sink_component_ports_connected_listener(
- struct bt_graph *graph,
- bt_graph_filter_sink_component_ports_connected_listener_func func,
- bt_graph_listener_removed_func listener_removed, void *data,
- bt_listener_id *out_listener_id)
-{
- struct bt_graph_listener_ports_connected listener = {
- .base = {
- .removed = listener_removed,
- .data = data,
- },
- .func = (ports_connected_func_t) func,
- };
- bt_listener_id listener_id;
-
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
- BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
- BT_ASSERT_PRE(!graph->in_remove_listener,
- "Graph currently executing a \"listener removed\" listener: "
- "%!+g", graph);
- g_array_append_val(graph->listeners.filter_sink_ports_connected,
- listener);
- listener_id = graph->listeners.filter_sink_ports_connected->len - 1;
- BT_LIB_LOGD("Added \"filter to sink component ports connected\" listener to graph: "
- "%![graph-]+g, listener-addr=%p, id=%d", graph, listener,
- listener_id);
-
- if (listener_id) {
- *out_listener_id = listener_id;
- }
-
- return BT_FUNC_STATUS_OK;
-}
-
-BT_HIDDEN