mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
audio vts: Remove explicit dependency on the new types
Avoid using the new ChannelMaskSet and SampleRateSet types directly to simplify upstreaming. Bug: 141989952 Bug: 141847510 Test: atest VtsHalAudioV5_0TargetTest Change-Id: I4477334be0375a95d79324a3ab38b03eb3f9998f
This commit is contained in:
@@ -73,9 +73,12 @@ const std::vector<DeviceConfigParameter>& getOutputDeviceConfigParameters() {
|
||||
getCachedPolicyConfig().getModuleFromName(std::get<PARAM_DEVICE_NAME>(device));
|
||||
for (const auto& ioProfile : module->getOutputProfiles()) {
|
||||
for (const auto& profile : ioProfile->getAudioProfiles()) {
|
||||
auto configs = ConfigHelper::combineAudioConfig(profile->getChannels(),
|
||||
profile->getSampleRates(),
|
||||
profile->getFormat());
|
||||
const auto& channels = profile->getChannels();
|
||||
const auto& sampleRates = profile->getSampleRates();
|
||||
auto configs = ConfigHelper::combineAudioConfig(
|
||||
vector<audio_channel_mask_t>(channels.begin(), channels.end()),
|
||||
vector<uint32_t>(sampleRates.begin(), sampleRates.end()),
|
||||
profile->getFormat());
|
||||
auto flags = ioProfile->getFlags();
|
||||
for (auto& config : configs) {
|
||||
// Some combinations of flags declared in the config file require special
|
||||
@@ -125,9 +128,12 @@ const std::vector<DeviceConfigParameter>& getInputDeviceConfigParameters() {
|
||||
getCachedPolicyConfig().getModuleFromName(std::get<PARAM_DEVICE_NAME>(device));
|
||||
for (const auto& ioProfile : module->getInputProfiles()) {
|
||||
for (const auto& profile : ioProfile->getAudioProfiles()) {
|
||||
auto configs = ConfigHelper::combineAudioConfig(profile->getChannels(),
|
||||
profile->getSampleRates(),
|
||||
profile->getFormat());
|
||||
const auto& channels = profile->getChannels();
|
||||
const auto& sampleRates = profile->getSampleRates();
|
||||
auto configs = ConfigHelper::combineAudioConfig(
|
||||
vector<audio_channel_mask_t>(channels.begin(), channels.end()),
|
||||
vector<uint32_t>(sampleRates.begin(), sampleRates.end()),
|
||||
profile->getFormat());
|
||||
for (const auto& config : configs) {
|
||||
result.emplace_back(device, config, AudioInputFlag(ioProfile->getFlags()));
|
||||
}
|
||||
|
||||
@@ -79,8 +79,8 @@ struct ConfigHelper {
|
||||
return {};
|
||||
}
|
||||
|
||||
static vector<AudioConfig> combineAudioConfig(android::ChannelMaskSet channelMasks,
|
||||
android::SampleRateSet sampleRates,
|
||||
static vector<AudioConfig> combineAudioConfig(vector<audio_channel_mask_t> channelMasks,
|
||||
vector<uint32_t> sampleRates,
|
||||
audio_format_t format) {
|
||||
vector<AudioConfig> configs;
|
||||
configs.reserve(channelMasks.size() * sampleRates.size());
|
||||
|
||||
Reference in New Issue
Block a user