Merge "Report broacast audio config to HAL" into main
This commit is contained in:
commit
9534a2dc4c
1 changed files with 34 additions and 11 deletions
|
@ -121,19 +121,42 @@ const AudioConfiguration BluetoothAudioSession::GetAudioConfig() {
|
|||
|
||||
void BluetoothAudioSession::ReportAudioConfigChanged(
|
||||
const AudioConfiguration& audio_config) {
|
||||
std::lock_guard<std::recursive_mutex> guard(mutex_);
|
||||
if (com::android::btaudio::hal::flags::leaudio_report_broadcast_ac_to_hal()) {
|
||||
if (session_type_ ==
|
||||
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
|
||||
session_type_ ==
|
||||
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
|
||||
if (audio_config.getTag() != AudioConfiguration::leAudioConfig) {
|
||||
LOG(ERROR) << __func__ << " invalid audio config type for SessionType ="
|
||||
<< toString(session_type_);
|
||||
return;
|
||||
}
|
||||
} else if (session_type_ ==
|
||||
SessionType::LE_AUDIO_BROADCAST_HARDWARE_OFFLOAD_ENCODING_DATAPATH) {
|
||||
if (audio_config.getTag() != AudioConfiguration::leAudioBroadcastConfig) {
|
||||
LOG(ERROR) << __func__ << " invalid audio config type for SessionType ="
|
||||
<< toString(session_type_);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
LOG(ERROR) << __func__ << " invalid SessionType ="
|
||||
<< toString(session_type_);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (session_type_ !=
|
||||
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_ENCODING_DATAPATH &&
|
||||
session_type_ !=
|
||||
SessionType::LE_AUDIO_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::recursive_mutex> guard(mutex_);
|
||||
if (audio_config.getTag() != AudioConfiguration::leAudioConfig) {
|
||||
LOG(ERROR) << __func__ << " invalid audio config type for SessionType ="
|
||||
<< toString(session_type_);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
audio_config_ = std::make_unique<AudioConfiguration>(audio_config);
|
||||
|
||||
|
|
Loading…
Reference in a new issue