bluez5: tell the codec whether endpoint is sink or source

Add a flag A2DP_CODEC_FLAG_SINK to incidate a sink endpoint.

Also enum_config and caps_preference_cmp may need to know whether the
codec is being configured for SRC or SNK. Also add the flags argument to
init_props.

Bump codec API version.
This commit is contained in:
Pauli Virtanen 2022-05-21 13:18:38 +03:00 committed by Wim Taymans
parent 8d66b2b2f7
commit a8eb146d39
10 changed files with 63 additions and 34 deletions

View file

@ -630,7 +630,8 @@ static int transport_start(struct impl *this)
this->transport_acquired = true;
this->codec_data = this->codec->init(this->codec, 0,
this->codec_data = this->codec->init(this->codec,
this->is_duplex ? 0 : A2DP_CODEC_FLAG_SINK,
this->transport->configuration,
this->transport->configuration_len,
&port->current_format,
@ -967,6 +968,7 @@ impl_node_port_enum_params(void *object, int seq,
return -EIO;
if ((res = this->codec->enum_config(this->codec,
this->is_duplex ? 0 : A2DP_CODEC_FLAG_SINK,
this->transport->configuration,
this->transport->configuration_len,
id, result.index, &b, &param)) != 1)
@ -1581,6 +1583,7 @@ impl_init(const struct spa_handle_factory *factory,
if (this->codec->init_props != NULL)
this->codec_props = this->codec->init_props(this->codec,
this->is_duplex ? 0 : A2DP_CODEC_FLAG_SINK,
this->transport->device->settings);
spa_bt_transport_add_listener(this->transport,