bluez5: Set BAP QoS depending on selected configuration

This move the QoS setup to be codec specific and fills it depending on the
selected codec configuration.
This commit is contained in:
Frédéric Danis 2022-07-19 16:09:18 +02:00 committed by Wim Taymans
parent 284da66deb
commit f428b13d06
3 changed files with 61 additions and 23 deletions

View file

@ -79,6 +79,16 @@ struct media_codec_audio_info {
uint32_t channels;
};
struct codec_qos {
uint32_t interval;
bool framing;
char *phy;
uint16_t sdu;
uint8_t retransmission;
uint16_t latency;
uint32_t delay;
};
struct media_codec {
enum spa_bluetooth_audio_codec id;
uint8_t codec_id;
@ -109,6 +119,9 @@ struct media_codec {
int (*validate_config) (const struct media_codec *codec, uint32_t flags,
const void *caps, size_t caps_size,
struct spa_audio_info *info);
void (*get_qos)(const struct media_codec *codec,
const void *config, size_t config_size,
struct codec_qos *qos);
/** qsort comparison sorting caps in order of preference for the codec.
* Used in codec switching to select best remote endpoints.