-BT_HIDDEN
-void bt_stream_map_component_to_port(struct bt_stream *stream,
- struct bt_component *comp,
- struct bt_port *port)
-{
- BT_ASSERT(stream);
- BT_ASSERT(comp);
- BT_ASSERT(port);
- BT_ASSERT(stream->comp_cur_port);
-
- /*
- * Do not take a reference to the component here because we
- * don't want the component to exist as long as this stream
- * exists. Instead, keep a weak reference, but add a destroy
- * listener so that we remove this hash table entry when we know
- * the component is destroyed.
- */
- BT_LOGV("Adding component's destroy listener for stream: "
- "stream-addr=%p, stream-name=\"%s\", comp-addr=%p, "
- "comp-name=\"%s\", port-addr=%p, port-name=\"%s\"",
- stream, bt_stream_get_name(stream),
- comp, bt_component_get_name(comp), port,
- bt_port_get_name(port));
- bt_component_add_destroy_listener(comp, component_destroy_listener,
- stream);
- g_hash_table_insert(stream->comp_cur_port, comp, port);
- BT_LOGV_STR("Mapped component to port for stream.");
-}
-
-BT_HIDDEN
-struct bt_port *bt_stream_port_for_component(struct bt_stream *stream,
- struct bt_component *comp)
-{
- BT_ASSERT(stream);
- BT_ASSERT(comp);
- BT_ASSERT(stream->comp_cur_port);
- return g_hash_table_lookup(stream->comp_cur_port, comp);
-}
-