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

Commit 8e4c2a1b authored by Pavlin Radoslavov's avatar Pavlin Radoslavov Committed by android-build-merger
Browse files

Set the RTP Header Marker bit selectively per A2DP codec am: c62b5c44

am: 70e3c02d

Change-Id: I477ec3ace25eff48c31bb1f587c75ce80036c8d7
parents 61684856 70e3c02d
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include "avdt_api.h"
#include "bt_utils.h"
#include "bta_av_int.h"
#include "btif/include/btif_av_co.h"
#include "l2c_api.h"
#include "l2cdefs.h"
#include "osi/include/osi.h"
@@ -1024,6 +1025,7 @@ void bta_av_cleanup(tBTA_AV_SCB* p_scb, UNUSED_ATTR tBTA_AV_DATA* p_data) {
  /* if de-registering shut everything down */
  msg.hdr.layer_specific = p_scb->hndl;
  p_scb->started = false;
  p_scb->current_codec = nullptr;
  p_scb->cong = false;
  p_scb->role = role;
  p_scb->cur_psc_mask = 0;
@@ -1454,6 +1456,7 @@ void bta_av_do_close(tBTA_AV_SCB* p_scb, UNUSED_ATTR tBTA_AV_DATA* p_data) {

  /* close stream */
  p_scb->started = false;
  p_scb->current_codec = nullptr;

  /* drop the buffers queued in L2CAP */
  L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
@@ -2095,11 +2098,15 @@ void bta_av_data_path(tBTA_AV_SCB* p_scb, UNUSED_ATTR tBTA_AV_DATA* p_data) {
  BT_HDR* p_buf = NULL;
  uint32_t timestamp;
  bool new_buf = false;
  uint8_t m_pt = AVDT_MARKER_SET | 0x60;
  uint8_t m_pt = 0x60;
  tAVDT_DATA_OPT_MASK opt;

  if (p_scb->cong) return;

  if (p_scb->current_codec->useRtpHeaderMarkerBit()) {
    m_pt |= AVDT_MARKER_SET;
  }

  // Always get the current number of bufs que'd up
  p_scb->l2c_bufs =
      (uint8_t)L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_GET);
@@ -2225,6 +2232,8 @@ void bta_av_start_ok(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
                   p_scb->role);

  p_scb->started = true;
  p_scb->current_codec = bta_av_get_a2dp_current_codec();

  if (p_scb->sco_suspend) {
    p_scb->sco_suspend = false;
  }
+1 −0
Original line number Diff line number Diff line
@@ -482,6 +482,7 @@ typedef struct {
  uint8_t rc_handle; /* connected AVRCP handle */
  bool use_rc;       /* true if AVRCP is allowed */
  bool started;      /* true if stream started */
  A2dpCodecConfig* current_codec; /* The current A2DP codec */
  uint8_t
      co_started;    /* non-zero, if stream started from call-out perspective */
  bool recfg_sup;    /* true if the first attempt to reconfigure the stream was
+2 −0
Original line number Diff line number Diff line
@@ -706,6 +706,8 @@ bool A2dpCodecConfigAac::init() {
  return true;
}

bool A2dpCodecConfigAac::useRtpHeaderMarkerBit() const { return true; }

//
// Selects the best sample rate from |sampleRate|.
// The result is stored in |p_result| and |p_codec_config|.
+7 −0
Original line number Diff line number Diff line
@@ -1056,6 +1056,8 @@ bool A2dpCodecConfigSbc::init() {
  return true;
}

bool A2dpCodecConfigSbc::useRtpHeaderMarkerBit() const { return false; }

//
// Selects the best sample rate from |samp_freq|.
// The result is stored in |p_result| and |p_codec_config|.
@@ -1610,6 +1612,11 @@ bool A2dpCodecConfigSbcSink::init() {
  return true;
}

bool A2dpCodecConfigSbcSink::useRtpHeaderMarkerBit() const {
  // TODO: This method applies only to Source codecs
  return false;
}

bool A2dpCodecConfigSbcSink::setCodecConfig(
    UNUSED_ATTR const uint8_t* p_peer_codec_info,
    UNUSED_ATTR bool is_capability,
+2 −0
Original line number Diff line number Diff line
@@ -436,6 +436,8 @@ bool A2dpCodecConfigAptx::init() {
  return true;
}

bool A2dpCodecConfigAptx::useRtpHeaderMarkerBit() const { return false; }

//
// Selects the best sample rate from |sampleRate|.
// The result is stored in |p_result| and p_codec_config|.
Loading