mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 15:14:33 +02:00
add source handle the delay report
This commit is contained in:
@@ -171,6 +171,13 @@ typedef union {
|
|||||||
uint16_t delay_value; /*!< delay report value */
|
uint16_t delay_value; /*!< delay report value */
|
||||||
} a2d_get_delay_value_stat; /*!< A2DP sink get delay report value status */
|
} a2d_get_delay_value_stat; /*!< A2DP sink get delay report value status */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief ESP_A2D_REPORT_SNK_DELAY_VALUE_EVT
|
||||||
|
*/
|
||||||
|
struct a2d_report_delay_stat_param {
|
||||||
|
uint16_t delay_value; /*!< delay report value */
|
||||||
|
} a2d_report_delay_value_stat; /*!< A2DP source received sink report value status */
|
||||||
|
|
||||||
} esp_a2d_cb_param_t;
|
} esp_a2d_cb_param_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -979,10 +979,11 @@ void bta_av_co_audio_drop(tBTA_AV_HNDL hndl)
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void bta_av_co_audio_delay(tBTA_AV_HNDL hndl, UINT16 delay)
|
void bta_av_co_audio_delay(tBTA_AV_HNDL hndl, UINT16 delay)
|
||||||
{
|
{
|
||||||
// todo
|
|
||||||
FUNC_TRACE();
|
FUNC_TRACE();
|
||||||
|
|
||||||
APPL_TRACE_ERROR("bta_av_co_audio_delay handle: x%x, delay:0x%x", hndl, delay);
|
btc_source_report_delay_value(delay);
|
||||||
|
|
||||||
|
APPL_TRACE_DEBUG("bta_av_co_audio_delay handle: x%x, delay:0x%x", hndl, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -424,7 +424,6 @@ void btc_a2dp_source_set_tx_flush(BOOLEAN enable)
|
|||||||
** Returns
|
** Returns
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
void btc_a2dp_source_setup_codec(void)
|
void btc_a2dp_source_setup_codec(void)
|
||||||
{
|
{
|
||||||
tBTC_AV_MEDIA_FEEDINGS media_feeding;
|
tBTC_AV_MEDIA_FEEDINGS media_feeding;
|
||||||
@@ -617,6 +616,30 @@ BOOLEAN btc_a2dp_source_tx_flush_req(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
**
|
||||||
|
** Function btc_source_report_delay_value
|
||||||
|
**
|
||||||
|
** Description
|
||||||
|
**
|
||||||
|
** Returns
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
void btc_source_report_delay_value(UINT16 delay_value)
|
||||||
|
{
|
||||||
|
esp_a2d_cb_param_t param;
|
||||||
|
|
||||||
|
#if A2D_DYNAMIC_MEMORY == TRUE
|
||||||
|
if (a2dp_source_local_param_ptr == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
param.a2d_report_delay_value_stat.delay_value = delay_value;
|
||||||
|
|
||||||
|
btc_aa_cb_to_app(ESP_A2D_REPORT_SNK_DELAY_VALUE_EVT, ¶m);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
** BTC ADAPTATION
|
** BTC ADAPTATION
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
@@ -231,6 +231,15 @@ void btc_a2dp_source_set_tx_flush(BOOLEAN enable);
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
void btc_a2dp_source_encoder_update(void);
|
void btc_a2dp_source_encoder_update(void);
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
**
|
||||||
|
** Function btc_source_report_delay_value
|
||||||
|
**
|
||||||
|
** Description Report sink delay report value
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
void btc_source_report_delay_value(UINT16 delay_value);
|
||||||
|
|
||||||
#endif /* #if BTC_AV_SRC_INCLUDED */
|
#endif /* #if BTC_AV_SRC_INCLUDED */
|
||||||
|
|
||||||
#endif /* __BTC_A2DP_SOURCE_H__ */
|
#endif /* __BTC_A2DP_SOURCE_H__ */
|
||||||
|
@@ -872,12 +872,14 @@ void avdt_scb_init_open_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
|
|||||||
tAVDT_EVT_HDR single;
|
tAVDT_EVT_HDR single;
|
||||||
UNUSED(p_data);
|
UNUSED(p_data);
|
||||||
|
|
||||||
if (!(p_scb->curr_cfg.psc_mask & AVDT_PSC_DELAY_RPT)) {
|
if (p_scb->p_ccb != NULL && p_scb->role == AVDT_CONF_INT) {
|
||||||
/* initiate open */
|
if (!(p_scb->curr_cfg.psc_mask & AVDT_PSC_DELAY_RPT)) {
|
||||||
single.seid = p_scb->peer_seid;
|
/* initiate open */
|
||||||
avdt_scb_event(p_scb, AVDT_SCB_API_OPEN_REQ_EVT, (tAVDT_SCB_EVT *) &single);
|
single.seid = p_scb->peer_seid;
|
||||||
} else {
|
avdt_scb_event(p_scb, AVDT_SCB_API_OPEN_REQ_EVT, (tAVDT_SCB_EVT *) &single);
|
||||||
btu_start_timer(&p_scb->timer_entry, BTU_TTYPE_AVDT_SCB_DELAY_RPT, AVDT_SCB_TC_DELAY_RPT_TOUT);
|
} else {
|
||||||
|
btu_start_timer(&p_scb->timer_entry, BTU_TTYPE_AVDT_SCB_DELAY_RPT, AVDT_SCB_TC_DELAY_RPT_TOUT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1080,12 +1082,17 @@ void avdt_scb_hdl_delay_rpt_cmd (tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
|
|||||||
(tAVDT_CTRL *) &p_data->msg.hdr);
|
(tAVDT_CTRL *) &p_data->msg.hdr);
|
||||||
|
|
||||||
if (p_scb->p_ccb) {
|
if (p_scb->p_ccb) {
|
||||||
avdt_msg_send_rsp(p_scb->p_ccb, AVDT_SIG_DELAY_RPT, &p_data->msg);
|
if (p_scb->cs.cfg.psc_mask & AVDT_PSC_DELAY_RPT) {
|
||||||
if(p_scb->role == AVDT_CONF_INT) {
|
avdt_msg_send_rsp(p_scb->p_ccb, AVDT_SIG_DELAY_RPT, &p_data->msg);
|
||||||
btu_stop_timer(&p_scb->timer_entry);
|
if(p_scb->role == AVDT_CONF_INT) {
|
||||||
/* initiate open */
|
btu_stop_timer(&p_scb->timer_entry);
|
||||||
single.seid = p_scb->peer_seid;
|
/* initiate open */
|
||||||
avdt_scb_event(p_scb, AVDT_SCB_API_OPEN_REQ_EVT, (tAVDT_SCB_EVT *) &single);
|
single.seid = p_scb->peer_seid;
|
||||||
|
avdt_scb_event(p_scb, AVDT_SCB_API_OPEN_REQ_EVT, (tAVDT_SCB_EVT *) &single);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
p_data->msg.hdr.err_code = AVDT_ERR_NSC;
|
||||||
|
avdt_msg_send_rej(p_scb->p_ccb, AVDT_SIG_DELAY_RPT, &p_data->msg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
avdt_scb_rej_not_in_use(p_scb, p_data);
|
avdt_scb_rej_not_in_use(p_scb, p_data);
|
||||||
|
Reference in New Issue
Block a user