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

Commit 84336e04 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I49269a50,Ic4731fbd into tm-qpr-dev

* changes:
  Check the broadcast offload audio configuraiton and session type
  Set broadcast ISO data path based on the codecLocation
parents da9289e5 192b1dc2
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -201,12 +201,13 @@ bool BluetoothAudioClientInterface::UpdateAudioConfig(
  bool is_a2dp_offload_session =
      (transport_->GetSessionType() ==
       SessionType::A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH);
  bool is_leaudio_offload_session =
  bool is_leaudio_unicast_offload_session =
      (transport_->GetSessionType() ==
           SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
       transport_->GetSessionType() ==
           SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH ||
       transport_->GetSessionType() ==
           SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH);
  bool is_leaudio_broadcast_offload_session =
      (transport_->GetSessionType() ==
       SessionType::LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH);
  auto audio_config_tag = audio_config.getTag();
  bool is_software_audio_config =
@@ -215,11 +216,15 @@ bool BluetoothAudioClientInterface::UpdateAudioConfig(
  bool is_a2dp_offload_audio_config =
      (is_a2dp_offload_session &&
       audio_config_tag == AudioConfiguration::a2dpConfig);
  bool is_leaudio_offload_audio_config =
      (is_leaudio_offload_session &&
  bool is_leaudio_unicast_offload_audio_config =
      (is_leaudio_unicast_offload_session &&
       audio_config_tag == AudioConfiguration::leAudioConfig);
  bool is_leaudio_broadcast_offload_audio_config =
      (is_leaudio_broadcast_offload_session &&
       audio_config_tag == AudioConfiguration::leAudioBroadcastConfig);
  if (!is_software_audio_config && !is_a2dp_offload_audio_config &&
      !is_leaudio_offload_audio_config) {
      !is_leaudio_unicast_offload_audio_config &&
      !is_leaudio_broadcast_offload_audio_config) {
    return false;
  }
  transport_->UpdateAudioConfiguration(audio_config);
+9 −1
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@ using bluetooth::hci::IsoManager;
using bluetooth::hci::iso_manager::big_create_cmpl_evt;
using bluetooth::hci::iso_manager::big_terminate_cmpl_evt;

using le_audio::CodecManager;
using le_audio::types::CodecLocation;

using namespace le_audio::broadcaster;

namespace {
@@ -469,6 +472,11 @@ class BroadcastStateMachineImpl : public BroadcastStateMachine {
     * to the controller. 'codec_id_company' and 'codec_id_vendor' shall be
     * ignored if 'codec_id_format' is not set to 'Vendor'.
     */
    auto data_path_id = bluetooth::hci::iso_manager::kIsoDataPathHci;
    if (CodecManager::GetInstance()->GetCodecLocation() !=
        CodecLocation::HOST) {
      data_path_id = bluetooth::hci::iso_manager::kIsoDataPathPlatformDefault;
    }
    auto codec_id = sm_config_.codec_wrapper.GetLeAudioCodecId();
    uint8_t hci_coding_format =
        (codec_id.coding_format == le_audio::types::kLeAudioCodingFormatLC3)
@@ -476,7 +484,7 @@ class BroadcastStateMachineImpl : public BroadcastStateMachine {
            : bluetooth::hci::kIsoCodingFormatVendorSpecific;
    bluetooth::hci::iso_manager::iso_data_path_params param = {
        .data_path_dir = bluetooth::hci::iso_manager::kIsoDataPathDirectionIn,
        .data_path_id = bluetooth::hci::iso_manager::kIsoDataPathHci,
        .data_path_id = data_path_id,
        .codec_id_format = hci_coding_format,
        .codec_id_company = codec_id.vendor_company_id,
        .codec_id_vendor = codec_id.vendor_codec_id,