diff --git a/spa/plugins/bluez5/sco-sink.c b/spa/plugins/bluez5/sco-sink.c index 2a0928623..5d20e1441 100644 --- a/spa/plugins/bluez5/sco-sink.c +++ b/spa/plugins/bluez5/sco-sink.c @@ -128,6 +128,8 @@ struct impl { unsigned int following:1; unsigned int flush_pending:1; + unsigned int is_internal:1; + /* Sources */ struct spa_source source; struct spa_source flush_timer_source; @@ -956,9 +958,9 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { - static const struct spa_dict_item hu_node_info_items[] = { + const struct spa_dict_item hu_node_info_items[] = { { SPA_KEY_DEVICE_API, "bluez5" }, - { SPA_KEY_MEDIA_CLASS, "Audio/Sink" }, + { SPA_KEY_MEDIA_CLASS, this->is_internal ? "Audio/Sink/Internal" : "Audio/Sink" }, { SPA_KEY_NODE_DRIVER, "true" }, }; @@ -1626,6 +1628,9 @@ impl_init(const struct spa_handle_factory *factory, if (info && (str = spa_dict_lookup(info, "clock.quantum-limit"))) spa_atou32(str, &this->quantum_limit, 0); + if (info && (str = spa_dict_lookup(info, "api.bluez5.internal")) != NULL) + this->is_internal = spa_atob(str); + if (info && (str = spa_dict_lookup(info, SPA_KEY_API_BLUEZ5_TRANSPORT))) sscanf(str, "pointer:%p", &this->transport); diff --git a/spa/plugins/bluez5/sco-source.c b/spa/plugins/bluez5/sco-source.c index 77ecf778f..e7f98738a 100644 --- a/spa/plugins/bluez5/sco-source.c +++ b/spa/plugins/bluez5/sco-source.c @@ -124,6 +124,8 @@ struct impl { unsigned int resampling:1; unsigned int io_error:1; + unsigned int is_internal:1; + struct spa_source timer_source; int timerfd; @@ -929,9 +931,9 @@ static int impl_node_send_command(void *object, const struct spa_command *comman static void emit_node_info(struct impl *this, bool full) { - static const struct spa_dict_item hu_node_info_items[] = { + const struct spa_dict_item hu_node_info_items[] = { { SPA_KEY_DEVICE_API, "bluez5" }, - { SPA_KEY_MEDIA_CLASS, "Audio/Source" }, + { SPA_KEY_MEDIA_CLASS, this->is_internal ? "Audio/Source/Internal" : "Audio/Source" }, { SPA_KEY_NODE_DRIVER, "true" }, }; const struct spa_dict_item ag_node_info_items[] = { @@ -1715,6 +1717,9 @@ impl_init(const struct spa_handle_factory *factory, if (info && (str = spa_dict_lookup(info, "clock.quantum-limit"))) spa_atou32(str, &this->quantum_limit, 0); + if (info && (str = spa_dict_lookup(info, "api.bluez5.internal")) != NULL) + this->is_internal = spa_atob(str); + if (info && (str = spa_dict_lookup(info, SPA_KEY_API_BLUEZ5_TRANSPORT))) sscanf(str, "pointer:%p", &this->transport);