Bluetooth: Audio: Rename bt_audio_codec_qos -> bt_bap_qos_cfg

The QoS structure is not related to a codec, but rather a
stream, and should thus not use the "Codec" name.

The BAP and ASCS specs refer to the QoS as
"QoS configuration" several places, so it is an obvious
choice for a name.

Since the structure is defined and used by BAP, the prefix
was changed from bt_audio to bt_bap.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2024-08-02 11:23:33 +02:00 committed by Fabio Baltieri
commit dc97bbd35f
50 changed files with 531 additions and 537 deletions

View file

@ -85,7 +85,7 @@ void print_codec_cfg(const struct bt_audio_codec_cfg *codec_cfg)
print_ltv_array("meta", codec_cfg->meta, codec_cfg->meta_len);
}
void print_qos(const struct bt_audio_codec_qos *qos)
void print_qos(const struct bt_bap_qos_cfg *qos)
{
printk("QoS: interval %u framing 0x%02x phy 0x%02x sdu %u "
"rtn %u latency %u pd %u\n",

View file

@ -46,7 +46,7 @@
struct unicast_stream {
struct bt_cap_stream stream;
struct bt_audio_codec_cfg codec_cfg;
struct bt_audio_codec_qos qos;
struct bt_bap_qos_cfg qos;
};
struct named_lc3_preset {
@ -57,7 +57,7 @@ struct named_lc3_preset {
void print_hex(const uint8_t *ptr, size_t len);
void print_codec_cap(const struct bt_audio_codec_cap *codec_cap);
void print_codec_cfg(const struct bt_audio_codec_cfg *codec_cfg);
void print_qos(const struct bt_audio_codec_qos *qos);
void print_qos(const struct bt_bap_qos_cfg *qos);
void copy_unicast_stream_preset(struct unicast_stream *stream,
const struct named_lc3_preset *named_preset);

View file

@ -72,8 +72,7 @@ CREATE_FLAG(flag_stream_stopped);
CREATE_FLAG(flag_stream_released);
CREATE_FLAG(flag_operation_success);
static void stream_configured(struct bt_bap_stream *stream,
const struct bt_audio_codec_qos_pref *pref)
static void stream_configured(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg_pref *pref)
{
printk("Configured stream %p\n", stream);
@ -1197,9 +1196,8 @@ static void test_main_async_group(void)
{
struct bt_bap_stream rx_stream = {0};
struct bt_bap_stream tx_stream = {0};
struct bt_audio_codec_qos rx_qos = BT_AUDIO_CODEC_QOS_UNFRAMED(7500U, 30U, 2U, 75U, 40000U);
struct bt_audio_codec_qos tx_qos =
BT_AUDIO_CODEC_QOS_UNFRAMED(10000U, 40U, 2U, 100U, 40000U);
struct bt_bap_qos_cfg rx_qos = BT_BAP_QOS_CFG_UNFRAMED(7500U, 30U, 2U, 75U, 40000U);
struct bt_bap_qos_cfg tx_qos = BT_BAP_QOS_CFG_UNFRAMED(10000U, 40U, 2U, 100U, 40000U);
struct bt_bap_unicast_group_stream_param rx_param = {
.qos = &rx_qos,
.stream = &rx_stream,

View file

@ -70,8 +70,8 @@ static const struct bt_audio_codec_cap lc3_codec_cap = {
static struct audio_test_stream
test_streams[CONFIG_BT_ASCS_MAX_ASE_SNK_COUNT + CONFIG_BT_ASCS_MAX_ASE_SRC_COUNT];
static const struct bt_audio_codec_qos_pref qos_pref =
BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000);
static const struct bt_bap_qos_cfg_pref qos_pref =
BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000);
static uint8_t unicast_server_addata[] = {
BT_UUID_16_ENCODE(BT_UUID_ASCS_VAL), /* ASCS UUID */
@ -113,7 +113,7 @@ static struct bt_bap_stream *stream_alloc(void)
static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir,
const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream,
struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp)
struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp)
{
printk("ASE Codec Config: conn %p ep %p dir %u\n", conn, ep, dir);
@ -139,7 +139,7 @@ static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_
static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir,
const struct bt_audio_codec_cfg *codec_cfg,
struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp)
struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp)
{
printk("ASE Codec Reconfig: stream %p\n", stream);
@ -150,7 +150,7 @@ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir,
return -ENOEXEC;
}
static int lc3_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos,
static int lc3_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos,
struct bt_bap_ascs_rsp *rsp)
{
struct audio_test_stream *test_stream = audio_test_stream_from_bap_stream(stream);

View file

@ -64,8 +64,8 @@ static struct bt_le_per_adv_sync *pa_sync;
static uint32_t broadcaster_broadcast_id;
static struct audio_test_stream broadcast_sink_streams[CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT];
static const struct bt_audio_codec_qos_pref unicast_qos_pref =
BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0u, 60u, 20000u, 40000u, 20000u, 40000u);
static const struct bt_bap_qos_cfg_pref unicast_qos_pref =
BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0u, 60u, 20000u, 40000u, 20000u, 40000u);
static bool auto_start_sink_streams;
@ -452,7 +452,7 @@ static struct bt_bap_stream *unicast_stream_alloc(void)
static int unicast_server_config(struct bt_conn *conn, const struct bt_bap_ep *ep,
enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg,
struct bt_bap_stream **stream,
struct bt_audio_codec_qos_pref *const pref,
struct bt_bap_qos_cfg_pref *const pref,
struct bt_bap_ascs_rsp *rsp)
{
printk("ASE Codec Config: conn %p ep %p dir %u\n", conn, ep, dir);
@ -478,7 +478,7 @@ static int unicast_server_config(struct bt_conn *conn, const struct bt_bap_ep *e
static int unicast_server_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir,
const struct bt_audio_codec_cfg *codec_cfg,
struct bt_audio_codec_qos_pref *const pref,
struct bt_bap_qos_cfg_pref *const pref,
struct bt_bap_ascs_rsp *rsp)
{
printk("ASE Codec Reconfig: stream %p\n", stream);
@ -493,7 +493,7 @@ static int unicast_server_reconfig(struct bt_bap_stream *stream, enum bt_audio_d
return -ENOEXEC;
}
static int unicast_server_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos,
static int unicast_server_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos,
struct bt_bap_ascs_rsp *rsp)
{
printk("QoS: stream %p qos %p\n", stream, qos);

View file

@ -727,7 +727,7 @@ static int test_cap_initiator_ac(const struct cap_initiator_ac_param *param)
struct bt_cap_initiator_broadcast_create_param create_param = {0};
struct bt_cap_broadcast_source *broadcast_source;
struct bt_audio_codec_cfg codec_cfg;
struct bt_audio_codec_qos qos;
struct bt_bap_qos_cfg qos;
struct bt_le_ext_adv *adv;
int err;

View file

@ -129,7 +129,7 @@ static const struct named_lc3_preset lc3_unicast_presets[] = {
};
static void unicast_stream_configured(struct bt_bap_stream *stream,
const struct bt_audio_codec_qos_pref *pref)
const struct bt_bap_qos_cfg_pref *pref)
{
struct bt_cap_stream *cap_stream = cap_stream_from_bap_stream(stream);
printk("Configured stream %p\n", stream);
@ -902,8 +902,8 @@ static int cap_initiator_ac_create_unicast_group(const struct cap_initiator_ac_p
struct bt_bap_unicast_group_stream_param src_group_stream_params[CAP_AC_MAX_SRC] = {0};
struct bt_bap_unicast_group_stream_pair_param pair_params[CAP_AC_MAX_PAIR] = {0};
struct bt_bap_unicast_group_param group_param = {0};
struct bt_audio_codec_qos *snk_qos[CAP_AC_MAX_SNK];
struct bt_audio_codec_qos *src_qos[CAP_AC_MAX_SRC];
struct bt_bap_qos_cfg *snk_qos[CAP_AC_MAX_SNK];
struct bt_bap_qos_cfg *src_qos[CAP_AC_MAX_SRC];
size_t snk_stream_cnt = 0U;
size_t src_stream_cnt = 0U;
size_t pair_cnt = 0U;

View file

@ -226,7 +226,7 @@ static void stream_sent_cb(struct bt_bap_stream *bap_stream)
}
static void stream_configured_cb(struct bt_bap_stream *stream,
const struct bt_audio_codec_qos_pref *pref)
const struct bt_bap_qos_cfg_pref *pref)
{
printk("Configured stream %p\n", stream);
@ -1203,7 +1203,7 @@ static int test_gmap_ugg_broadcast_ac(const struct gmap_broadcast_ac_param *para
stream_params[GMAP_BROADCAST_AC_MAX_STREAM] = {0};
struct bt_cap_broadcast_source *broadcast_source;
struct bt_audio_codec_cfg codec_cfg;
struct bt_audio_codec_qos qos;
struct bt_bap_qos_cfg qos;
struct bt_le_ext_adv *adv;
int err;

View file

@ -42,8 +42,8 @@ static struct bt_audio_codec_cap codec_cap =
BT_AUDIO_CODEC_CAP_LC3(BT_AUDIO_CODEC_CAP_FREQ_ANY, BT_AUDIO_CODEC_CAP_DURATION_ANY,
BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT(1, 2), 30, 240, 2, CONTEXT);
static const struct bt_audio_codec_qos_pref unicast_qos_pref =
BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0U, 60U, 10000U, 60000U, 10000U, 60000U);
static const struct bt_bap_qos_cfg_pref unicast_qos_pref =
BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0U, 60U, 10000U, 60000U, 10000U, 60000U);
#define UNICAST_CHANNEL_COUNT_1 BIT(0)
@ -112,7 +112,7 @@ static struct bt_bap_stream *unicast_stream_alloc(void)
static int unicast_server_config(struct bt_conn *conn, const struct bt_bap_ep *ep,
enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg,
struct bt_bap_stream **stream,
struct bt_audio_codec_qos_pref *const pref,
struct bt_bap_qos_cfg_pref *const pref,
struct bt_bap_ascs_rsp *rsp)
{
printk("ASE Codec Config: conn %p ep %p dir %u\n", conn, ep, dir);
@ -136,7 +136,7 @@ static int unicast_server_config(struct bt_conn *conn, const struct bt_bap_ep *e
static int unicast_server_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir,
const struct bt_audio_codec_cfg *codec_cfg,
struct bt_audio_codec_qos_pref *const pref,
struct bt_bap_qos_cfg_pref *const pref,
struct bt_bap_ascs_rsp *rsp)
{
printk("ASE Codec Reconfig: stream %p\n", stream);
@ -151,7 +151,7 @@ static int unicast_server_reconfig(struct bt_bap_stream *stream, enum bt_audio_d
return -ENOEXEC;
}
static int unicast_server_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos,
static int unicast_server_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos,
struct bt_bap_ascs_rsp *rsp)
{
printk("QoS: stream %p qos %p\n", stream, qos);