Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85e058b5 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

AVRC uses the same mtu

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I365e3ab3a2f7ee223e9242c2643ce51235a02d6b
parent 753104d5
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -132,7 +132,6 @@ const uint8_t bta_av_meta_caps_evt_ids_avrcp13[] = {
/* This configuration to be used when we are Src + TG + CT( only for abs vol) */
const tBTA_AV_CFG bta_av_cfg = {
    BTA_AV_RC_COMP_ID,     /* AVRCP Company ID */
    512,                   /* AVRCP MTU at L2CAP for control channel */
    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 */
@@ -158,7 +157,6 @@ const tBTA_AV_CFG bta_av_cfg = {
 */
const tBTA_AV_CFG bta_avk_cfg = {
    AVRC_CO_METADATA,      /* AVRCP Company ID */
    512,                   /* AVRCP MTU at L2CAP for control channel */
    BTA_AV_MAX_RC_BR_MTU,  /* AVRCP MTU at L2CAP for browsing channel */
    BTA_AVK_RC_SUPF_CT,    /* AVRCP controller categories */
    BTA_AVK_RC_SUPF_TG,    /* AVRCP target categories */
@@ -182,7 +180,6 @@ const tBTA_AV_CFG bta_avk_cfg = {
/* This configuration to be used when we are using AVRCP1.3 */
const tBTA_AV_CFG bta_av_cfg_compatibility = {
    BTA_AV_RC_COMP_ID,     /* AVRCP Company ID */
    512,                   /* AVRCP MTU at L2CAP for control channel */
    BTA_AV_MAX_RC_BR_MTU,  /* AVRCP MTU at L2CAP for browsing channel */
    BTA_AV_RC_SUPF_CT,     /* AVRCP controller categories */
    AVRC_SUPF_TG_CAT1,     /* Only support CAT1 for AVRCP1.3 */
+2 −2
Original line number Diff line number Diff line
@@ -472,7 +472,7 @@ static void bta_av_api_register(tBTA_AV_DATA* p_data) {
      if (bta_av_cb.features & (BTA_AV_FEAT_RCTG)) {
        /* register with no authorization; let AVDTP use authorization instead
         */
        bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu);
        bta_ar_reg_avct(kAvrcMtu, p_bta_av_cfg->avrc_br_mtu);

        /* For the Audio Sink role we support additional TG to support
         * absolute volume.
@@ -619,7 +619,7 @@ static void bta_av_api_register(tBTA_AV_DATA* p_data) {
      if (bta_av_cb.features & (BTA_AV_FEAT_RCCT)) {
        /* if TG is not supported, we need to register to AVCT now */
        if ((bta_av_cb.features & (BTA_AV_FEAT_RCTG)) == 0) {
          bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu);
          bta_ar_reg_avct(kAvrcMtu, p_bta_av_cfg->avrc_br_mtu);
          bta_av_rc_create(&bta_av_cb, AVCT_ACP, 0, BTA_AV_NUM_LINKS + 1);
        }
        /* create an SDP record as AVRC CT. We create 1.3 for SOURCE
+2 −1
Original line number Diff line number Diff line
@@ -373,10 +373,11 @@ struct tBTA_AV_SCB;
union tBTA_AV_DATA;
typedef void (*tBTA_AV_ACT)(tBTA_AV_SCB* p_cb, tBTA_AV_DATA* p_data);

constexpr uint16_t kAvrcMtu = 512; /* AVRCP MTU at L2CAP for control channel */

/* AV configuration structure */
typedef struct {
  uint32_t company_id;  /* AVRCP Company ID */
  uint16_t avrc_mtu;    /* AVRCP MTU at L2CAP for control channel */
  uint16_t avrc_br_mtu; /* AVRCP MTU at L2CAP for browsing channel */
  uint16_t avrc_ct_cat; /* AVRCP controller categories */
  uint16_t avrc_tg_cat; /* AVRCP target categories */