bluez: sco-{source,sink}: adjust node properties for when acting as a stream

Add media.name so that restore-stream can store this stream.
Remove node.driver because the stream is slaved to the connected ALSA device.
Remove pause-on-idle in all cases, as this is now configurable from
the config file.
This commit is contained in:
George Kiagiadakis 2021-03-19 20:21:12 +02:00
parent bca9e55d12
commit 66c43e5af2
2 changed files with 22 additions and 8 deletions

View file

@ -679,17 +679,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
static void emit_node_info(struct impl *this, bool full)
{
bool is_ag = (this->transport->profile & SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY);
struct spa_dict_item node_info_items[] = {
struct spa_dict_item ag_node_info_items[] = {
{ SPA_KEY_DEVICE_API, "bluez5" },
{ SPA_KEY_MEDIA_CLASS, is_ag ? "Stream/Input/Audio" : "Audio/Sink" },
{ SPA_KEY_MEDIA_CLASS, "Stream/Input/Audio" },
{ "media.name", ((this->transport && this->transport->device->name) ?
this->transport->device->name : "HSP/HFP") },
};
struct spa_dict_item hu_node_info_items[] = {
{ SPA_KEY_DEVICE_API, "bluez5" },
{ SPA_KEY_MEDIA_CLASS, "Audio/Sink" },
{ SPA_KEY_NODE_DRIVER, "true" },
{ SPA_KEY_NODE_PAUSE_ON_IDLE, "false" },
};
if (full)
this->info.change_mask = this->info_all;
if (this->info.change_mask) {
this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items);
this->info.props = is_ag ?
&SPA_DICT_INIT_ARRAY(ag_node_info_items) :
&SPA_DICT_INIT_ARRAY(hu_node_info_items);
spa_node_emit_info(&this->hooks, &this->info);
this->info.change_mask = 0;
}

View file

@ -688,17 +688,24 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
static void emit_node_info(struct impl *this, bool full)
{
bool is_ag = (this->transport->profile & SPA_BT_PROFILE_HEADSET_AUDIO_GATEWAY);
struct spa_dict_item node_info_items[] = {
struct spa_dict_item ag_node_info_items[] = {
{ SPA_KEY_DEVICE_API, "bluez5" },
{ SPA_KEY_MEDIA_CLASS, is_ag ? "Stream/Output/Audio" : "Audio/Source" },
{ SPA_KEY_MEDIA_CLASS, "Stream/Output/Audio" },
{ "media.name", ((this->transport && this->transport->device->name) ?
this->transport->device->name : "HSP/HFP") },
};
struct spa_dict_item hu_node_info_items[] = {
{ SPA_KEY_DEVICE_API, "bluez5" },
{ SPA_KEY_MEDIA_CLASS, "Audio/Source" },
{ SPA_KEY_NODE_DRIVER, "true" },
{ SPA_KEY_NODE_PAUSE_ON_IDLE, "false" },
};
if (full)
this->info.change_mask = this->info_all;
if (this->info.change_mask) {
this->info.props = &SPA_DICT_INIT_ARRAY(node_info_items);
this->info.props = is_ag ?
&SPA_DICT_INIT_ARRAY(ag_node_info_items) :
&SPA_DICT_INIT_ARRAY(hu_node_info_items);
spa_node_emit_info(&this->hooks, &this->info);
this->info.change_mask = 0;
}