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

Commit c3bc8ada authored by Robert Dalton's avatar Robert Dalton Committed by Android (Google) Code Review
Browse files

Merge changes from topic "bt-controller-low-latency" into tm-qpr-dev

* changes:
  Support setting BT controller Low Latency mode(2/2)
  Support setting BT controller Low Latency mode(1/2)
parents f9001f6c 9a115540
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ BluetoothAudioCtrlAck A2dpTransport::StartRequest(bool is_low_latency) {
     * procedure is completed, othewise send it now.
     */
    a2dp_pending_cmd_ = A2DP_CTRL_CMD_START;
    btif_av_stream_start();
    btif_av_stream_start_with_latency(is_low_latency);
    if (btif_av_get_peer_sep() != AVDT_TSEP_SRC) {
      LOG(INFO) << __func__ << ": accepted";
      return a2dp_ack_to_bt_audio_ctrl_ack(A2DP_CTRL_ACK_PENDING);
@@ -139,6 +139,10 @@ void A2dpTransport::StopRequest() {
  btif_av_stream_stop(RawAddress::kEmpty);
}

void A2dpTransport::SetLowLatency(bool is_low_latency) {
  btif_av_set_low_latency(is_low_latency);
}

bool A2dpTransport::GetPresentationPosition(uint64_t* remote_delay_report_ns,
                                            uint64_t* total_bytes_read,
                                            timespec* data_position) {
+3 −1
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ class A2dpTransport

  void StopRequest() override;

  void SetLowLatency(bool is_low_latency) override;

  bool GetPresentationPosition(uint64_t* remote_delay_report_ns,
                               uint64_t* total_bytes_read,
                               timespec* data_position) override;
+2 −1
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ ndk::ScopedAStatus BluetoothAudioPortImpl::setLatencyMode(
    LatencyMode latency_mode) {
  bool is_low_latency = latency_mode == LatencyMode::LOW_LATENCY ? true : false;
  invoke_switch_buffer_size_cb(is_low_latency);
  transport_instance_->SetLowLatency(is_low_latency);
  return ndk::ScopedAStatus::ok();
}

+3 −1
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@ class HearingAidTransport
    }
  }

  void SetLowLatency(bool is_low_latency) override {}

  bool GetPresentationPosition(uint64_t* remote_delay_report_ns,
                               uint64_t* total_bytes_read,
                               timespec* data_position) override {
+11 −1
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ void LeAudioTransport::StopRequest() {
  }
}

void LeAudioTransport::SetLowLatency(bool is_low_latency) {}

bool LeAudioTransport::GetPresentationPosition(uint64_t* remote_delay_report_ns,
                                               uint64_t* total_bytes_processed,
                                               timespec* data_position) {
@@ -244,6 +246,10 @@ BluetoothAudioCtrlAck LeAudioSinkTransport::SuspendRequest() {

void LeAudioSinkTransport::StopRequest() { transport_->StopRequest(); }

void LeAudioSinkTransport::SetLowLatency(bool is_low_latency) {
  transport_->SetLowLatency(is_low_latency);
}

bool LeAudioSinkTransport::GetPresentationPosition(
    uint64_t* remote_delay_report_ns, uint64_t* total_bytes_read,
    timespec* data_position) {
@@ -327,6 +333,10 @@ BluetoothAudioCtrlAck LeAudioSourceTransport::SuspendRequest() {

void LeAudioSourceTransport::StopRequest() { transport_->StopRequest(); }

void LeAudioSourceTransport::SetLowLatency(bool is_low_latency) {
  transport_->SetLowLatency(is_low_latency);
}

bool LeAudioSourceTransport::GetPresentationPosition(
    uint64_t* remote_delay_report_ns, uint64_t* total_bytes_written,
    timespec* data_position) {
Loading