components/bt: Choose AVRC category according to A2DP role

This commit is contained in:
baohongde 2019-12-31 15:31:54 +08:00
parent 6916052e6d
commit b3f58ed2a1
3 changed files with 29 additions and 13 deletions

View file

@ -40,8 +40,9 @@ const UINT32 bta_av_meta_caps_co_ids[] = {
AVRC_CO_BROADCOM
};
/* AVRCP cupported categories */
#define BTA_AV_RC_SUPF_CT (AVRC_SUPF_CT_CAT2)
/* AVRCP supported categories */
#define BTA_AV_RC_SNK_SUPF_CT (AVRC_SUPF_CT_CAT1)
#define BTA_AV_RC_SRC_SUPF_CT (AVRC_SUPF_CT_CAT2)
/* Added to modify
** 1. flush timeout
@ -62,9 +63,11 @@ const UINT16 bta_av_audio_flush_to[] = {
/* Note: Android doesnt support AVRC_SUPF_TG_GROUP_NAVI */
/* Note: if AVRC_SUPF_TG_GROUP_NAVI is set, bta_av_cfg.avrc_group should be TRUE */
#if AVRC_METADATA_INCLUDED == TRUE
#define BTA_AV_RC_SUPF_TG (AVRC_SUPF_TG_CAT1) /* TODO: | AVRC_SUPF_TG_APP_SETTINGS) */
#define BTA_AV_RC_SNK_SUPF_TG (AVRC_SUPF_TG_CAT2) /* TODO: | AVRC_SUPF_TG_APP_SETTINGS) */
#define BTA_AV_RC_SRC_SUPF_TG (AVRC_SUPF_TG_CAT1) /* TODO: | AVRC_SUPF_TG_APP_SETTINGS) */
#else
#define BTA_AV_RC_SUPF_TG (AVRC_SUPF_TG_CAT1)
#define BTA_AV_RC_SNK_SUPF_TG (AVRC_SUPF_TG_CAT2)
#define BTA_AV_RC_SRC_SUPF_TG (AVRC_SUPF_TG_CAT1)
#endif
/*
@ -95,8 +98,10 @@ const tBTA_AV_CFG bta_av_cfg = {
48, /* AVRCP MTU at L2CAP for control channel */
#endif
BTA_AV_MAX_RC_BR_MTU, /* AVRCP MTU at L2CAP for browsing channel */
BTA_AV_RC_SUPF_CT, /* AVRCP controller categories */
BTA_AV_RC_SUPF_TG, /* AVRCP target categories */
BTA_AV_RC_SNK_SUPF_CT, /* AVRCP controller categories as SNK */
BTA_AV_RC_SNK_SUPF_TG, /* AVRCP target categories as SNK */
BTA_AV_RC_SRC_SUPF_CT, /* AVRCP controller categories as SRC */
BTA_AV_RC_SRC_SUPF_TG, /* AVRCP target categories as SRC */
672, /* AVDTP signaling channel MTU at L2CAP */
BTA_AV_MAX_A2DP_MTU, /* AVDTP audio transport channel MTU at L2CAP */
bta_av_audio_flush_to, /* AVDTP audio transport channel flush timeout */

View file

@ -571,9 +571,13 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu,
(UINT8)(bta_av_cb.sec_mask & (~BTA_SEC_AUTHORIZE)), BTA_ID_AV);
#endif
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target\n", NULL,
p_bta_av_cfg->avrc_tg_cat, BTA_ID_AV);
if (p_data->api_reg.tsep == AVDT_TSEP_SRC) {
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target\n", NULL,
p_bta_av_cfg->avrc_src_tg_cat, BTA_ID_AV);
} else {
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REM_CTRL_TARGET, "AV Remote Control Target\n", NULL,
p_bta_av_cfg->avrc_snk_tg_cat, BTA_ID_AV);
}
#endif
}
@ -707,8 +711,13 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
}
#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
/* create an SDP record as AVRC CT. */
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REMOTE_CONTROL, NULL, NULL,
p_bta_av_cfg->avrc_ct_cat, BTA_ID_AV);
if (p_data->api_reg.tsep == AVDT_TSEP_SRC) {
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REMOTE_CONTROL, "AV Remote Control Controller\n", NULL,
p_bta_av_cfg->avrc_src_ct_cat, BTA_ID_AV);
} else {
bta_ar_reg_avrc(UUID_SERVCLASS_AV_REMOTE_CONTROL, "AV Remote Control Controller\n", NULL,
p_bta_av_cfg->avrc_snk_ct_cat, BTA_ID_AV);
}
#endif
}
}

View file

@ -509,8 +509,10 @@ typedef struct {
UINT32 company_id; /* AVRCP Company ID */
UINT16 avrc_mtu; /* AVRCP MTU at L2CAP for control channel */
UINT16 avrc_br_mtu; /* AVRCP MTU at L2CAP for browsing channel */
UINT16 avrc_ct_cat; /* AVRCP controller categories */
UINT16 avrc_tg_cat; /* AVRCP target categories */
UINT16 avrc_snk_ct_cat; /* AVRCP controller categories as SNK */
UINT16 avrc_snk_tg_cat; /* AVRCP target categories SNK */
UINT16 avrc_src_ct_cat; /* AVRCP controller categories as SRC */
UINT16 avrc_src_tg_cat; /* AVRCP target categories as SRC */
UINT16 sig_mtu; /* AVDTP signaling channel MTU at L2CAP */
UINT16 audio_mtu; /* AVDTP audio transport channel MTU at L2CAP */
const UINT16 *p_audio_flush_to;/* AVDTP audio transport channel flush timeout */