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

Commit c3209687 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Remove multiplexing capability in AVDTP

Remove code guarded by AVDT_MULTIPLEXING.
This functionality is not used, and appears broken.

Test: code compilation and A2DP streaming
Change-Id: Ib87a905c61cff6b3b41d1858b90666d846847d0d
parent daba1449
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -1884,10 +1884,6 @@ void bta_av_getcap_results (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
    APPL_TRACE_DEBUG("%s: num_codec %d", __func__, p_scb->p_cap->num_codec);
    APPL_TRACE_DEBUG("%s: media type x%x, x%x", __func__, media_type,
                     p_scb->media_type);
#if AVDT_MULTIPLEXING == TRUE
    APPL_TRACE_DEBUG("%s: mux x%x, x%x", __func__, cfg.mux_mask,
                     p_scb->p_cap->mux_mask);
#endif

    /* if codec present and we get a codec configuration */
    if ((p_scb->p_cap->num_codec != 0) &&
@@ -1896,10 +1892,6 @@ void bta_av_getcap_results (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
                              &p_scb->sep_info_idx, p_info->seid,
                              &cfg.num_protect, cfg.protect_info) ==
         A2DP_SUCCESS)) {
#if AVDT_MULTIPLEXING == TRUE
        cfg.mux_mask &= p_scb->p_cap->mux_mask;
        APPL_TRACE_DEBUG("%s: mux_mask used x%x", __func__, cfg.mux_mask);
#endif
        /* save copy of codec configuration */
        memcpy(&p_scb->cfg, &cfg, sizeof(tAVDT_CFG));

+0 −3
Original line number Diff line number Diff line
@@ -570,9 +570,6 @@ static void bta_av_api_register(tBTA_AV_DATA *p_data)
            {
                cs.cfg.psc_mask |= AVDT_PSC_REPORT;
                cs.p_report_cback = bta_av_a2dp_report_cback;
#if (AVDT_MULTIPLEXING == TRUE)
                cs.cfg.mux_tsid_report = 2;
#endif
            }
#endif
            if(bta_av_cb.features & BTA_AV_FEAT_DELAY_RPT)
+0 −15
Original line number Diff line number Diff line
@@ -256,11 +256,6 @@
#define AVDT_CMD_BUF_SIZE               BT_SMALL_BUFFER_SIZE
#endif

/* AVDTP buffer size for media packets in case of fragmentation */
#ifndef AVDT_DATA_BUF_SIZE
#define AVDT_DATA_BUF_SIZE              BT_DEFAULT_BUFFER_SIZE
#endif

#ifndef PAN_BUF_SIZE
#define PAN_BUF_SIZE                    BT_DEFAULT_BUFFER_SIZE
#endif
@@ -1135,11 +1130,6 @@
#define AVDT_REPORTING              TRUE
#endif

/* Include multiplexing capability in AVDTP */
#ifndef AVDT_MULTIPLEXING
#define AVDT_MULTIPLEXING           TRUE
#endif

/* Number of simultaneous links to different peer devices. */
#ifndef AVDT_NUM_LINKS
#define AVDT_NUM_LINKS              2
@@ -1165,11 +1155,6 @@
#define AVDT_PROTECT_SIZE           90
#endif

/* Maximum number of buffers in the fragment queue (for video frames). */
#ifndef AVDT_MAX_FRAG_COUNT
#define AVDT_MAX_FRAG_COUNT         15
#endif

/******************************************************************************
**
** PAN
+0 −69
Original line number Diff line number Diff line
@@ -1065,49 +1065,6 @@ uint16_t AVDT_GetSignalChannel(uint8_t handle, BD_ADDR bd_addr)
    return (lcid);
}

#if (AVDT_MULTIPLEXING == TRUE)
/*******************************************************************************
**
** Function         AVDT_SetMediaBuf
**
** Description      Assigns buffer for media packets or forbids using of assigned
**                  buffer if argument p_buf is NULL. This function can only
**                  be called if the stream is a SNK.
**
**                  AVDTP uses this buffer to reassemble fragmented media packets.
**                  When AVDTP receives a complete media packet, it calls the
**                  p_sink_media_cback assigned by AVDT_CreateStream().
**                  This function can be called during callback to assign a
**                  different buffer for next media packet or can leave the current
**                  buffer for next packet.
**
** Returns          AVDT_SUCCESS if successful, otherwise error.
**
*******************************************************************************/
extern uint16_t AVDT_SetMediaBuf(uint8_t handle, uint8_t *p_buf, uint32_t buf_len)
{
    tAVDT_SCB       *p_scb;
    uint16_t        result = AVDT_SUCCESS;

    /* map handle to scb */
    if ((p_scb = avdt_scb_by_hdl(handle)) == NULL)
    {
        result = AVDT_BAD_HANDLE;
    }
    else
    {
        if (p_buf && p_scb->cs.p_sink_media_cback == NULL) {
            result = AVDT_NO_RESOURCES;
        } else {
            p_scb->p_media_buf = p_buf;
            p_scb->media_buf_len = buf_len;
        }
    }

    return result;
}
#endif

#if (AVDT_REPORTING == TRUE)
/*******************************************************************************
**
@@ -1127,9 +1084,6 @@ uint16_t AVDT_SendReport(uint8_t handle, AVDT_REPORT_TYPE type,
    uint16_t        result = AVDT_BAD_PARAMS;
    tAVDT_TC_TBL    *p_tbl;
    uint8_t         *p, *plen, *pm1, *p_end;
#if (AVDT_MULTIPLEXING == TRUE)
    uint8_t         *p_al=NULL, u;
#endif
    uint32_t ssrc;
    uint16_t len;

@@ -1149,14 +1103,6 @@ uint16_t AVDT_SendReport(uint8_t handle, AVDT_REPORT_TYPE type,

            p_pkt->offset = L2CAP_MIN_OFFSET;
            p = (uint8_t *)(p_pkt + 1) + p_pkt->offset;
#if (AVDT_MULTIPLEXING == TRUE)
            if(p_scb->curr_cfg.psc_mask & AVDT_PSC_MUX)
            {
                /* Adaptation Layer header later */
                p_al = p;
                p += 2;
            }
