bluez5: support and use old api.bluez5.a2dp.* factory names for A2DP

For backward compatibility with old Wireplumber releases, support the
old api.bluez5.a2dp.sink/source names, and use them in object events
instead of the media.sink/source names.
This commit is contained in:
Pauli Virtanen 2022-09-15 23:02:51 +03:00
parent 101287159e
commit 8de03f5c29
5 changed files with 36 additions and 6 deletions

View file

@ -683,11 +683,11 @@ static int emit_nodes(struct impl *this)
if (t) {
this->props.codec = t->media_codec->id;
emit_dynamic_node(&this->dyn_media_source, this, t,
2, SPA_NAME_API_BLUEZ5_MEDIA_SOURCE, false);
2, SPA_NAME_API_BLUEZ5_A2DP_SOURCE, false);
if (t->media_codec->duplex_codec) {
emit_dynamic_node(&this->dyn_media_sink, this, t,
3, SPA_NAME_API_BLUEZ5_MEDIA_SINK, true);
3, SPA_NAME_API_BLUEZ5_A2DP_SINK, true);
}
}
}
@ -698,11 +698,11 @@ static int emit_nodes(struct impl *this)
if (t) {
this->props.codec = t->media_codec->id;
emit_dynamic_node(&this->dyn_media_source, this, t,
DEVICE_ID_SOURCE, SPA_NAME_API_BLUEZ5_MEDIA_SOURCE, false);
DEVICE_ID_SOURCE, SPA_NAME_API_BLUEZ5_A2DP_SOURCE, false);
if (t->media_codec->duplex_codec) {
emit_node(this, t,
DEVICE_ID_SINK, SPA_NAME_API_BLUEZ5_MEDIA_SINK, true);
DEVICE_ID_SINK, SPA_NAME_API_BLUEZ5_A2DP_SINK, true);
}
}
}
@ -711,11 +711,11 @@ static int emit_nodes(struct impl *this)
t = find_transport(this, SPA_BT_PROFILE_A2DP_SINK, this->props.codec);
if (t) {
this->props.codec = t->media_codec->id;
emit_node(this, t, DEVICE_ID_SINK, SPA_NAME_API_BLUEZ5_MEDIA_SINK, false);
emit_node(this, t, DEVICE_ID_SINK, SPA_NAME_API_BLUEZ5_A2DP_SINK, false);
if (t->media_codec->duplex_codec) {
emit_node(this, t,
DEVICE_ID_SOURCE, SPA_NAME_API_BLUEZ5_MEDIA_SOURCE, true);
DEVICE_ID_SOURCE, SPA_NAME_API_BLUEZ5_A2DP_SOURCE, true);
}
}
}