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

Commit eedc7a29 authored by Jakub Tyszkowski's avatar Jakub Tyszkowski Committed by Łukasz Rymanowski
Browse files

LeAudio: Offloader related code encapsulation Part 1

This will be needed for the multi-codec support.

Bug: 295972694
Test: atest bluetooth_le_audio_test bluetooth_le_audio_client_test  bluetooth_test_broadcaster bluetooth_test_broadcaster_state_machine
Change-Id: I785a0f697ca49ec8a54cb7c7ebf3574e03530b90
parent b4f42764
Loading
Loading
Loading
Loading
+27 −20
Original line number Diff line number Diff line
@@ -3053,14 +3053,16 @@ class LeAudioClientImpl : public LeAudioClient {
      return;
    }

    for (auto [cis_handle, audio_location] : stream_conf->sink_streams) {
    for (auto [cis_handle, audio_location] :
         stream_conf->stream_params.sink.stream_locations) {
      if (audio_location & le_audio::codec_spec_conf::kLeAudioLocationAnyLeft)
        left_cis_handle = cis_handle;
      if (audio_location & le_audio::codec_spec_conf::kLeAudioLocationAnyRight)
        right_cis_handle = cis_handle;
    }

    uint16_t byte_count = stream_conf->sink_octets_per_codec_frame;
    uint16_t byte_count =
        stream_conf->stream_params.sink.octets_per_codec_frame;
    bool mix_to_mono = (left_cis_handle == 0) || (right_cis_handle == 0);
    if (mix_to_mono) {
      std::vector<uint8_t> mono = mono_blend(
@@ -3096,8 +3098,9 @@ class LeAudioClientImpl : public LeAudioClient {
  void PrepareAndSendToSingleCis(
      const std::vector<uint8_t>& data,
      struct le_audio::stream_configuration* stream_conf) {
    uint16_t num_channels = stream_conf->sink_num_of_channels;
    uint16_t cis_handle = stream_conf->sink_streams.front().first;
    uint16_t num_channels = stream_conf->stream_params.sink.num_of_channels;
    uint16_t cis_handle =
        stream_conf->stream_params.sink.stream_locations.front().first;

    uint16_t number_of_required_samples_per_channel =
        sw_enc_left->GetNumOfSamplesPerChannel();
@@ -3108,7 +3111,8 @@ class LeAudioClientImpl : public LeAudioClient {
      return;
    }

    uint16_t byte_count = stream_conf->sink_octets_per_codec_frame;
    uint16_t byte_count =
        stream_conf->stream_params.sink.octets_per_codec_frame;
    bool mix_to_mono = (num_channels == 1);
    if (mix_to_mono) {
      /* Since we always get two channels from framework, lets make it mono here
@@ -3133,7 +3137,7 @@ class LeAudioClientImpl : public LeAudioClient {
    const struct le_audio::stream_configuration* stream_conf =
        &group->stream_conf;
    LOG_INFO("group_id: %d", group->group_id_);
    if (stream_conf->sink_streams.size() == 0) {
    if (stream_conf->stream_params.sink.stream_locations.size() == 0) {
      return nullptr;
    }

@@ -3153,15 +3157,15 @@ class LeAudioClientImpl : public LeAudioClient {
    }

    auto stream_conf = group->stream_conf;
    if ((stream_conf.sink_num_of_devices > 2) ||
        (stream_conf.sink_num_of_devices == 0) ||
        stream_conf.sink_streams.empty()) {
    if ((stream_conf.stream_params.sink.num_of_devices > 2) ||
        (stream_conf.stream_params.sink.num_of_devices == 0) ||
        stream_conf.stream_params.sink.stream_locations.empty()) {
      LOG(ERROR) << __func__ << " Stream configufation is not valid.";
      return;
    }

    if ((stream_conf.sink_num_of_devices == 2) ||
        (stream_conf.sink_streams.size() == 2)) {
    if ((stream_conf.stream_params.sink.num_of_devices == 2) ||
        (stream_conf.stream_params.sink.stream_locations.size() == 2)) {
      /* Streaming to two devices or one device with 2 CISes */
      PrepareAndSendToTwoCises(data, &stream_conf);
    } else {
@@ -3193,7 +3197,7 @@ class LeAudioClientImpl : public LeAudioClient {
    uint16_t left_cis_handle = 0;
    uint16_t right_cis_handle = 0;
    for (auto [cis_handle, audio_location] :
         group->stream_conf.source_streams) {
         group->stream_conf.stream_params.source.stream_locations) {
      if (audio_location & le_audio::codec_spec_conf::kLeAudioLocationAnyLeft) {
        left_cis_handle = cis_handle;
      }
@@ -3350,14 +3354,16 @@ class LeAudioClientImpl : public LeAudioClient {
    }

    LOG_DEBUG("Sink stream config (#%d):\n",
              static_cast<int>(stream_conf->sink_streams.size()));
    for (auto stream : stream_conf->sink_streams) {
              static_cast<int>(
                  stream_conf->stream_params.sink.stream_locations.size()));
    for (auto stream : stream_conf->stream_params.sink.stream_locations) {
      LOG_DEBUG("Cis handle: 0x%02x, allocation 0x%04x\n", stream.first,
                stream.second);
    }
    LOG_DEBUG("Source stream config (#%d):\n",
              static_cast<int>(stream_conf->source_streams.size()));
    for (auto stream : stream_conf->source_streams) {
              static_cast<int>(
                  stream_conf->stream_params.source.stream_locations.size()));
    for (auto stream : stream_conf->stream_params.source.stream_locations) {
      LOG_DEBUG("Cis handle: 0x%02x, allocation 0x%04x\n", stream.first,
                stream.second);
    }
@@ -3407,7 +3413,7 @@ class LeAudioClientImpl : public LeAudioClient {
      LeAudioDeviceGroup* group) {
    const struct le_audio::stream_configuration* stream_conf =
        &group->stream_conf;
    if (stream_conf->source_streams.size() == 0) {
    if (stream_conf->stream_params.source.stream_locations.size() == 0) {
      return nullptr;
    }
    LOG_INFO("configuration: %s", stream_conf->conf->name.c_str());
@@ -5022,7 +5028,8 @@ class LeAudioClientImpl : public LeAudioClient {

    const auto* stream_conf = &group->stream_conf;

    if (stream_conf->sink_offloader_changed || stream_conf->sink_is_initial) {
    if (stream_conf->offloader_config.sink.has_changed ||
        stream_conf->offloader_config.sink.is_initial) {
      LOG_INFO("Update sink offloader streams");
      uint16_t remote_delay_ms =
          group->GetRemoteDelay(le_audio::types::kLeAudioDirectionSink);
@@ -5033,8 +5040,8 @@ class LeAudioClientImpl : public LeAudioClient {
      group->StreamOffloaderUpdated(le_audio::types::kLeAudioDirectionSink);
    }

    if (stream_conf->source_offloader_changed ||
        stream_conf->source_is_initial) {
    if (stream_conf->offloader_config.source.has_changed ||
        stream_conf->offloader_config.source.is_initial) {
      LOG_INFO("Update source offloader streams");
      uint16_t remote_delay_ms =
          group->GetRemoteDelay(le_audio::types::kLeAudioDirectionSource);
+23 −16
Original line number Diff line number Diff line
@@ -116,23 +116,27 @@ struct codec_manager_impl {
      const le_audio::stream_configuration& stream_conf, uint16_t delay_ms,
      std::function<void(const ::le_audio::offload_config& config)>
          update_receiver) {
    if (stream_conf.sink_streams.empty()) return;
    if (stream_conf.stream_params.sink.stream_locations.empty()) return;

    if (stream_conf.sink_is_initial ||
    if (stream_conf.offloader_config.sink.is_initial ||
        LeAudioHalVerifier::SupportsStreamActiveApi()) {
      sink_config.stream_map =
          stream_conf.sink_offloader_streams_target_allocation;
          stream_conf.offloader_config.sink.streams_target_allocation;
    } else {
      sink_config.stream_map =
          stream_conf.sink_offloader_streams_current_allocation;
          stream_conf.offloader_config.sink.streams_current_allocation;
    }
    // TODO: set the default value 16 for now, would change it if we support
    // mode bits_per_sample
    sink_config.bits_per_sample = 16;
    sink_config.sampling_rate = stream_conf.sink_sample_frequency_hz;
    sink_config.frame_duration = stream_conf.sink_frame_duration_us;
    sink_config.octets_per_frame = stream_conf.sink_octets_per_codec_frame;
    sink_config.blocks_per_sdu = stream_conf.sink_codec_frames_blocks_per_sdu;
    sink_config.sampling_rate =
        stream_conf.stream_params.sink.sample_frequency_hz;
    sink_config.frame_duration =
        stream_conf.stream_params.sink.frame_duration_us;
    sink_config.octets_per_frame =
        stream_conf.stream_params.sink.octets_per_codec_frame;
    sink_config.blocks_per_sdu =
        stream_conf.stream_params.sink.codec_frames_blocks_per_sdu;
    sink_config.peer_delay_ms = delay_ms;
    update_receiver(sink_config);
  }
@@ -141,24 +145,27 @@ struct codec_manager_impl {
      const le_audio::stream_configuration& stream_conf, uint16_t delay_ms,
      std::function<void(const ::le_audio::offload_config& config)>
          update_receiver) {
    if (stream_conf.source_streams.empty()) return;
    if (stream_conf.stream_params.source.stream_locations.empty()) return;

    if (stream_conf.source_is_initial ||
    if (stream_conf.offloader_config.source.is_initial ||
        LeAudioHalVerifier::SupportsStreamActiveApi()) {
      source_config.stream_map =
          stream_conf.source_offloader_streams_target_allocation;
          stream_conf.offloader_config.source.streams_target_allocation;
    } else {
      source_config.stream_map =
          stream_conf.source_offloader_streams_current_allocation;
          stream_conf.offloader_config.source.streams_current_allocation;
    }
    // TODO: set the default value 16 for now, would change it if we support
    // mode bits_per_sample
    source_config.bits_per_sample = 16;
    source_config.sampling_rate = stream_conf.source_sample_frequency_hz;
    source_config.frame_duration = stream_conf.source_frame_duration_us;
    source_config.octets_per_frame = stream_conf.source_octets_per_codec_frame;
    source_config.sampling_rate =
        stream_conf.stream_params.source.sample_frequency_hz;
    source_config.frame_duration =
        stream_conf.stream_params.source.frame_duration_us;
    source_config.octets_per_frame =
        stream_conf.stream_params.source.octets_per_codec_frame;
    source_config.blocks_per_sdu =
        stream_conf.source_codec_frames_blocks_per_sdu;
        stream_conf.stream_params.source.codec_frames_blocks_per_sdu;
    source_config.peer_delay_ms = delay_ms;
    update_receiver(source_config);
  }
+117 −100
Original line number Diff line number Diff line
@@ -59,6 +59,18 @@ using le_audio::types::LeAudioContextType;
using le_audio::types::LeAudioLc3Config;

namespace le_audio {
namespace types {
template struct BidirectionalPair<offloader_stream_config>;
template <>
offloader_stream_config& types::BidirectionalPair<offloader_stream_config>::get(
    uint8_t direction) {
  ASSERT_LOG(direction < types::kLeAudioDirectionBoth,
             "Unsupported complex direction. Reference to a single complex"
             " direction value is not supported.");
  return (direction == types::kLeAudioDirectionSink) ? sink : source;
}
}  // namespace types

std::ostream& operator<<(std::ostream& os, const DeviceConnectState& state) {
  const char* char_value_ = "UNKNOWN";

@@ -158,30 +170,40 @@ int LeAudioDeviceGroup::NumOfConnected(

void LeAudioDeviceGroup::ClearSinksFromConfiguration(void) {
  LOG_INFO("Group %p, group_id %d", this, group_id_);
  stream_conf.sink_streams.clear();
  stream_conf.sink_offloader_streams_target_allocation.clear();
  stream_conf.sink_offloader_streams_current_allocation.clear();
  stream_conf.sink_audio_channel_allocation = 0;
  stream_conf.sink_num_of_channels = 0;
  stream_conf.sink_num_of_devices = 0;
  stream_conf.sink_sample_frequency_hz = 0;
  stream_conf.sink_codec_frames_blocks_per_sdu = 0;
  stream_conf.sink_octets_per_codec_frame = 0;
  stream_conf.sink_frame_duration_us = 0;
  auto direction = types::kLeAudioDirectionSink;

  auto& stream_params = stream_conf.stream_params.get(direction);
  stream_params.stream_locations.clear();
  stream_params.audio_channel_allocation = 0;
  stream_params.num_of_channels = 0;
  stream_params.num_of_devices = 0;
  stream_params.sample_frequency_hz = 0;
  stream_params.codec_frames_blocks_per_sdu = 0;
  stream_params.octets_per_codec_frame = 0;
  stream_params.frame_duration_us = 0;

  auto& offload_config = stream_conf.offloader_config.get(direction);
  offload_config.streams_target_allocation.clear();
  offload_config.streams_current_allocation.clear();
}

void LeAudioDeviceGroup::ClearSourcesFromConfiguration(void) {
  LOG_INFO("Group %p, group_id %d", this, group_id_);
  stream_conf.source_streams.clear();
  stream_conf.source_offloader_streams_target_allocation.clear();
  stream_conf.source_offloader_streams_current_allocation.clear();
  stream_conf.source_audio_channel_allocation = 0;
  stream_conf.source_num_of_channels = 0;
  stream_conf.source_num_of_devices = 0;
  stream_conf.source_sample_frequency_hz = 0;
  stream_conf.source_codec_frames_blocks_per_sdu = 0;
  stream_conf.source_octets_per_codec_frame = 0;
  stream_conf.source_frame_duration_us = 0;
  auto direction = types::kLeAudioDirectionSource;

  auto& stream_params = stream_conf.stream_params.get(direction);
  stream_params.stream_locations.clear();
  stream_params.audio_channel_allocation = 0;
  stream_params.num_of_channels = 0;
  stream_params.num_of_devices = 0;
  stream_params.sample_frequency_hz = 0;
  stream_params.codec_frames_blocks_per_sdu = 0;
  stream_params.octets_per_codec_frame = 0;
  stream_params.frame_duration_us = 0;

  auto& offload_config = stream_conf.offloader_config.get(direction);
  offload_config.streams_target_allocation.clear();
  offload_config.streams_current_allocation.clear();
}

void LeAudioDeviceGroup::CigClearCis(void) {
@@ -194,26 +216,32 @@ void LeAudioDeviceGroup::CigClearCis(void) {
void LeAudioDeviceGroup::Cleanup(void) {
  /* Bluetooth is off while streaming - disconnect CISes and remove CIG */
  if (GetState() == AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) {
    if (!stream_conf.sink_streams.empty()) {
      for (auto [cis_handle, audio_location] : stream_conf.sink_streams) {
    auto& sink_stream_locations =
        stream_conf.stream_params.sink.stream_locations;
    auto& source_stream_locations =
        stream_conf.stream_params.source.stream_locations;

    if (!sink_stream_locations.empty()) {
      for (const auto kv_pair : sink_stream_locations) {
        auto cis_handle = kv_pair.first;
        bluetooth::hci::IsoManager::GetInstance()->DisconnectCis(
            cis_handle, HCI_ERR_PEER_USER);

        if (stream_conf.source_streams.empty()) {
        /* Check the other direction if disconnecting bidirectional CIS */
        if (source_stream_locations.empty()) {
          continue;
        }
        uint16_t cis_hdl = cis_handle;
        stream_conf.source_streams.erase(
        source_stream_locations.erase(
            std::remove_if(
                stream_conf.source_streams.begin(),
                stream_conf.source_streams.end(),
                [cis_hdl](auto& pair) { return pair.first == cis_hdl; }),
            stream_conf.source_streams.end());
                source_stream_locations.begin(), source_stream_locations.end(),
                [&cis_handle](auto& pair) { return pair.first == cis_handle; }),
            source_stream_locations.end());
      }
    }

    if (!stream_conf.source_streams.empty()) {
      for (auto [cis_handle, audio_location] : stream_conf.source_streams) {
    /* Take care of the non-bidirectional CISes */
    if (!source_stream_locations.empty()) {
      for (auto [cis_handle, _] : source_stream_locations) {
        bluetooth::hci::IsoManager::GetInstance()->DisconnectCis(
            cis_handle, HCI_ERR_PEER_USER);
      }
@@ -1883,24 +1911,27 @@ bool LeAudioDeviceGroup::IsMetadataChanged(
}

bool LeAudioDeviceGroup::IsCisPartOfCurrentStream(uint16_t cis_conn_hdl) const {
  auto& sink_stream_locations = stream_conf.stream_params.sink.stream_locations;
  auto iter = std::find_if(
      stream_conf.sink_streams.begin(), stream_conf.sink_streams.end(),
      sink_stream_locations.begin(), sink_stream_locations.end(),
      [cis_conn_hdl](auto& pair) { return cis_conn_hdl == pair.first; });

  if (iter != stream_conf.sink_streams.end()) return true;
  if (iter != sink_stream_locations.end()) return true;

  auto& source_stream_locations =
      stream_conf.stream_params.source.stream_locations;
  iter = std::find_if(
      stream_conf.source_streams.begin(), stream_conf.source_streams.end(),
      source_stream_locations.begin(), source_stream_locations.end(),
      [cis_conn_hdl](auto& pair) { return cis_conn_hdl == pair.first; });

  return (iter != stream_conf.source_streams.end());
  return (iter != source_stream_locations.end());
}

void LeAudioDeviceGroup::StreamOffloaderUpdated(uint8_t direction) {
  if (direction == le_audio::types::kLeAudioDirectionSource) {
    stream_conf.source_is_initial = false;
    stream_conf.offloader_config.source.is_initial = false;
  } else {
    stream_conf.sink_is_initial = false;
    stream_conf.offloader_config.sink.is_initial = false;
  }
}

@@ -1910,70 +1941,55 @@ void LeAudioDeviceGroup::RemoveCisFromStreamIfNeeded(

  if (!IsCisPartOfCurrentStream(cis_conn_hdl)) return;

  auto sink_channels = stream_conf.sink_num_of_channels;
  auto source_channels = stream_conf.source_num_of_channels;
  /* Cache the old values for comparison */
  auto old_sink_channels = stream_conf.stream_params.sink.num_of_channels;
  auto old_source_channels = stream_conf.stream_params.source.num_of_channels;

  if (!stream_conf.sink_streams.empty() ||
      !stream_conf.source_streams.empty()) {
    stream_conf.sink_streams.erase(
  for (auto dir :
       {types::kLeAudioDirectionSink, types::kLeAudioDirectionSource}) {
    auto& params = stream_conf.stream_params.get(dir);
    params.stream_locations.erase(
        std::remove_if(
            stream_conf.sink_streams.begin(), stream_conf.sink_streams.end(),
            [leAudioDevice, &cis_conn_hdl, this](auto& pair) {
            params.stream_locations.begin(), params.stream_locations.end(),
            [leAudioDevice, &cis_conn_hdl, &params, dir](auto& pair) {
              if (!cis_conn_hdl) {
                cis_conn_hdl = pair.first;
              }
              auto ases_pair = leAudioDevice->GetAsesByCisConnHdl(cis_conn_hdl);
              if (ases_pair.sink && cis_conn_hdl == pair.first) {
                stream_conf.sink_num_of_devices--;
                stream_conf.sink_num_of_channels -=
                    ases_pair.sink->codec_config.channel_count;
                stream_conf.sink_audio_channel_allocation &= ~pair.second;
              if (ases_pair.get(dir) && cis_conn_hdl == pair.first) {
                params.num_of_devices--;
                params.num_of_channels -=
                    ases_pair.get(dir)->codec_config.channel_count;
                params.audio_channel_allocation &= ~pair.second;
              }
              return (ases_pair.sink && cis_conn_hdl == pair.first);
              return (ases_pair.get(dir) && cis_conn_hdl == pair.first);
            }),
        stream_conf.sink_streams.end());

    stream_conf.source_streams.erase(
        std::remove_if(
            stream_conf.source_streams.begin(),
            stream_conf.source_streams.end(),
            [leAudioDevice, &cis_conn_hdl, this](auto& pair) {
              if (!cis_conn_hdl) {
                cis_conn_hdl = pair.first;
              }
              auto ases_pair = leAudioDevice->GetAsesByCisConnHdl(cis_conn_hdl);
              if (ases_pair.source && cis_conn_hdl == pair.first) {
                stream_conf.source_num_of_devices--;
                stream_conf.source_num_of_channels -=
                    ases_pair.source->codec_config.channel_count;
                stream_conf.source_audio_channel_allocation &= ~pair.second;
        params.stream_locations.end());
  }
              return (ases_pair.source && cis_conn_hdl == pair.first);
            }),
        stream_conf.source_streams.end());

  LOG_INFO(
      " Sink Number Of Devices: %d"
      ", Sink Number Of Channels: %d"
      ", Source Number Of Devices: %d"
      ", Source Number Of Channels: %d",
        stream_conf.sink_num_of_devices, stream_conf.sink_num_of_channels,
        stream_conf.source_num_of_devices, stream_conf.source_num_of_channels);
  }
      stream_conf.stream_params.sink.num_of_devices,
      stream_conf.stream_params.sink.num_of_channels,
      stream_conf.stream_params.source.num_of_devices,
      stream_conf.stream_params.source.num_of_channels);

  if (stream_conf.sink_num_of_channels == 0) {
  if (stream_conf.stream_params.sink.num_of_channels == 0) {
    ClearSinksFromConfiguration();
  }

  if (stream_conf.source_num_of_channels == 0) {
  if (stream_conf.stream_params.source.num_of_channels == 0) {
    ClearSourcesFromConfiguration();
  }

  /* Update offloader streams if needed */
  if (sink_channels > stream_conf.sink_num_of_channels) {
  if (old_sink_channels > stream_conf.stream_params.sink.num_of_channels) {
    CreateStreamVectorForOffloader(le_audio::types::kLeAudioDirectionSink);
  }
  if (source_channels > stream_conf.source_num_of_channels) {
  if (old_source_channels > stream_conf.stream_params.source.num_of_channels) {
    CreateStreamVectorForOffloader(le_audio::types::kLeAudioDirectionSource);
  }

@@ -1995,29 +2011,29 @@ void LeAudioDeviceGroup::CreateStreamVectorForOffloader(uint8_t direction) {
  bool* changed_flag;
  bool* is_initial;
  if (direction == le_audio::types::kLeAudioDirectionSource) {
    changed_flag = &stream_conf.source_offloader_changed;
    is_initial = &stream_conf.source_is_initial;
    changed_flag = &stream_conf.offloader_config.source.has_changed;
    is_initial = &stream_conf.offloader_config.source.is_initial;
    cis_type = CisType::CIS_TYPE_UNIDIRECTIONAL_SOURCE;
    streams = &stream_conf.source_streams;
    streams = &stream_conf.stream_params.source.stream_locations;
    offloader_streams_target_allocation =
        &stream_conf.source_offloader_streams_target_allocation;
        &stream_conf.offloader_config.source.streams_target_allocation;
    offloader_streams_current_allocation =
        &stream_conf.source_offloader_streams_current_allocation;
        &stream_conf.offloader_config.source.streams_current_allocation;
    tag = "Source";
    available_allocations = AdjustAllocationForOffloader(
        stream_conf.source_audio_channel_allocation);
        stream_conf.stream_params.source.audio_channel_allocation);
  } else {
    changed_flag = &stream_conf.sink_offloader_changed;
    is_initial = &stream_conf.sink_is_initial;
    changed_flag = &stream_conf.offloader_config.sink.has_changed;
    is_initial = &stream_conf.offloader_config.sink.is_initial;
    cis_type = CisType::CIS_TYPE_UNIDIRECTIONAL_SINK;
    streams = &stream_conf.sink_streams;
    streams = &stream_conf.stream_params.sink.stream_locations;
    offloader_streams_target_allocation =
        &stream_conf.sink_offloader_streams_target_allocation;
        &stream_conf.offloader_config.sink.streams_target_allocation;
    offloader_streams_current_allocation =
        &stream_conf.sink_offloader_streams_current_allocation;
        &stream_conf.offloader_config.sink.streams_current_allocation;
    tag = "Sink";
    available_allocations =
        AdjustAllocationForOffloader(stream_conf.sink_audio_channel_allocation);
    available_allocations = AdjustAllocationForOffloader(
        stream_conf.stream_params.sink.audio_channel_allocation);
  }

  if (available_allocations == 0) {
@@ -2047,7 +2063,7 @@ void LeAudioDeviceGroup::CreateStreamVectorForOffloader(uint8_t direction) {
  if (*is_initial && !not_all_cises_connected) {
    *changed_flag = false;
  }
  for (auto& cis_entry : cises_) {
  for (auto const& cis_entry : cises_) {
    if ((cis_entry.type == CisType::CIS_TYPE_BIDIRECTIONAL ||
         cis_entry.type == cis_type) &&
        cis_entry.conn_handle != 0) {
@@ -2364,11 +2380,12 @@ void LeAudioDeviceGroup::Dump(int fd, int active_group_id) const {
         << "\n"
         << "      num of devices(connected): " << Size() << "("
         << NumOfConnected() << ")\n"
         << ",     num of sinks(connected): " << stream_conf.sink_num_of_devices
         << "(" << stream_conf.sink_streams.size() << ")\n"
         << ",     num of sinks(connected): "
         << stream_conf.stream_params.sink.num_of_devices << "("
         << stream_conf.stream_params.sink.stream_locations.size() << ")\n"
         << "      num of sources(connected): "
         << stream_conf.source_num_of_devices << "("
         << stream_conf.source_streams.size() << ")\n"
         << stream_conf.stream_params.source.num_of_devices << "("
         << stream_conf.stream_params.source.stream_locations.size() << ")\n"
         << "      allocated CISes: " << static_cast<int>(cises_.size());

  if (cises_.size() > 0) {
+224 −186

File changed.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
@@ -946,6 +946,8 @@ AudioLocations get_bidirectional(BidirectionalPair<AudioLocations> bidir) {
template struct BidirectionalPair<AudioContexts>;
template struct BidirectionalPair<AudioLocations>;
template struct BidirectionalPair<std::vector<uint8_t>>;
template struct BidirectionalPair<ase*>;
template struct BidirectionalPair<stream_parameters>;

}  // namespace types
}  // namespace le_audio
Loading