#endif
            pm1 = p;
            *p++ = AVDT_MEDIA_OCTET1 | 1;
            *p++ = type;
@@ -1203,21 +1149,6 @@ uint16_t AVDT_SendReport(uint8_t handle, AVDT_REPORT_TYPE type,
            len = p - pm1 - 1;
            UINT16_TO_BE_STREAM(plen, len);

#if (AVDT_MULTIPLEXING == TRUE)
            if(p_scb->curr_cfg.psc_mask & AVDT_PSC_MUX)
            {
                /* Adaptation Layer header */
                p = p_al;
                len++;
                UINT16_TO_BE_STREAM(p_al, len );
                /* TSID, no-fragment bit and coding of length(9-bit length field) */
                u = *p;
                *p = (p_scb->curr_cfg.mux_tsid_report<<3) | AVDT_ALH_LCODE_9BITM0;
                if(u)
                    *p |= AVDT_ALH_LCODE_9BITM1;
            }
#endif

            /* set the actual payload length */
            p_pkt->len = p_end - p;
            /* send the packet */
+0 −31
Original line number Diff line number Diff line
@@ -56,17 +56,6 @@ enum {
};

/* protocol service capabilities of this AVDTP implementation */
/* for now multiplexing will be used only for fragmentation */
#if (AVDT_MULTIPLEXING == TRUE && AVDT_REPORTING == TRUE)
#define AVDT_PSC                (AVDT_PSC_TRANS | AVDT_PSC_MUX | AVDT_PSC_REPORT | AVDT_PSC_DELAY_RPT)
#define AVDT_LEG_PSC            (AVDT_PSC_TRANS | AVDT_PSC_MUX | AVDT_PSC_REPORT)
#else /* AVDT_MULTIPLEXING && AVDT_REPORTING  */

#if (AVDT_MULTIPLEXING == TRUE)
#define AVDT_PSC                (AVDT_PSC_TRANS | AVDT_PSC_MUX | AVDT_PSC_DELAY_RPT)
#define AVDT_LEG_PSC            (AVDT_PSC_TRANS | AVDT_PSC_MUX)
#else /* AVDT_MULTIPLEXING */

#if (AVDT_REPORTING == TRUE)
#define AVDT_PSC                (AVDT_PSC_TRANS | AVDT_PSC_REPORT | AVDT_PSC_DELAY_RPT)
#define AVDT_LEG_PSC            (AVDT_PSC_TRANS | AVDT_PSC_REPORT)
@@ -75,10 +64,6 @@ enum {
#define AVDT_LEG_PSC            (AVDT_PSC_TRANS)
#endif /* AVDT_REPORTING  */

#endif /* AVDT_MULTIPLEXING */

#endif /* AVDT_MULTIPLEXING && AVDT_REPORTING  */

/* initiator/acceptor signaling roles */
#define AVDT_CLOSE_ACP          0
#define AVDT_CLOSE_INT          1
@@ -94,9 +79,6 @@ enum {
/* to distinguish CCB events from SCB events */
#define AVDT_CCB_MKR            0x80

/* offset where AVDTP signaling message header starts in message  */
#define AVDT_HDR_OFFSET         (L2CAP_MIN_OFFSET + AVDT_NUM_SEPS)

/* offset where AVDTP signaling message content starts;
** use the size of a start header since it's the largest possible
** layout of signaling message in a buffer is:
@@ -461,10 +443,6 @@ typedef void (*tAVDT_CCB_ACTION)(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
typedef struct {
    BT_HDR      *p_buf;
    uint32_t    time_stamp;
#if (AVDT_MULTIPLEXING == TRUE)
    uint8_t     *p_data;
    uint32_t    data_len;
#endif
    uint8_t     m_pt;
    tAVDT_DATA_OPT_MASK     opt;
} tAVDT_SCB_APIWRITE;
@@ -505,14 +483,6 @@ typedef struct {
    uint8_t         curr_evt;       /* current event; set only by state machine */
    bool            cong;           /* Whether media transport channel is congested */
    uint8_t         close_code;     /* Error code received in close response */
#if (AVDT_MULTIPLEXING == TRUE)
    fixed_queue_t   *frag_q;        /* Queue for outgoing media fragments */
    uint32_t        frag_off;       /* length of already received media fragments */
    uint32_t        frag_org_len;   /* original length before fragmentation of receiving media packet */
    uint8_t         *p_next_frag;   /* next fragment to send */
    uint8_t         *p_media_buf;   /* buffer for media packet assigned by AVDT_SetMediaBuf */
    uint32_t        media_buf_len;  /* length of buffer for media packet assigned by AVDT_SetMediaBuf */
#endif
} tAVDT_SCB;

/* type for action functions */
@@ -680,7 +650,6 @@ extern void avdt_scb_clr_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_transport_channel_timer(tAVDT_SCB *p_scb,
                                             tAVDT_SCB_EVT *p_data);
extern void avdt_scb_clr_vars(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
extern void avdt_scb_queue_frags(tAVDT_SCB *p_scb, uint8_t **pp_data, uint32_t *p_data_len);

/* msg function declarations */
extern bool    avdt_msg_send(tAVDT_CCB *p_ccb, BT_HDR *p_msg);
Loading