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

Commit 15d391c5 authored by Myles Watson's avatar Myles Watson Committed by Automerger Merge Worker
Browse files

Merge changes I6f3dcbf6,Ie9f5084d,Id1d81158 into main am: b195e2aa

parents 088729eb b195e2aa
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -47,11 +47,6 @@ typedef struct {
  float gain;
} BtifAvrcpAudioTrack;

#if (DUMP_PCM_DATA == TRUE)
FILE* outputPcmSampleFile;
char outputFilename[50] = "/data/misc/bluedroid/output_sample.pcm";
#endif

// Maximum track gain that can be set.
constexpr float kMaxTrackGain = 1.0f;
// Minimum track gain that can be set.
@@ -130,9 +125,6 @@ void* BtifAvrcpAudioTrackCreate(int trackFreq, int bitsPerSample,
  trackHolder->gain = kMaxTrackGain;
  trackHolder->buffer = new float[trackHolder->bufferLength]();

#if (DUMP_PCM_DATA == TRUE)
  outputPcmSampleFile = fopen(outputFilename, "ab");
#endif
  s_AudioEngine.trackFreq = trackFreq;
  s_AudioEngine.channelCount = channelCount;
  s_AudioEngine.trackHandle = (void*)trackHolder;
@@ -176,13 +168,6 @@ void BtifAvrcpAudioTrackDelete(void* handle) {
    delete trackHolder->buffer;
    delete trackHolder;
  }

#if (DUMP_PCM_DATA == TRUE)
  if (outputPcmSampleFile) {
    fclose(outputPcmSampleFile);
  }
  outputPcmSampleFile = NULL;
#endif
}

void BtifAvrcpAudioTrackPause(void* handle) {
@@ -279,11 +264,6 @@ int BtifAvrcpAudioTrackWriteData(void* handle, void* audioBuffer,
  CHECK(trackHolder != NULL);
  CHECK(trackHolder->stream != NULL);
  aaudio_result_t retval = -1;
#if (DUMP_PCM_DATA == TRUE)
  if (outputPcmSampleFile) {
    fwrite((audioBuffer), 1, (size_t)bufferLength, outputPcmSampleFile);
  }
#endif

  size_t sampleSize = sampleSizeFor(trackHolder);
  int transcodedCount = 0;
+0 −19
Original line number Diff line number Diff line
@@ -448,11 +448,7 @@
   Prefer greater than 0 second, and no less than default inactivity link idle
   timer(L2CAP_LINK_INACTIVITY_TOUT) in l2cap) */
#ifndef SMP_LINK_TOUT_MIN
#if (L2CAP_LINK_INACTIVITY_TOUT > 0)
#define SMP_LINK_TOUT_MIN L2CAP_LINK_INACTIVITY_TOUT
#else
#define SMP_LINK_TOUT_MIN 2
#endif
#endif
/******************************************************************************
 *
@@ -581,11 +577,6 @@
#define PORT_TX_BUF_CRITICAL_WM 15
#endif

/* The RFCOMM multiplexer preferred flow control mechanism. */
#ifndef PORT_FC_DEFAULT
#define PORT_FC_DEFAULT PORT_FC_CREDIT
#endif

/******************************************************************************
 *
 * BNEP
@@ -790,16 +781,6 @@
#define AVCT_NUM_CONN 14  // 2 * MaxDevices + 2
#endif

/******************************************************************************
 *
 * AVRCP
 *
 *****************************************************************************/

#ifndef DUMP_PCM_DATA
#define DUMP_PCM_DATA FALSE
#endif

/******************************************************************************
 *
 * BTA
+2 −12
Original line number Diff line number Diff line
@@ -320,8 +320,7 @@ void PORT_ParNegInd(tRFC_MCB* p_mcb, uint8_t dlci, uint16_t mtu, uint8_t cl,
   */
  /* already defined for this mux, we respond with that value. */
  if (p_mcb->flow == PORT_FC_UNDEFINED) {
    if ((PORT_FC_DEFAULT == PORT_FC_TS710) ||
        (cl == RFCOMM_PN_CONV_LAYER_TYPE_1)) {
    if (cl == RFCOMM_PN_CONV_LAYER_TYPE_1) {
      p_mcb->flow = PORT_FC_TS710;
    } else {
      p_mcb->flow = PORT_FC_CREDIT;
@@ -380,16 +379,7 @@ void PORT_ParNegCnf(tRFC_MCB* p_mcb, uint8_t dlci, uint16_t mtu, uint8_t cl,

  /* Flow control mechanism not set yet.  Negotiate flow control mechanism. */
  if (p_mcb->flow == PORT_FC_UNDEFINED) {
    /* Our stack is configured for TS07.10 and they responded with credit-based.
     */
    /* This is illegal-- negotiation fails. */
    if ((PORT_FC_DEFAULT == PORT_FC_TS710) &&
        (cl == RFCOMM_PN_CONV_LAYER_CBFC_R)) {
      log::warn("negotiation fails, index={}", p_port->handle);
      rfc_send_disc(p_mcb, p_port->dlci);
      rfc_port_closed(p_port);
      return;
    } else if (cl == RFCOMM_PN_CONV_LAYER_CBFC_R) {
    if (cl == RFCOMM_PN_CONV_LAYER_CBFC_R) {
      // Our stack is configured for credit-based and they responded with
      // credit-based.
      p_mcb->flow = PORT_FC_CREDIT;
+4 −4
Original line number Diff line number Diff line
@@ -147,10 +147,10 @@ void RFCOMM_ParameterNegotiationRequest(tRFC_MCB* p_mcb, uint8_t dlci,
    return;
  }

  /* Negotiate the flow control mechanism.  If flow control mechanism for */
  /* mux has not been set yet, use our default value.  If it has been set, */
  /* use that value. */
  flow = (p_mcb->flow == PORT_FC_UNDEFINED) ? PORT_FC_DEFAULT : p_mcb->flow;
  /* Negotiate the flow control mechanism.  If flow control mechanism for the
   * mux has not been set yet, use credits.  If it has been set, use that value.
   */
  flow = (p_mcb->flow == PORT_FC_UNDEFINED) ? PORT_FC_CREDIT : p_mcb->flow;

  /* Set convergence layer and number of credits (k) */
  if (flow == PORT_FC_CREDIT) {