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

Commit c92891b0 authored by Chen Chen's avatar Chen Chen Committed by Gerrit Code Review
Browse files

Merge "Spatial Audio: Add audio HAL interface for allowing or disallowing low latency audio"

parents be26ac98 2fb6ce30
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -137,6 +137,16 @@ void set_remote_delay(uint16_t delay_report) {
  aidl::a2dp::set_remote_delay(delay_report);
}

// Set low latency buffer mode allowed or disallowed
bool set_audio_low_latency_mode_allowed(bool allowed){
  if (HalVersionManager::GetHalTransport() ==
      BluetoothAudioHalTransport::HIDL) {
    hidl::a2dp::set_low_latency_mode_allowed(allowed);
    return true;
  }
  return false;
}

}  // namespace a2dp
}  // namespace audio
}  // namespace bluetooth
+3 −0
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ void cleanup();
// Set up the codec into BluetoothAudio HAL
bool setup_codec();

// Set low latency buffer mode allowed or disallowed
bool set_audio_low_latency_mode_allowed(bool allowed);

// Send command to the BluetoothAudio HAL: StartSession, EndSession,
// StreamStarted, StreamSuspended
void start_session();
+5 −0
Original line number Diff line number Diff line
@@ -244,6 +244,11 @@ void end_session() {
  remote_delay_report_ = 0;
}

bool set_audio_low_latency_mode_allowed(bool allowed){
  return true;
}


void ack_stream_started(const tA2DP_CTRL_ACK& ack) {
  a2dp_pending_cmd_ = A2DP_CTRL_CMD_NONE;
  // TODO: Notify server
+9 −0
Original line number Diff line number Diff line
@@ -553,6 +553,15 @@ void set_remote_delay(uint16_t delay_report) {
      ->SetRemoteDelay(delay_report);
}

// Set low latency buffer mode allowed or disallowed
void set_low_latency_mode_allowed(bool allowed) {
  if (!is_hal_2_0_enabled()) {
    LOG(ERROR) << __func__ << ": BluetoothAudio HAL is not enabled";
    return;
  }
  active_hal_interface->SetLowLatencyModeAllowed(allowed);
}

}  // namespace a2dp
}  // namespace hidl
}  // namespace audio
+3 −0
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@ size_t read(uint8_t* p_buf, uint32_t len);
// Update A2DP delay report to BluetoothAudio HAL
void set_remote_delay(uint16_t delay_report);

// Set low latency buffer mode allowed or disallowed
void set_low_latency_mode_allowed(bool allowed);

}  // namespace a2dp
}  // namespace hidl
}  // namespace audio
Loading