diff --git a/audio/aidl/default/EffectConfig.cpp b/audio/aidl/default/EffectConfig.cpp index c030b7a88c..5a83fef99a 100644 --- a/audio/aidl/default/EffectConfig.cpp +++ b/audio/aidl/default/EffectConfig.cpp @@ -16,6 +16,7 @@ #define LOG_TAG "AHAL_EffectConfig" #include +#include #include "effectFactory-impl/EffectConfig.h" @@ -163,15 +164,53 @@ bool EffectConfig::parseLibraryUuid(const tinyxml2::XMLElement& xml, libraryUuid.name = name; } - const char* uuid = xml.Attribute("uuid"); - RETURN_VALUE_IF(!uuid, false, "noUuidAttribute"); - RETURN_VALUE_IF(!stringToUuid(uuid, &libraryUuid.uuid), false, "invalidUuidAttribute"); + const char* uuidStr = xml.Attribute("uuid"); + RETURN_VALUE_IF(!uuidStr, false, "noUuidAttribute"); + libraryUuid.uuid = stringToUuid(uuidStr); + RETURN_VALUE_IF((libraryUuid.uuid == getEffectUuidZero()), false, "invalidUuidAttribute"); LOG(DEBUG) << __func__ << (isProxy ? " proxy " : libraryUuid.name) << " : " << libraryUuid.uuid.toString(); return true; } +bool EffectConfig::findUuid(const std::string& xmlEffectName, AudioUuid* uuid) { +// Difference from EFFECT_TYPE_LIST_DEF, there could be multiple name mapping to same Effect Type +#define EFFECT_XML_TYPE_LIST_DEF(V) \ + V("acoustic_echo_canceler", AcousticEchoCanceler) \ + V("automatic_gain_control_v1", AutomaticGainControlV1) \ + V("automatic_gain_control_v2", AutomaticGainControlV2) \ + V("bassboost", BassBoost) \ + V("downmix", Downmix) \ + V("dynamics_processing", DynamicsProcessing) \ + V("equalizer", Equalizer) \ + V("haptic_generator", HapticGenerator) \ + V("loudness_enhancer", LoudnessEnhancer) \ + V("env_reverb", EnvReverb) \ + V("reverb_env_aux", EnvReverb) \ + V("reverb_env_ins", EnvReverb) \ + V("preset_reverb", PresetReverb) \ + V("reverb_pre_aux", PresetReverb) \ + V("reverb_pre_ins", PresetReverb) \ + V("noise_suppression", NoiseSuppression) \ + V("spatializer", Spatializer) \ + V("virtualizer", Virtualizer) \ + V("visualizer", Visualizer) \ + V("volume", Volume) + +#define GENERATE_MAP_ENTRY_V(s, symbol) {s, &getEffectTypeUuid##symbol}, + + typedef const AudioUuid& (*UuidGetter)(void); + static const std::map uuidMap{ + // std::make_pair("s", &getEffectTypeUuidExtension)}; + {EFFECT_XML_TYPE_LIST_DEF(GENERATE_MAP_ENTRY_V)}}; + if (auto it = uuidMap.find(xmlEffectName); it != uuidMap.end()) { + *uuid = (*it->second)(); + return true; + } + return false; +} + const char* EffectConfig::dump(const tinyxml2::XMLElement& element, tinyxml2::XMLPrinter&& printer) const { element.Accept(&printer); diff --git a/audio/aidl/default/EffectFactory.cpp b/audio/aidl/default/EffectFactory.cpp index 638fa7fbb8..c1ac3f2d41 100644 --- a/audio/aidl/default/EffectFactory.cpp +++ b/audio/aidl/default/EffectFactory.cpp @@ -14,20 +14,19 @@ * limitations under the License. */ +#include #include #include #include -#include "include/effect-impl/EffectTypes.h" -#define LOG_TAG "AHAL_EffectFactory" -#include #include +#define LOG_TAG "AHAL_EffectFactory" #include #include +#include #include #include "effect-impl/EffectTypes.h" -#include "effect-impl/EffectUUID.h" #include "effectFactory-impl/EffectFactory.h" using aidl::android::media::audio::common::AudioUuid; @@ -214,8 +213,8 @@ void Factory::createIdentityWithConfig(const EffectConfig::LibraryUuid& configLi void Factory::loadEffectLibs() { const auto& configEffectsMap = mConfig.getEffectsMap(); for (const auto& configEffects : configEffectsMap) { - if (auto typeUuid = kUuidNameTypeMap.find(configEffects.first /* effect name */); - typeUuid != kUuidNameTypeMap.end()) { + if (AudioUuid uuid; + EffectConfig::findUuid(configEffects.first /* xml effect name */, &uuid)) { const auto& configLibs = configEffects.second; std::optional proxyUuid; if (configLibs.proxyLibrary.has_value()) { @@ -223,7 +222,7 @@ void Factory::loadEffectLibs() { proxyUuid = proxyLib.uuid; } for (const auto& configLib : configLibs.libraries) { - createIdentityWithConfig(configLib, typeUuid->second, proxyUuid); + createIdentityWithConfig(configLib, uuid, proxyUuid); } } else { LOG(ERROR) << __func__ << ": can not find type UUID for effect " << configEffects.first diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp index e90fe35054..da1ad111db 100644 --- a/audio/aidl/default/EffectImpl.cpp +++ b/audio/aidl/default/EffectImpl.cpp @@ -40,7 +40,7 @@ namespace aidl::android::hardware::audio::effect { ndk::ScopedAStatus EffectImpl::open(const Parameter::Common& common, const std::optional& specific, OpenEffectReturn* ret) { - LOG(DEBUG) << __func__; + LOG(DEBUG) << getEffectName() << __func__; // effect only support 32bits float RETURN_IF(common.input.base.format.pcm != common.output.base.format.pcm || common.input.base.format.pcm != PcmType::FLOAT_32_BIT, @@ -71,12 +71,12 @@ ndk::ScopedAStatus EffectImpl::close() { RETURN_IF(releaseContext() != RetCode::SUCCESS, EX_UNSUPPORTED_OPERATION, "FailedToCreateWorker"); - LOG(DEBUG) << __func__; + LOG(DEBUG) << getEffectName() << __func__; return ndk::ScopedAStatus::ok(); } ndk::ScopedAStatus EffectImpl::setParameter(const Parameter& param) { - LOG(DEBUG) << __func__ << " with: " << param.toString(); + LOG(DEBUG) << getEffectName() << __func__ << " with: " << param.toString(); const auto tag = param.getTag(); switch (tag) { @@ -91,7 +91,8 @@ ndk::ScopedAStatus EffectImpl::setParameter(const Parameter& param) { return setParameterSpecific(param.get()); } default: { - LOG(ERROR) << __func__ << " unsupportedParameterTag " << toString(tag); + LOG(ERROR) << getEffectName() << __func__ << " unsupportedParameterTag " + << toString(tag); return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "ParameterNotSupported"); } @@ -99,7 +100,7 @@ ndk::ScopedAStatus EffectImpl::setParameter(const Parameter& param) { } ndk::ScopedAStatus EffectImpl::getParameter(const Parameter::Id& id, Parameter* param) { - LOG(DEBUG) << __func__ << id.toString(); + LOG(DEBUG) << getEffectName() << __func__ << id.toString(); auto tag = id.getTag(); switch (tag) { case Parameter::Id::commonTag: { @@ -116,7 +117,7 @@ ndk::ScopedAStatus EffectImpl::getParameter(const Parameter::Id& id, Parameter* break; } } - LOG(DEBUG) << __func__ << param->toString(); + LOG(DEBUG) << getEffectName() << __func__ << param->toString(); return ndk::ScopedAStatus::ok(); } @@ -149,7 +150,8 @@ ndk::ScopedAStatus EffectImpl::setParameterCommon(const Parameter& param) { EX_ILLEGAL_ARGUMENT, "setVolumeStereoFailed"); break; default: { - LOG(ERROR) << __func__ << " unsupportedParameterTag " << toString(tag); + LOG(ERROR) << getEffectName() << __func__ << " unsupportedParameterTag " + << toString(tag); return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "commonParamNotSupported"); } @@ -183,7 +185,7 @@ ndk::ScopedAStatus EffectImpl::getParameterCommon(const Parameter::Tag& tag, Par break; } default: { - LOG(DEBUG) << __func__ << " unsupported tag " << toString(tag); + LOG(DEBUG) << getEffectName() << __func__ << " unsupported tag " << toString(tag); return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "tagNotSupported"); } @@ -198,8 +200,8 @@ ndk::ScopedAStatus EffectImpl::getState(State* state) { ndk::ScopedAStatus EffectImpl::command(CommandId command) { RETURN_IF(mState == State::INIT, EX_ILLEGAL_STATE, "CommandStateError"); - LOG(DEBUG) << __func__ << ": receive command: " << toString(command) << " at state " - << toString(mState); + LOG(DEBUG) << getEffectName() << __func__ << ": receive command: " << toString(command) + << " at state " << toString(mState); switch (command) { case CommandId::START: @@ -217,11 +219,11 @@ ndk::ScopedAStatus EffectImpl::command(CommandId command) { mState = State::IDLE; break; default: - LOG(ERROR) << __func__ << " instance still processing"; + LOG(ERROR) << getEffectName() << __func__ << " instance still processing"; return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT, "CommandIdNotSupported"); } - LOG(DEBUG) << __func__ << " transfer to state: " << toString(mState); + LOG(DEBUG) << getEffectName() << __func__ << " transfer to state: " << toString(mState); return ndk::ScopedAStatus::ok(); } @@ -252,7 +254,7 @@ IEffect::Status EffectImpl::effectProcessImpl(float* in, float* out, int samples for (int i = 0; i < samples; i++) { *out++ = *in++; } - LOG(DEBUG) << __func__ << " done processing " << samples << " samples"; + LOG(DEBUG) << getEffectName() << __func__ << " done processing " << samples << " samples"; return {STATUS_OK, samples, samples}; } diff --git a/audio/aidl/default/EffectThread.cpp b/audio/aidl/default/EffectThread.cpp index 4f8fb3c08e..844127d2c7 100644 --- a/audio/aidl/default/EffectThread.cpp +++ b/audio/aidl/default/EffectThread.cpp @@ -36,7 +36,7 @@ EffectThread::~EffectThread() { RetCode EffectThread::createThread(std::shared_ptr context, const std::string& name, int priority, int sleepUs /* kSleepTimeUs */) { if (mThread.joinable()) { - LOG(WARNING) << __func__ << " thread already created, no-op"; + LOG(WARNING) << "-" << mName << "-" << __func__ << " thread already created, no-op"; return RetCode::SUCCESS; } mName = name; @@ -47,7 +47,7 @@ RetCode EffectThread::createThread(std::shared_ptr context, const mThreadContext = std::move(context); } mThread = std::thread(&EffectThread::threadLoop, this); - LOG(DEBUG) << __func__ << " " << name << " priority " << mPriority << " done"; + LOG(DEBUG) << "-" << mName << "-" << __func__ << " priority " << mPriority << " done"; return RetCode::SUCCESS; } @@ -66,7 +66,7 @@ RetCode EffectThread::destroyThread() { std::lock_guard lg(mThreadMutex); mThreadContext.reset(); } - LOG(DEBUG) << __func__ << " done"; + LOG(DEBUG) << "-" << mName << "-" << __func__ << " done"; return RetCode::SUCCESS; } @@ -80,21 +80,23 @@ RetCode EffectThread::stopThread() { RetCode EffectThread::handleStartStop(bool stop) { if (!mThread.joinable()) { - LOG(ERROR) << __func__ << " thread already destroyed"; + LOG(ERROR) << "-" << mName << "-" << __func__ << ": " + << " thread already destroyed"; return RetCode::ERROR_THREAD; } { std::lock_guard lg(mThreadMutex); if (stop == mStop) { - LOG(WARNING) << __func__ << " already " << (stop ? "stop" : "start"); + LOG(WARNING) << "-" << mName << "-" << __func__ << ": " + << " already " << (stop ? "stop" : "start"); return RetCode::SUCCESS; } mStop = stop; } mCv.notify_one(); - LOG(DEBUG) << (stop ? "stop done" : "start done"); + LOG(DEBUG) << ": " << mName << (stop ? " stop done" : " start done"); return RetCode::SUCCESS; } @@ -124,16 +126,18 @@ void EffectThread::process_l() { auto readSamples = inputMQ->availableToRead(), writeSamples = outputMQ->availableToWrite(); if (readSamples && writeSamples) { auto processSamples = std::min(readSamples, writeSamples); - LOG(DEBUG) << __func__ << " available to read " << readSamples << " available to write " - << writeSamples << " process " << processSamples; + LOG(DEBUG) << "-" << mName << "-" << __func__ << ": " + << " available to read " << readSamples << " available to write " << writeSamples + << " process " << processSamples; inputMQ->read(buffer, processSamples); IEffect::Status status = effectProcessImpl(buffer, buffer, processSamples); outputMQ->write(buffer, status.fmqProduced); statusMQ->writeBlocking(&status, 1); - LOG(DEBUG) << __func__ << " done processing, effect consumed " << status.fmqConsumed - << " produced " << status.fmqProduced; + LOG(DEBUG) << "-" << mName << "-" << __func__ << ": " + << " done processing, effect consumed " << status.fmqConsumed << " produced " + << status.fmqProduced; } else { usleep(mSleepTimeUs); } diff --git a/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.cpp b/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.cpp index 561f9a32ad..63a014ad67 100644 --- a/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.cpp +++ b/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.cpp @@ -22,19 +22,21 @@ #define LOG_TAG "AHAL_AcousticEchoCancelerSw" #include #include +#include #include "AcousticEchoCancelerSw.h" using aidl::android::hardware::audio::effect::AcousticEchoCancelerSw; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidAcousticEchoCancelerSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidAcousticEchoCanceler; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kAcousticEchoCancelerSwImplUUID; using aidl::android::hardware::audio::effect::Range; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kAcousticEchoCancelerSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAcousticEchoCancelerSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -49,7 +51,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kAcousticEchoCancelerSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAcousticEchoCancelerSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -69,8 +71,8 @@ const std::vector AcousticEchoCancelerSw::kRan const Capability AcousticEchoCancelerSw::kCapability = {.range = AcousticEchoCancelerSw::kRanges}; const Descriptor AcousticEchoCancelerSw::kDescriptor = { - .common = {.id = {.type = kAcousticEchoCancelerTypeUUID, - .uuid = kAcousticEchoCancelerSwImplUUID, + .common = {.id = {.type = getEffectTypeUuidAcousticEchoCanceler(), + .uuid = getEffectImplUuidAcousticEchoCancelerSw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.h b/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.h index 753207df9c..73cf42b17a 100644 --- a/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.h +++ b/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.h @@ -23,7 +23,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.cpp b/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.cpp index 39290b4792..ce10ae1674 100644 --- a/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.cpp +++ b/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.cpp @@ -17,18 +17,20 @@ #define LOG_TAG "AHAL_AutomaticGainControlV1Sw" #include +#include #include "AutomaticGainControlV1Sw.h" using aidl::android::hardware::audio::effect::AutomaticGainControlV1Sw; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidAutomaticGainControlV1Sw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidAutomaticGainControlV1; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kAutomaticGainControlV1SwImplUUID; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlV1SwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAutomaticGainControlV1Sw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -43,7 +45,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlV1SwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAutomaticGainControlV1Sw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -63,8 +65,8 @@ const Capability AutomaticGainControlV1Sw::kCapability = { .range = AutomaticGainControlV1Sw::kRanges}; const Descriptor AutomaticGainControlV1Sw::kDescriptor = { - .common = {.id = {.type = kAutomaticGainControlV1TypeUUID, - .uuid = kAutomaticGainControlV1SwImplUUID, + .common = {.id = {.type = getEffectTypeUuidAutomaticGainControlV1(), + .uuid = getEffectImplUuidAutomaticGainControlV1Sw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.h b/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.h index 6ba7328521..7d2a69f9d5 100644 --- a/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.h +++ b/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.h @@ -17,7 +17,6 @@ #pragma once #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.cpp b/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.cpp index 50712a4f5b..1e336ac012 100644 --- a/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.cpp +++ b/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.cpp @@ -17,22 +17,24 @@ #include #include #include - #define LOG_TAG "AHAL_AutomaticGainControlV2Sw" + #include #include +#include #include "AutomaticGainControlV2Sw.h" using aidl::android::hardware::audio::effect::AutomaticGainControlV2Sw; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidAutomaticGainControlV2Sw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidAutomaticGainControlV2; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kAutomaticGainControlV2SwImplUUID; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlV2SwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAutomaticGainControlV2Sw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -47,7 +49,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlV2SwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAutomaticGainControlV2Sw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -67,8 +69,8 @@ const Capability AutomaticGainControlV2Sw::kCapability = { .range = AutomaticGainControlV2Sw::kRanges}; const Descriptor AutomaticGainControlV2Sw::kDescriptor = { - .common = {.id = {.type = kAutomaticGainControlV2TypeUUID, - .uuid = kAutomaticGainControlV2SwImplUUID, + .common = {.id = {.type = getEffectTypeUuidAutomaticGainControlV2(), + .uuid = getEffectImplUuidAutomaticGainControlV2Sw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.h b/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.h index 0b50f4de0b..9aa60eab60 100644 --- a/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.h +++ b/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.h @@ -22,7 +22,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/bassboost/BassBoostSw.cpp b/audio/aidl/default/bassboost/BassBoostSw.cpp index fb5374f3cc..dbf2e15c7d 100644 --- a/audio/aidl/default/bassboost/BassBoostSw.cpp +++ b/audio/aidl/default/bassboost/BassBoostSw.cpp @@ -21,19 +21,22 @@ #define LOG_TAG "AHAL_BassBoostSw" #include #include +#include #include "BassBoostSw.h" using aidl::android::hardware::audio::effect::BassBoostSw; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidBassBoostProxy; +using aidl::android::hardware::audio::effect::getEffectImplUuidBassBoostSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidBassBoost; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kBassBoostSwImplUUID; using aidl::android::hardware::audio::effect::State; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kBassBoostSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidBassBoostSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -48,7 +51,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kBassBoostSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidBassBoostSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -64,9 +67,9 @@ const std::vector BassBoostSw::kRanges = { MAKE_RANGE(BassBoost, strengthPm, 0, 1000)}; const Capability BassBoostSw::kCapability = {.range = {BassBoostSw::kRanges}}; const Descriptor BassBoostSw::kDescriptor = { - .common = {.id = {.type = kBassBoostTypeUUID, - .uuid = kBassBoostSwImplUUID, - .proxy = kBassBoostProxyUUID}, + .common = {.id = {.type = getEffectTypeUuidBassBoost(), + .uuid = getEffectImplUuidBassBoostSw(), + .proxy = getEffectImplUuidBassBoostProxy()}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, .volume = Flags::Volume::CTRL}, diff --git a/audio/aidl/default/bassboost/BassBoostSw.h b/audio/aidl/default/bassboost/BassBoostSw.h index 8d183dd4dc..11324727a7 100644 --- a/audio/aidl/default/bassboost/BassBoostSw.h +++ b/audio/aidl/default/bassboost/BassBoostSw.h @@ -22,7 +22,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/downmix/DownmixSw.cpp b/audio/aidl/default/downmix/DownmixSw.cpp index 81a4c89fd6..ce5fe20817 100644 --- a/audio/aidl/default/downmix/DownmixSw.cpp +++ b/audio/aidl/default/downmix/DownmixSw.cpp @@ -20,19 +20,21 @@ #define LOG_TAG "AHAL_DownmixSw" #include #include +#include #include "DownmixSw.h" using aidl::android::hardware::audio::effect::Descriptor; using aidl::android::hardware::audio::effect::DownmixSw; +using aidl::android::hardware::audio::effect::getEffectImplUuidDownmixSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidDownmix; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kDownmixSwImplUUID; using aidl::android::hardware::audio::effect::State; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kDownmixSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidDownmixSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -47,7 +49,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kDownmixSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidDownmixSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -59,13 +61,14 @@ namespace aidl::android::hardware::audio::effect { const std::string DownmixSw::kEffectName = "DownmixSw"; const Descriptor DownmixSw::kDescriptor = { - .common = { - .id = {.type = kDownmixTypeUUID, .uuid = kDownmixSwImplUUID, .proxy = std::nullopt}, - .flags = {.type = Flags::Type::INSERT, - .insert = Flags::Insert::FIRST, - .volume = Flags::Volume::CTRL}, - .name = kEffectName, - .implementor = "The Android Open Source Project"}}; + .common = {.id = {.type = getEffectTypeUuidDownmix(), + .uuid = getEffectImplUuidDownmixSw(), + .proxy = std::nullopt}, + .flags = {.type = Flags::Type::INSERT, + .insert = Flags::Insert::FIRST, + .volume = Flags::Volume::CTRL}, + .name = kEffectName, + .implementor = "The Android Open Source Project"}}; ndk::ScopedAStatus DownmixSw::getDescriptor(Descriptor* _aidl_return) { LOG(DEBUG) << __func__ << kDescriptor.toString(); diff --git a/audio/aidl/default/downmix/DownmixSw.h b/audio/aidl/default/downmix/DownmixSw.h index 37c978be5e..3f8a09b16c 100644 --- a/audio/aidl/default/downmix/DownmixSw.h +++ b/audio/aidl/default/downmix/DownmixSw.h @@ -22,7 +22,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp index 1dda6d1183..ed6cfa0b39 100644 --- a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp +++ b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp @@ -22,19 +22,21 @@ #define LOG_TAG "AHAL_DynamicsProcessingSw" #include #include +#include #include "DynamicsProcessingSw.h" using aidl::android::hardware::audio::effect::Descriptor; using aidl::android::hardware::audio::effect::DynamicsProcessingSw; +using aidl::android::hardware::audio::effect::getEffectImplUuidDynamicsProcessingSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidDynamicsProcessing; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kDynamicsProcessingSwImplUUID; using aidl::android::hardware::audio::effect::State; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kDynamicsProcessingSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidDynamicsProcessingSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -49,7 +51,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kDynamicsProcessingSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidDynamicsProcessingSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -88,8 +90,8 @@ const std::vector DynamicsProcessingSw::kRanges const Capability DynamicsProcessingSw::kCapability = {.range = DynamicsProcessingSw::kRanges}; const Descriptor DynamicsProcessingSw::kDescriptor = { - .common = {.id = {.type = kDynamicsProcessingTypeUUID, - .uuid = kDynamicsProcessingSwImplUUID, + .common = {.id = {.type = getEffectTypeUuidDynamicsProcessing(), + .uuid = getEffectImplUuidDynamicsProcessingSw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.h b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.h index 769f9ef14f..641cf71f68 100644 --- a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.h +++ b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.h @@ -25,7 +25,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/envReverb/EnvReverbSw.cpp b/audio/aidl/default/envReverb/EnvReverbSw.cpp index 29288cacf3..73975c6996 100644 --- a/audio/aidl/default/envReverb/EnvReverbSw.cpp +++ b/audio/aidl/default/envReverb/EnvReverbSw.cpp @@ -21,19 +21,21 @@ #define LOG_TAG "AHAL_EnvReverbSw" #include #include +#include #include "EnvReverbSw.h" using aidl::android::hardware::audio::effect::Descriptor; using aidl::android::hardware::audio::effect::EnvReverbSw; +using aidl::android::hardware::audio::effect::getEffectImplUuidEnvReverbSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidEnvReverb; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kEnvReverbSwImplUUID; using aidl::android::hardware::audio::effect::State; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kEnvReverbSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidEnvReverbSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -48,7 +50,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kEnvReverbSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidEnvReverbSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -76,8 +78,8 @@ const Capability EnvReverbSw::kCapability = { .range = Range::make(EnvReverbSw::kRanges)}; const Descriptor EnvReverbSw::kDescriptor = { - .common = {.id = {.type = kEnvReverbTypeUUID, - .uuid = kEnvReverbSwImplUUID, + .common = {.id = {.type = getEffectTypeUuidEnvReverb(), + .uuid = getEffectImplUuidEnvReverbSw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/envReverb/EnvReverbSw.h b/audio/aidl/default/envReverb/EnvReverbSw.h index dd2cf5deb2..5e31e2f8b2 100644 --- a/audio/aidl/default/envReverb/EnvReverbSw.h +++ b/audio/aidl/default/envReverb/EnvReverbSw.h @@ -22,7 +22,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/equalizer/EqualizerSw.cpp b/audio/aidl/default/equalizer/EqualizerSw.cpp index 0fa7a11607..97699249fc 100644 --- a/audio/aidl/default/equalizer/EqualizerSw.cpp +++ b/audio/aidl/default/equalizer/EqualizerSw.cpp @@ -20,19 +20,21 @@ #define LOG_TAG "AHAL_EqualizerSw" #include #include +#include #include "EqualizerSw.h" using aidl::android::hardware::audio::effect::Descriptor; using aidl::android::hardware::audio::effect::EqualizerSw; +using aidl::android::hardware::audio::effect::getEffectImplUuidEqualizerSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidEqualizer; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kEqualizerSwImplUUID; using aidl::android::hardware::audio::effect::State; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kEqualizerSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidEqualizerSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -47,7 +49,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kEqualizerSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidEqualizerSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -86,15 +88,16 @@ const std::vector EqualizerSw::kRanges = { MAKE_RANGE(Equalizer, centerFreqMh, std::vector({1}), std::vector({0}))}; const Capability EqualizerSw::kEqCap = {.range = EqualizerSw::kRanges}; -const Descriptor EqualizerSw::kDesc = {.common = {.id = {.type = kEqualizerTypeUUID, - .uuid = kEqualizerSwImplUUID, - .proxy = kEqualizerProxyUUID}, - .flags = {.type = Flags::Type::INSERT, - .insert = Flags::Insert::FIRST, - .volume = Flags::Volume::CTRL}, - .name = EqualizerSw::kEffectName, - .implementor = "The Android Open Source Project"}, - .capability = EqualizerSw::kEqCap}; +const Descriptor EqualizerSw::kDesc = { + .common = {.id = {.type = getEffectTypeUuidEqualizer(), + .uuid = getEffectImplUuidEqualizerSw(), + .proxy = getEffectImplUuidEqualizerProxy()}, + .flags = {.type = Flags::Type::INSERT, + .insert = Flags::Insert::FIRST, + .volume = Flags::Volume::CTRL}, + .name = EqualizerSw::kEffectName, + .implementor = "The Android Open Source Project"}, + .capability = EqualizerSw::kEqCap}; ndk::ScopedAStatus EqualizerSw::getDescriptor(Descriptor* _aidl_return) { LOG(DEBUG) << __func__ << kDesc.toString(); diff --git a/audio/aidl/default/equalizer/EqualizerSw.h b/audio/aidl/default/equalizer/EqualizerSw.h index f8987c718b..56af3b5821 100644 --- a/audio/aidl/default/equalizer/EqualizerSw.h +++ b/audio/aidl/default/equalizer/EqualizerSw.h @@ -22,7 +22,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/extension/ExtensionEffect.cpp b/audio/aidl/default/extension/ExtensionEffect.cpp index db1e4a4bf3..c4eebc005f 100644 --- a/audio/aidl/default/extension/ExtensionEffect.cpp +++ b/audio/aidl/default/extension/ExtensionEffect.cpp @@ -23,22 +23,23 @@ #define LOG_TAG "AHAL_ExtensionEffect" #include #include +#include #include "ExtensionEffect.h" using aidl::android::hardware::audio::effect::DefaultExtension; using aidl::android::hardware::audio::effect::Descriptor; using aidl::android::hardware::audio::effect::ExtensionEffect; +using aidl::android::hardware::audio::effect::getEffectUuidExtensionImpl; +using aidl::android::hardware::audio::effect::getEffectUuidExtensionType; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kExtensionEffectImplUUID; -using aidl::android::hardware::audio::effect::kExtensionEffectTypeUUID; using aidl::android::hardware::audio::effect::Range; using aidl::android::hardware::audio::effect::VendorExtension; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kExtensionEffectImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectUuidExtensionImpl()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -53,7 +54,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kExtensionEffectImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectUuidExtensionImpl()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -66,8 +67,8 @@ namespace aidl::android::hardware::audio::effect { const std::string ExtensionEffect::kEffectName = "ExtensionEffectExample"; const Descriptor ExtensionEffect::kDescriptor = { - .common = {.id = {.type = kExtensionEffectTypeUUID, - .uuid = kExtensionEffectImplUUID, + .common = {.id = {.type = getEffectUuidExtensionType(), + .uuid = getEffectUuidExtensionImpl(), .proxy = std::nullopt}, .name = ExtensionEffect::kEffectName, .implementor = "The Android Open Source Project"}}; diff --git a/audio/aidl/default/extension/ExtensionEffect.h b/audio/aidl/default/extension/ExtensionEffect.h index f432d4096d..e7a068ba46 100644 --- a/audio/aidl/default/extension/ExtensionEffect.h +++ b/audio/aidl/default/extension/ExtensionEffect.h @@ -22,7 +22,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/hapticGenerator/HapticGeneratorSw.cpp b/audio/aidl/default/hapticGenerator/HapticGeneratorSw.cpp index 944f715ed3..27cdac8086 100644 --- a/audio/aidl/default/hapticGenerator/HapticGeneratorSw.cpp +++ b/audio/aidl/default/hapticGenerator/HapticGeneratorSw.cpp @@ -20,19 +20,21 @@ #define LOG_TAG "AHAL_HapticGeneratorSw" #include #include +#include #include "HapticGeneratorSw.h" using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidHapticGeneratorSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidHapticGenerator; using aidl::android::hardware::audio::effect::HapticGeneratorSw; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kHapticGeneratorSwImplUUID; using aidl::android::hardware::audio::effect::State; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kHapticGeneratorSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidHapticGeneratorSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -47,7 +49,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kHapticGeneratorSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidHapticGeneratorSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -60,8 +62,8 @@ namespace aidl::android::hardware::audio::effect { const std::string HapticGeneratorSw::kEffectName = "HapticGeneratorSw"; /* Effect descriptor */ const Descriptor HapticGeneratorSw::kDescriptor = { - .common = {.id = {.type = kHapticGeneratorTypeUUID, - .uuid = kHapticGeneratorSwImplUUID, + .common = {.id = {.type = getEffectTypeUuidHapticGenerator(), + .uuid = getEffectImplUuidHapticGeneratorSw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/hapticGenerator/HapticGeneratorSw.h b/audio/aidl/default/hapticGenerator/HapticGeneratorSw.h index 428f460885..3bbe41ad29 100644 --- a/audio/aidl/default/hapticGenerator/HapticGeneratorSw.h +++ b/audio/aidl/default/hapticGenerator/HapticGeneratorSw.h @@ -16,13 +16,14 @@ #pragma once -#include -#include #include +#include #include +#include +#include + #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/include/effect-impl/EffectTypes.h b/audio/aidl/default/include/effect-impl/EffectTypes.h index fe534d772d..4bda7bea21 100644 --- a/audio/aidl/default/include/effect-impl/EffectTypes.h +++ b/audio/aidl/default/include/effect-impl/EffectTypes.h @@ -15,7 +15,6 @@ */ #pragma once -#include #include #include @@ -128,23 +127,4 @@ inline std::ostream& operator<<(std::ostream& out, const RetCode& code) { #define MAKE_RANGE(T, Tag, l, r) \ { .min = T::make(l), .max = T::make(r) } -static inline bool stringToUuid(const char* str, - ::aidl::android::media::audio::common::AudioUuid* uuid) { - RETURN_VALUE_IF(!uuid || !str, false, "nullPtr"); - - uint32_t tmp[10]; - if (sscanf(str, "%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x", tmp, tmp + 1, tmp + 2, tmp + 3, - tmp + 4, tmp + 5, tmp + 6, tmp + 7, tmp + 8, tmp + 9) < 10) { - return false; - } - - uuid->timeLow = (uint32_t)tmp[0]; - uuid->timeMid = (uint16_t)tmp[1]; - uuid->timeHiAndVersion = (uint16_t)tmp[2]; - uuid->clockSeq = (uint16_t)tmp[3]; - uuid->node.insert(uuid->node.end(), {(uint8_t)tmp[4], (uint8_t)tmp[5], (uint8_t)tmp[6], - (uint8_t)tmp[7], (uint8_t)tmp[8], (uint8_t)tmp[9]}); - return true; -} - } // namespace aidl::android::hardware::audio::effect diff --git a/audio/aidl/default/include/effect-impl/EffectUUID.h b/audio/aidl/default/include/effect-impl/EffectUUID.h deleted file mode 100644 index bc61c0f4cc..0000000000 --- a/audio/aidl/default/include/effect-impl/EffectUUID.h +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once -#include - -#include - -namespace aidl::android::hardware::audio::effect { - -using ::aidl::android::media::audio::common::AudioUuid; - -// ec7178ec-e5e1-4432-a3f4-4657e6795210 -static const AudioUuid kEffectNullUuid = {static_cast(0xec7178ec), - 0xe5e1, - 0x4432, - 0xa3f4, - {0x46, 0x57, 0xe6, 0x79, 0x52, 0x10}}; -// Zero UUID -static const AudioUuid kEffectZeroUuid = { - static_cast(0x0), 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}; - -// 7b491460-8d4d-11e0-bd61-0002a5d5c51b. -static const AudioUuid kAcousticEchoCancelerTypeUUID = {static_cast(0x7b491460), - 0x8d4d, - 0x11e0, - 0xbd61, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// bb392ec0-8d4d-11e0-a896-0002a5d5c51b -static const AudioUuid kAcousticEchoCancelerSwImplUUID = {static_cast(0xbb392ec0), - 0x8d4d, - 0x11e0, - 0xa896, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// 0a8abfe0-654c-11e0-ba26-0002a5d5c51b -static const AudioUuid kAutomaticGainControlV1TypeUUID = {static_cast(0x0a8abfe0), - 0x654c, - 0x11e0, - 0xba26, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// aa8130e0-66fc-11e0-bad0-0002a5d5c51b -static const AudioUuid kAutomaticGainControlV1SwImplUUID = {static_cast(0xaa8130e0), - 0x66fc, - 0x11e0, - 0xbad0, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// ae3c653b-be18-4ab8-8938-418f0a7f06ac -static const AudioUuid kAutomaticGainControlV2TypeUUID = {static_cast(0xae3c653b), - 0xbe18, - 0x4ab8, - 0x8938, - {0x41, 0x8f, 0x0a, 0x7f, 0x06, 0xac}}; -// 89f38e65-d4d2-4d64-ad0e-2b3e799ea886 -static const AudioUuid kAutomaticGainControlV2SwImplUUID = {static_cast(0x89f38e65), - 0xd4d2, - 0x4d64, - 0xad0e, - {0x2b, 0x3e, 0x79, 0x9e, 0xa8, 0x86}}; -// 0634f220-ddd4-11db-a0fc-0002a5d5c51b -static const AudioUuid kBassBoostTypeUUID = {static_cast(0x0634f220), - 0xddd4, - 0x11db, - 0xa0fc, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// fa8181f2-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kBassBoostSwImplUUID = {static_cast(0xfa8181f2), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// 8631f300-72e2-11df-b57e-0002a5d5c51b -static const AudioUuid kBassBoostBundleImplUUID = {static_cast(0x8631f300), - 0x72e2, - 0x11df, - 0xb57e, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// 14804144-a5ee-4d24-aa88-0002a5d5c51b -static const AudioUuid kBassBoostProxyUUID = {static_cast(0x14804144), - 0xa5ee, - 0x4d24, - 0xaa88, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// 381e49cc-a858-4aa2-87f6-e8388e7601b2 -static const AudioUuid kDownmixTypeUUID = {static_cast(0x381e49cc), - 0xa858, - 0x4aa2, - 0x87f6, - {0xe8, 0x38, 0x8e, 0x76, 0x01, 0xb2}}; -// fa8187ba-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kDownmixSwImplUUID = {static_cast(0xfa8187ba), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// 93f04452-e4fe-41cc-91f9-e475b6d1d69f -static const AudioUuid kDownmixImplUUID = {static_cast(0x93f04452), - 0xe4fe, - 0x41cc, - 0x91f9, - {0xe4, 0x75, 0xb6, 0xd1, 0xd6, 0x9f}}; -// 0bed4300-ddd6-11db-8f34-0002a5d5c51b. -static const AudioUuid kEqualizerTypeUUID = {static_cast(0x0bed4300), - 0xddd6, - 0x11db, - 0x8f34, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// 0bed4300-847d-11df-bb17-0002a5d5c51b -static const AudioUuid kEqualizerSwImplUUID = {static_cast(0x0bed4300), - 0x847d, - 0x11df, - 0xbb17, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// ce772f20-847d-11df-bb17-0002a5d5c51b -static const AudioUuid kEqualizerBundleImplUUID = {static_cast(0xce772f20), - 0x847d, - 0x11df, - 0xbb17, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// c8e70ecd-48ca-456e-8a4f-0002a5d5c51b -static const AudioUuid kEqualizerProxyUUID = {static_cast(0xc8e70ecd), - 0x48ca, - 0x456e, - 0x8a4f, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// 7261676f-6d75-7369-6364-28e2fd3ac39e -static const AudioUuid kDynamicsProcessingTypeUUID = {static_cast(0x7261676f), - 0x6d75, - 0x7369, - 0x6364, - {0x28, 0xe2, 0xfd, 0x3a, 0xc3, 0x9e}}; -// fa818d78-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kDynamicsProcessingSwImplUUID = {static_cast(0xfa818d78), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// e0e6539b-1781-7261-676f-6d7573696340 -static const AudioUuid kDynamicsProcessingImplUUID = {static_cast(0xe0e6539b), - 0x1781, - 0x7261, - 0x676f, - {0x6d, 0x75, 0x73, 0x69, 0x63, 0x40}}; -// 1411e6d6-aecd-4021-a1cf-a6aceb0d71e5 -static const AudioUuid kHapticGeneratorTypeUUID = {static_cast(0x1411e6d6), - 0xaecd, - 0x4021, - 0xa1cf, - {0xa6, 0xac, 0xeb, 0x0d, 0x71, 0xe5}}; -// fa819110-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kHapticGeneratorSwImplUUID = {static_cast(0xfa819110), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// 97c4acd1-8b82-4f2f-832e-c2fe5d7a9931 -static const AudioUuid kHapticGeneratorImplUUID = {static_cast(0x97c4acd1), - 0x8b82, - 0x4f2f, - 0x832e, - {0xc2, 0xfe, 0x5d, 0x7a, 0x99, 0x31}}; -// fe3199be-aed0-413f-87bb-11260eb63cf1 -static const AudioUuid kLoudnessEnhancerTypeUUID = {static_cast(0xfe3199be), - 0xaed0, - 0x413f, - 0x87bb, - {0x11, 0x26, 0x0e, 0xb6, 0x3c, 0xf1}}; -// fa819610-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kLoudnessEnhancerSwImplUUID = {static_cast(0xfa819610), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// fa415329-2034-4bea-b5dc-5b381c8d1e2c -static const AudioUuid kLoudnessEnhancerImplUUID = {static_cast(0xfa415329), - 0x2034, - 0x4bea, - 0xb5dc, - {0x5b, 0x38, 0x1c, 0x8d, 0x1e, 0x2c}}; -// c2e5d5f0-94bd-4763-9cac-4e234d06839e -static const AudioUuid kEnvReverbTypeUUID = {static_cast(0xc2e5d5f0), - 0x94bd, - 0x4763, - 0x9cac, - {0x4e, 0x23, 0x4d, 0x06, 0x83, 0x9e}}; -// fa819886-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kEnvReverbSwImplUUID = {static_cast(0xfa819886), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// 4a387fc0-8ab3-11df-8bad-0002a5d5c51b -static const AudioUuid kAuxEnvReverbImplUUID = {static_cast(0x4a387fc0), - 0x8ab3, - 0x11df, - 0x8bad, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// c7a511a0-a3bb-11df-860e-0002a5d5c51b -static const AudioUuid kInsertEnvReverbImplUUID = {static_cast(0xc7a511a0), - 0xa3bb, - 0x11df, - 0x860e, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// 58b4b260-8e06-11e0-aa8e-0002a5d5c51b -static const AudioUuid kNoiseSuppressionTypeUUID = {static_cast(0x58b4b260), - 0x8e06, - 0x11e0, - 0xaa8e, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// c06c8400-8e06-11e0-9cb6-0002a5d5c51b -static const AudioUuid kNoiseSuppressionSwImplUUID = {static_cast(0xc06c8400), - 0x8e06, - 0x11e0, - 0x9cb6, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// 47382d60-ddd8-11db-bf3a-0002a5d5c51b -static const AudioUuid kPresetReverbTypeUUID = {static_cast(0x47382d60), - 0xddd8, - 0x11db, - 0xbf3a, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// fa8199c6-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kPresetReverbSwImplUUID = {static_cast(0xfa8199c6), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// f29a1400-a3bb-11df-8ddc-0002a5d5c51b -static const AudioUuid kAuxPresetReverbImplUUID = {static_cast(0xf29a1400), - 0xa3bb, - 0x11df, - 0x8ddc, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// 172cdf00-a3bc-11df-a72f-0002a5d5c51b -static const AudioUuid kInsertPresetReverbImplUUID = {static_cast(0x172cdf00), - 0xa3bc, - 0x11df, - 0xa72f, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// 37cc2c00-dddd-11db-8577-0002a5d5c51b -static const AudioUuid kVirtualizerTypeUUID = {static_cast(0x37cc2c00), - 0xdddd, - 0x11db, - 0x8577, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// fa819d86-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kVirtualizerSwImplUUID = {static_cast(0xfa819d86), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// 1d4033c0-8557-11df-9f2d-0002a5d5c51b -static const AudioUuid kVirtualizerBundleImplUUID = {static_cast(0x1d4033c0), - 0x8557, - 0x11df, - 0x9f2d, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// d3467faa-acc7-4d34-acaf-0002a5d5c51b -static const AudioUuid kVirtualizerProxyUUID = {static_cast(0xd3467faa), - 0xacc7, - 0x4d34, - 0xacaf, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// e46b26a0-dddd-11db-8afd-0002a5d5c51b -static const AudioUuid kVisualizerTypeUUID = {static_cast(0xe46b26a0), - 0xdddd, - 0x11db, - 0x8afd, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// fa81a0f6-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kVisualizerSwImplUUID = {static_cast(0xfa81a0f6), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// d069d9e0-8329-11df-9168-0002a5d5c51b -// {0xd069d9e0, 0x8329, 0x11df, 0x9168, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}, -static const AudioUuid kVisualizerImplUUID = {static_cast(0xd069d9e0), - 0x8329, - 0x11df, - 0x9168, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; -// fa81a2b8-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kVolumeTypeUUID = {static_cast(0xfa81a2b8), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// fa81a718-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kVolumeSwImplUUID = {static_cast(0xfa81a718), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// 119341a0-8469-11df-81f9-0002a5d5c51b -static const AudioUuid kVolumeBundleImplUUID = {static_cast(0x119341a0), - 0x8469, - 0x11df, - 0x81f9, - {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; - -// fa81dbde-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kExtensionEffectTypeUUID = {static_cast(0xfa81dbde), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -// fa81dd00-588b-11ed-9b6a-0242ac120002 -static const AudioUuid kExtensionEffectImplUUID = {static_cast(0xfa81dd00), - 0x588b, - 0x11ed, - 0x9b6a, - {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; -/** - * @brief A map between effect name and effect type UUID. - * All attribution in effect/effectProxy of audio_effects.xml should be listed in this map. - * We need this map is because existing audio_effects.xml don't have a type UUID defined. - */ -static const std::map kUuidNameTypeMap = { - {"acoustic_echo_canceler", kAcousticEchoCancelerTypeUUID}, - {"automatic_gain_control_v1", kAutomaticGainControlV1TypeUUID}, - {"automatic_gain_control_v2", kAutomaticGainControlV2TypeUUID}, - {"bassboost", kBassBoostTypeUUID}, - {"downmix", kDownmixTypeUUID}, - {"dynamics_processing", kDynamicsProcessingTypeUUID}, - {"equalizer", kEqualizerTypeUUID}, - {"extensioneffect", kExtensionEffectTypeUUID}, - {"haptic_generator", kHapticGeneratorTypeUUID}, - {"loudness_enhancer", kLoudnessEnhancerTypeUUID}, - {"env_reverb", kEnvReverbTypeUUID}, - {"noise_suppression", kNoiseSuppressionTypeUUID}, - {"preset_reverb", kPresetReverbTypeUUID}, - {"reverb_env_aux", kEnvReverbTypeUUID}, - {"reverb_env_ins", kEnvReverbTypeUUID}, - {"reverb_pre_aux", kPresetReverbTypeUUID}, - {"reverb_pre_ins", kPresetReverbTypeUUID}, - {"virtualizer", kVirtualizerTypeUUID}, - {"visualizer", kVisualizerTypeUUID}, - {"volume", kVolumeTypeUUID}, -}; - -} // namespace aidl::android::hardware::audio::effect diff --git a/audio/aidl/default/include/effectFactory-impl/EffectConfig.h b/audio/aidl/default/include/effectFactory-impl/EffectConfig.h index c499811f12..c627a273d9 100644 --- a/audio/aidl/default/include/effectFactory-impl/EffectConfig.h +++ b/audio/aidl/default/include/effectFactory-impl/EffectConfig.h @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include #include @@ -62,6 +63,9 @@ class EffectConfig { return mProcessingMap; } + static bool findUuid(const std::string& xmlEffectName, + ::aidl::android::media::audio::common::AudioUuid* uuid); + private: static constexpr const char* kEffectLibPath[] = #ifdef __LP64__ diff --git a/audio/aidl/default/include/effectFactory-impl/EffectFactory.h b/audio/aidl/default/include/effectFactory-impl/EffectFactory.h index fc9ef0290f..b7f63afca0 100644 --- a/audio/aidl/default/include/effectFactory-impl/EffectFactory.h +++ b/audio/aidl/default/include/effectFactory-impl/EffectFactory.h @@ -105,7 +105,7 @@ class Factory : public BnFactory { const std::string& path); void createIdentityWithConfig( const EffectConfig::LibraryUuid& configLib, - const ::aidl::android::media::audio::common::AudioUuid& typeUuid, + const ::aidl::android::media::audio::common::AudioUuid& typeUuidStr, const std::optional<::aidl::android::media::audio::common::AudioUuid> proxyUuid); void loadEffectLibs(); /* Get effect_dl_interface_s from library handle */ diff --git a/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.cpp b/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.cpp index f115cc51d2..7954316654 100644 --- a/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.cpp +++ b/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.cpp @@ -20,19 +20,21 @@ #define LOG_TAG "AHAL_LoudnessEnhancerSw" #include #include +#include #include "LoudnessEnhancerSw.h" using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidLoudnessEnhancerSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidLoudnessEnhancer; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kLoudnessEnhancerSwImplUUID; using aidl::android::hardware::audio::effect::LoudnessEnhancerSw; using aidl::android::hardware::audio::effect::State; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kLoudnessEnhancerSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidLoudnessEnhancerSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -47,7 +49,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kLoudnessEnhancerSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidLoudnessEnhancerSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -59,8 +61,8 @@ namespace aidl::android::hardware::audio::effect { const std::string LoudnessEnhancerSw::kEffectName = "LoudnessEnhancerSw"; const Descriptor LoudnessEnhancerSw::kDescriptor = { - .common = {.id = {.type = kLoudnessEnhancerTypeUUID, - .uuid = kLoudnessEnhancerSwImplUUID, + .common = {.id = {.type = getEffectTypeUuidLoudnessEnhancer(), + .uuid = getEffectImplUuidLoudnessEnhancerSw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.h b/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.h index e252f4acd1..25824f20d5 100644 --- a/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.h +++ b/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.h @@ -22,7 +22,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.cpp b/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.cpp index ba39b16217..9b2cb7ca6c 100644 --- a/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.cpp +++ b/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.cpp @@ -17,22 +17,25 @@ #include #include #include +#define LOG_TAG "AHAL_NoiseSuppressionSw" #define LOG_TAG "AHAL_NoiseSuppressionSw" #include #include +#include #include "NoiseSuppressionSw.h" using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidNoiseSuppressionSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidNoiseSuppression; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kNoiseSuppressionSwImplUUID; using aidl::android::hardware::audio::effect::NoiseSuppressionSw; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kNoiseSuppressionSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidNoiseSuppressionSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -47,7 +50,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kNoiseSuppressionSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidNoiseSuppressionSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -59,8 +62,8 @@ namespace aidl::android::hardware::audio::effect { const std::string NoiseSuppressionSw::kEffectName = "NoiseSuppressionSw"; const Descriptor NoiseSuppressionSw::kDescriptor = { - .common = {.id = {.type = kNoiseSuppressionTypeUUID, - .uuid = kNoiseSuppressionSwImplUUID, + .common = {.id = {.type = getEffectTypeUuidNoiseSuppression(), + .uuid = getEffectImplUuidNoiseSuppressionSw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.h b/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.h index 22bf0666c0..fc1e028808 100644 --- a/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.h +++ b/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.h @@ -16,13 +16,13 @@ #pragma once -#include -#include #include #include +#include +#include + #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/presetReverb/PresetReverbSw.cpp b/audio/aidl/default/presetReverb/PresetReverbSw.cpp index 14546a4a9e..3f02eb7382 100644 --- a/audio/aidl/default/presetReverb/PresetReverbSw.cpp +++ b/audio/aidl/default/presetReverb/PresetReverbSw.cpp @@ -21,19 +21,21 @@ #include #include #include +#include #include "PresetReverbSw.h" using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidPresetReverbSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidPresetReverb; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kPresetReverbSwImplUUID; using aidl::android::hardware::audio::effect::PresetReverbSw; using aidl::android::hardware::audio::effect::State; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kPresetReverbSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidPresetReverbSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -48,7 +50,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kPresetReverbSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidPresetReverbSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -72,8 +74,8 @@ const Capability PresetReverbSw::kCapability = { .range = Range::make(PresetReverbSw::kRanges)}; const Descriptor PresetReverbSw::kDescriptor = { - .common = {.id = {.type = kPresetReverbTypeUUID, - .uuid = kPresetReverbSwImplUUID, + .common = {.id = {.type = getEffectTypeUuidPresetReverb(), + .uuid = getEffectImplUuidPresetReverbSw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/presetReverb/PresetReverbSw.h b/audio/aidl/default/presetReverb/PresetReverbSw.h index 5061475630..9ceee7cca9 100644 --- a/audio/aidl/default/presetReverb/PresetReverbSw.h +++ b/audio/aidl/default/presetReverb/PresetReverbSw.h @@ -22,7 +22,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/virtualizer/VirtualizerSw.cpp b/audio/aidl/default/virtualizer/VirtualizerSw.cpp index c5a0e8d335..e34464f460 100644 --- a/audio/aidl/default/virtualizer/VirtualizerSw.cpp +++ b/audio/aidl/default/virtualizer/VirtualizerSw.cpp @@ -21,12 +21,14 @@ #include #include #include +#include #include "VirtualizerSw.h" using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidVirtualizerSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidVirtualizer; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kVirtualizerSwImplUUID; using aidl::android::hardware::audio::effect::State; using aidl::android::hardware::audio::effect::VirtualizerSw; using aidl::android::media::audio::common::AudioChannelLayout; @@ -36,7 +38,7 @@ using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kVirtualizerSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVirtualizerSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -51,7 +53,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kVirtualizerSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVirtualizerSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -73,9 +75,9 @@ const Capability VirtualizerSw::kCapability = { .range = Range::make(VirtualizerSw::kRanges)}; const Descriptor VirtualizerSw::kDescriptor = { - .common = {.id = {.type = kVirtualizerTypeUUID, - .uuid = kVirtualizerSwImplUUID, - .proxy = kVirtualizerProxyUUID}, + .common = {.id = {.type = getEffectTypeUuidVirtualizer(), + .uuid = getEffectImplUuidVirtualizerSw(), + .proxy = getEffectImplUuidVirtualizerProxy()}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, .volume = Flags::Volume::CTRL}, diff --git a/audio/aidl/default/virtualizer/VirtualizerSw.h b/audio/aidl/default/virtualizer/VirtualizerSw.h index 5c5b616742..5e114d9abd 100644 --- a/audio/aidl/default/virtualizer/VirtualizerSw.h +++ b/audio/aidl/default/virtualizer/VirtualizerSw.h @@ -22,7 +22,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/visualizer/VisualizerSw.cpp b/audio/aidl/default/visualizer/VisualizerSw.cpp index deb3204a06..0909f25144 100644 --- a/audio/aidl/default/visualizer/VisualizerSw.cpp +++ b/audio/aidl/default/visualizer/VisualizerSw.cpp @@ -17,19 +17,21 @@ #define LOG_TAG "AHAL_VisualizerSw" #include +#include #include "VisualizerSw.h" using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidVisualizerSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidVisualizer; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kVisualizerSwImplUUID; using aidl::android::hardware::audio::effect::State; using aidl::android::hardware::audio::effect::VisualizerSw; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kVisualizerSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVisualizerSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -44,7 +46,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kVisualizerSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVisualizerSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -66,8 +68,8 @@ const Capability VisualizerSw::kCapability = { .range = Range::make(VisualizerSw::kRanges)}; const Descriptor VisualizerSw::kDescriptor = { - .common = {.id = {.type = kVisualizerTypeUUID, - .uuid = kVisualizerSwImplUUID, + .common = {.id = {.type = getEffectTypeUuidVisualizer(), + .uuid = getEffectImplUuidVisualizerSw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/visualizer/VisualizerSw.h b/audio/aidl/default/visualizer/VisualizerSw.h index ee7276a319..995774e197 100644 --- a/audio/aidl/default/visualizer/VisualizerSw.h +++ b/audio/aidl/default/visualizer/VisualizerSw.h @@ -16,11 +16,10 @@ #pragma once -#include #include +#include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/default/volume/VolumeSw.cpp b/audio/aidl/default/volume/VolumeSw.cpp index 44cac446ba..890258457f 100644 --- a/audio/aidl/default/volume/VolumeSw.cpp +++ b/audio/aidl/default/volume/VolumeSw.cpp @@ -20,19 +20,21 @@ #define LOG_TAG "AHAL_VolumeSw" #include #include +#include #include "VolumeSw.h" using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectImplUuidVolumeSw; +using aidl::android::hardware::audio::effect::getEffectTypeUuidVolume; using aidl::android::hardware::audio::effect::IEffect; -using aidl::android::hardware::audio::effect::kVolumeSwImplUUID; using aidl::android::hardware::audio::effect::State; using aidl::android::hardware::audio::effect::VolumeSw; using aidl::android::media::audio::common::AudioUuid; extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, std::shared_ptr* instanceSpp) { - if (!in_impl_uuid || *in_impl_uuid != kVolumeSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVolumeSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -47,7 +49,7 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid, } extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) { - if (!in_impl_uuid || *in_impl_uuid != kVolumeSwImplUUID) { + if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVolumeSw()) { LOG(ERROR) << __func__ << "uuid not supported"; return EX_ILLEGAL_ARGUMENT; } @@ -64,8 +66,8 @@ const std::vector VolumeSw::kRanges = {MAKE_RANGE(Volume, le const Capability VolumeSw::kCapability = {.range = Range::make(VolumeSw::kRanges)}; const Descriptor VolumeSw::kDescriptor = { - .common = {.id = {.type = kVolumeTypeUUID, - .uuid = kVolumeSwImplUUID, + .common = {.id = {.type = getEffectTypeUuidVolume(), + .uuid = getEffectImplUuidVolumeSw(), .proxy = std::nullopt}, .flags = {.type = Flags::Type::INSERT, .insert = Flags::Insert::FIRST, diff --git a/audio/aidl/default/volume/VolumeSw.h b/audio/aidl/default/volume/VolumeSw.h index 2dd4324bad..1432b2be0d 100644 --- a/audio/aidl/default/volume/VolumeSw.h +++ b/audio/aidl/default/volume/VolumeSw.h @@ -22,7 +22,6 @@ #include #include "effect-impl/EffectImpl.h" -#include "effect-impl/EffectUUID.h" namespace aidl::android::hardware::audio::effect { diff --git a/audio/aidl/vts/Android.bp b/audio/aidl/vts/Android.bp index 8db8eaf9aa..18aa6f0a51 100644 --- a/audio/aidl/vts/Android.bp +++ b/audio/aidl/vts/Android.bp @@ -37,6 +37,7 @@ cc_defaults { "general-tests", "vts", ], + srcs: [":effectCommonFile"], } cc_test { diff --git a/audio/aidl/vts/EffectFactoryHelper.h b/audio/aidl/vts/EffectFactoryHelper.h index 4add844533..a2499fd3c1 100644 --- a/audio/aidl/vts/EffectFactoryHelper.h +++ b/audio/aidl/vts/EffectFactoryHelper.h @@ -24,7 +24,6 @@ #include #include "TestUtils.h" -#include "effect-impl/EffectUUID.h" using namespace android; diff --git a/audio/aidl/vts/EffectHelper.h b/audio/aidl/vts/EffectHelper.h index a128f7c050..f6683cc5b1 100644 --- a/audio/aidl/vts/EffectHelper.h +++ b/audio/aidl/vts/EffectHelper.h @@ -31,6 +31,7 @@ #include #include #include +#include #include "AudioHalBinderServiceUtil.h" #include "EffectFactoryHelper.h" diff --git a/audio/aidl/vts/VtsHalAECTargetTest.cpp b/audio/aidl/vts/VtsHalAECTargetTest.cpp index 2d36cbb181..8828c41bbe 100644 --- a/audio/aidl/vts/VtsHalAECTargetTest.cpp +++ b/audio/aidl/vts/VtsHalAECTargetTest.cpp @@ -29,9 +29,9 @@ using namespace android; using aidl::android::hardware::audio::effect::AcousticEchoCanceler; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidAcousticEchoCanceler; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kAcousticEchoCancelerTypeUUID; using aidl::android::hardware::audio::effect::Parameter; using aidl::android::hardware::audio::effect::Range; @@ -148,7 +148,8 @@ INSTANTIATE_TEST_SUITE_P( AECParamTest, AECParamTest, ::testing::Combine( testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kAcousticEchoCancelerTypeUUID)), + IFactory::descriptor, + getEffectTypeUuidAcousticEchoCanceler())), testing::ValuesIn(EffectHelper::getTestValueSet( diff --git a/audio/aidl/vts/VtsHalAGC1TargetTest.cpp b/audio/aidl/vts/VtsHalAGC1TargetTest.cpp index 15a9374352..edfcdf6fce 100644 --- a/audio/aidl/vts/VtsHalAGC1TargetTest.cpp +++ b/audio/aidl/vts/VtsHalAGC1TargetTest.cpp @@ -24,9 +24,9 @@ using namespace android; using aidl::android::hardware::audio::effect::AutomaticGainControlV1; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidAutomaticGainControlV1; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kAutomaticGainControlV1TypeUUID; using aidl::android::hardware::audio::effect::Parameter; enum ParamName { @@ -158,7 +158,8 @@ INSTANTIATE_TEST_SUITE_P( AGC1ParamTest, AGC1ParamTest, ::testing::Combine( testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kAutomaticGainControlV1TypeUUID)), + IFactory::descriptor, + getEffectTypeUuidAutomaticGainControlV1())), testing::ValuesIn(EffectHelper::getTestValueSet< AutomaticGainControlV1, int, Range::automaticGainControlV1, AutomaticGainControlV1::targetPeakLevelDbFs>( diff --git a/audio/aidl/vts/VtsHalAGC2TargetTest.cpp b/audio/aidl/vts/VtsHalAGC2TargetTest.cpp index 140537e67e..8ba8e45566 100644 --- a/audio/aidl/vts/VtsHalAGC2TargetTest.cpp +++ b/audio/aidl/vts/VtsHalAGC2TargetTest.cpp @@ -25,9 +25,9 @@ using namespace android; using aidl::android::hardware::audio::effect::AutomaticGainControlV2; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidAutomaticGainControlV2; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kAutomaticGainControlV2TypeUUID; using aidl::android::hardware::audio::effect::Parameter; enum ParamName { @@ -164,7 +164,8 @@ INSTANTIATE_TEST_SUITE_P( AGC2ParamTest, AGC2ParamTest, ::testing::Combine( testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kAutomaticGainControlV2TypeUUID)), + IFactory::descriptor, + getEffectTypeUuidAutomaticGainControlV2())), testing::ValuesIn(EffectHelper::getTestValueSet< AutomaticGainControlV2, int, Range::automaticGainControlV2, AutomaticGainControlV2::fixedDigitalGainMb>( diff --git a/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp b/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp index 21f5eb5636..7b9477dfa8 100644 --- a/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp +++ b/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -38,10 +39,10 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectUuidNull; +using aidl::android::hardware::audio::effect::getEffectUuidZero; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kEffectNullUuid; -using aidl::android::hardware::audio::effect::kEffectZeroUuid; using aidl::android::hardware::audio::effect::Processing; using aidl::android::media::audio::common::AudioSource; using aidl::android::media::audio::common::AudioStreamType; @@ -65,8 +66,8 @@ class EffectFactoryTest : public testing::TestWithParam { std::unique_ptr mFactoryHelper; std::shared_ptr mEffectFactory; std::vector> mEffects; - const Descriptor::Identity kNullId = {.uuid = kEffectNullUuid}; - const Descriptor::Identity kZeroId = {.uuid = kEffectZeroUuid}; + const Descriptor::Identity kNullId = {.uuid = getEffectUuidNull()}; + const Descriptor::Identity kZeroId = {.uuid = getEffectUuidZero()}; const Descriptor kNullDesc = {.common.id = kNullId}; const Descriptor kZeroDesc = {.common.id = kZeroId}; @@ -132,13 +133,13 @@ TEST_P(EffectFactoryTest, CanBeRestarted) { TEST_P(EffectFactoryTest, ExpectAllAospEffectTypes) { std::vector descs; std::set typeUuidSet( - {aidl::android::hardware::audio::effect::kBassBoostTypeUUID, - aidl::android::hardware::audio::effect::kEqualizerTypeUUID, - aidl::android::hardware::audio::effect::kEnvReverbTypeUUID, - aidl::android::hardware::audio::effect::kPresetReverbTypeUUID, - aidl::android::hardware::audio::effect::kDynamicsProcessingTypeUUID, - aidl::android::hardware::audio::effect::kHapticGeneratorTypeUUID, - aidl::android::hardware::audio::effect::kVirtualizerTypeUUID}); + {aidl::android::hardware::audio::effect::getEffectTypeUuidBassBoost(), + aidl::android::hardware::audio::effect::getEffectTypeUuidEqualizer(), + aidl::android::hardware::audio::effect::getEffectTypeUuidEnvReverb(), + aidl::android::hardware::audio::effect::getEffectTypeUuidPresetReverb(), + aidl::android::hardware::audio::effect::getEffectTypeUuidDynamicsProcessing(), + aidl::android::hardware::audio::effect::getEffectTypeUuidHapticGenerator(), + aidl::android::hardware::audio::effect::getEffectTypeUuidVirtualizer()}); EXPECT_IS_OK(mEffectFactory->queryEffects(std::nullopt, std::nullopt, std::nullopt, &descs)); EXPECT_TRUE(descs.size() >= typeUuidSet.size()); @@ -155,19 +156,22 @@ TEST_P(EffectFactoryTest, ExpectAllAospEffectTypes) { TEST_P(EffectFactoryTest, QueryNullTypeUuid) { std::vector descs; - EXPECT_IS_OK(mEffectFactory->queryEffects(kEffectNullUuid, std::nullopt, std::nullopt, &descs)); + EXPECT_IS_OK( + mEffectFactory->queryEffects(getEffectUuidNull(), std::nullopt, std::nullopt, &descs)); EXPECT_EQ(descs.size(), 0UL); } TEST_P(EffectFactoryTest, QueriedNullImplUuid) { std::vector descs; - EXPECT_IS_OK(mEffectFactory->queryEffects(std::nullopt, kEffectNullUuid, std::nullopt, &descs)); + EXPECT_IS_OK( + mEffectFactory->queryEffects(std::nullopt, getEffectUuidNull(), std::nullopt, &descs)); EXPECT_EQ(descs.size(), 0UL); } TEST_P(EffectFactoryTest, QueriedNullProxyUuid) { std::vector descs; - EXPECT_IS_OK(mEffectFactory->queryEffects(std::nullopt, std::nullopt, kEffectNullUuid, &descs)); + EXPECT_IS_OK( + mEffectFactory->queryEffects(std::nullopt, std::nullopt, getEffectUuidNull(), &descs)); EXPECT_EQ(descs.size(), 0UL); } diff --git a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp index 824bd9f2de..9cfdc50a2c 100644 --- a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp +++ b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp @@ -27,9 +27,9 @@ using namespace android; using aidl::android::hardware::audio::effect::BassBoost; using aidl::android::hardware::audio::effect::Capability; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidBassBoost; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kBassBoostTypeUUID; using aidl::android::hardware::audio::effect::Parameter; using aidl::android::hardware::audio::effect::Range; @@ -138,7 +138,7 @@ INSTANTIATE_TEST_SUITE_P( BassBoostTest, BassBoostParamTest, ::testing::Combine( testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kBassBoostTypeUUID)), + IFactory::descriptor, getEffectTypeUuidBassBoost())), testing::ValuesIn(EffectHelper::getTestValueSet( kDescPair, EffectHelper::expandTestValueBasic))), diff --git a/audio/aidl/vts/VtsHalDownmixTargetTest.cpp b/audio/aidl/vts/VtsHalDownmixTargetTest.cpp index bd3b76bba3..5aeebde1a0 100644 --- a/audio/aidl/vts/VtsHalDownmixTargetTest.cpp +++ b/audio/aidl/vts/VtsHalDownmixTargetTest.cpp @@ -24,10 +24,9 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; using aidl::android::hardware::audio::effect::Downmix; +using aidl::android::hardware::audio::effect::getEffectTypeUuidDownmix; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kDownmixTypeUUID; -using aidl::android::hardware::audio::effect::kEffectNullUuid; using aidl::android::hardware::audio::effect::Parameter; /** @@ -122,7 +121,7 @@ TEST_P(DownmixParamTest, SetAndGetType) { INSTANTIATE_TEST_SUITE_P( DownmixTest, DownmixParamTest, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kDownmixTypeUUID)), + IFactory::descriptor, getEffectTypeUuidDownmix())), testing::ValuesIn(kTypeValues)), [](const testing::TestParamInfo& info) { auto descriptor = std::get(info.param).second; diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp index 0b05b17e61..c62a24ea62 100644 --- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp +++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp @@ -30,9 +30,9 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; using aidl::android::hardware::audio::effect::DynamicsProcessing; +using aidl::android::hardware::audio::effect::getEffectTypeUuidDynamicsProcessing; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kDynamicsProcessingTypeUUID; using aidl::android::hardware::audio::effect::Parameter; /** @@ -428,7 +428,7 @@ INSTANTIATE_TEST_SUITE_P( DynamicsProcessingTest, DynamicsProcessingTestEngineArchitecture, ::testing::Combine( testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kDynamicsProcessingTypeUUID)), + IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())), testing::Values(DynamicsProcessing::ResolutionPreference::FAVOR_TIME_RESOLUTION, DynamicsProcessing::ResolutionPreference:: FAVOR_FREQUENCY_RESOLUTION), // variant @@ -480,7 +480,7 @@ TEST_P(DynamicsProcessingTestInputGain, SetAndGetInputGain) { INSTANTIATE_TEST_SUITE_P( DynamicsProcessingTest, DynamicsProcessingTestInputGain, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kDynamicsProcessingTypeUUID)), + IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())), testing::ValuesIn(DynamicsProcessingTestInputGain::kInputGainTestSet)), [](const auto& info) { auto descriptor = std::get(info.param).second; @@ -567,7 +567,7 @@ TEST_P(DynamicsProcessingTestLimiterConfig, SetAndGetLimiterConfig) { INSTANTIATE_TEST_SUITE_P( DynamicsProcessingTest, DynamicsProcessingTestLimiterConfig, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kDynamicsProcessingTypeUUID)), + IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())), testing::Values(-1, 0, 1, 2), // channel count testing::Bool(), // enable testing::Values(3), // link group @@ -642,7 +642,7 @@ INSTANTIATE_TEST_SUITE_P( DynamicsProcessingTest, DynamicsProcessingTestChannelConfig, ::testing::Combine( testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kDynamicsProcessingTypeUUID)), + IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())), testing::ValuesIn( DynamicsProcessingTestHelper::kChannelConfigTestSet), // channel config testing::Bool()), // Engine inUse @@ -778,7 +778,7 @@ INSTANTIATE_TEST_SUITE_P( DynamicsProcessingTest, DynamicsProcessingTestEqBandConfig, ::testing::Combine( testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kDynamicsProcessingTypeUUID)), + IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())), testing::Values(-1, 0, 10), // channel ID testing::ValuesIn( DynamicsProcessingTestHelper::kChannelConfigTestSet), // channel enable @@ -900,7 +900,7 @@ INSTANTIATE_TEST_SUITE_P( DynamicsProcessingTest, DynamicsProcessingTestMbcBandConfig, ::testing::Combine( testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kDynamicsProcessingTypeUUID)), + IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())), testing::Values(-1, 0, 10), // channel count testing::ValuesIn( DynamicsProcessingTestHelper::kChannelConfigTestSet), // channel config diff --git a/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp b/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp index a2deb7ca7c..05c2c5b5e6 100644 --- a/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp +++ b/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp @@ -24,9 +24,9 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; using aidl::android::hardware::audio::effect::EnvironmentalReverb; +using aidl::android::hardware::audio::effect::getEffectTypeUuidEnvReverb; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kEnvReverbTypeUUID; using aidl::android::hardware::audio::effect::Parameter; /** @@ -200,7 +200,7 @@ INSTANTIATE_TEST_SUITE_P( EnvironmentalReverbTest, EnvironmentalReverbRoomLevelTest, ::testing::Combine( testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kEnvReverbTypeUUID)), + IFactory::descriptor, getEffectTypeUuidEnvReverb())), testing::ValuesIn(EffectHelper::getTestValueSet( @@ -239,13 +239,12 @@ TEST_P(EnvironmentalReverbRoomHfLevelTest, SetAndGetRoomHfLevel) { INSTANTIATE_TEST_SUITE_P( EnvironmentalReverbTest, EnvironmentalReverbRoomHfLevelTest, - ::testing::Combine( - testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor, - kEnvReverbTypeUUID)), - testing::ValuesIn(EffectHelper::getTestValueSet( - kDescPair, EffectHelper::expandTestValueBasic))), + ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( + IFactory::descriptor, getEffectTypeUuidEnvReverb())), + testing::ValuesIn(EffectHelper::getTestValueSet< + EnvironmentalReverb, int, Range::environmentalReverb, + EnvironmentalReverb::roomHfLevelMb>( + kDescPair, EffectHelper::expandTestValueBasic))), [](const testing::TestParamInfo& info) { auto descriptor = std::get<0>(info.param).second; std::string roomHfLevel = std::to_string(std::get<1>(info.param)); @@ -280,13 +279,12 @@ TEST_P(EnvironmentalReverbDecayTimeTest, SetAndGetDecayTime) { INSTANTIATE_TEST_SUITE_P( EnvironmentalReverbTest, EnvironmentalReverbDecayTimeTest, - ::testing::Combine( - testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor, - kEnvReverbTypeUUID)), - testing::ValuesIn(EffectHelper::getTestValueSet( - kDescPair, EffectHelper::expandTestValueBasic))), + ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( + IFactory::descriptor, getEffectTypeUuidEnvReverb())), + testing::ValuesIn(EffectHelper::getTestValueSet< + EnvironmentalReverb, int, Range::environmentalReverb, + EnvironmentalReverb::decayTimeMs>( + kDescPair, EffectHelper::expandTestValueBasic))), [](const testing::TestParamInfo& info) { auto descriptor = std::get<0>(info.param).second; std::string decayTime = std::to_string(std::get<1>(info.param)); @@ -322,7 +320,7 @@ TEST_P(EnvironmentalReverbDecayHfRatioTest, SetAndGetDecayHfRatio) { INSTANTIATE_TEST_SUITE_P( EnvironmentalReverbTest, EnvironmentalReverbDecayHfRatioTest, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kEnvReverbTypeUUID)), + IFactory::descriptor, getEffectTypeUuidEnvReverb())), testing::ValuesIn(EffectHelper::getTestValueSet< EnvironmentalReverb, int, Range::environmentalReverb, EnvironmentalReverb::decayHfRatioPm>( @@ -362,13 +360,12 @@ TEST_P(EnvironmentalReverbLevelTest, SetAndGetLevel) { INSTANTIATE_TEST_SUITE_P( EnvironmentalReverbTest, EnvironmentalReverbLevelTest, - ::testing::Combine( - testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor, - kEnvReverbTypeUUID)), - testing::ValuesIn(EffectHelper::getTestValueSet( - kDescPair, EffectHelper::expandTestValueBasic))), + ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( + IFactory::descriptor, getEffectTypeUuidEnvReverb())), + testing::ValuesIn(EffectHelper::getTestValueSet< + EnvironmentalReverb, int, Range::environmentalReverb, + EnvironmentalReverb::levelMb>( + kDescPair, EffectHelper::expandTestValueBasic))), [](const testing::TestParamInfo& info) { auto descriptor = std::get<0>(info.param).second; std::string level = std::to_string(std::get<1>(info.param)); @@ -403,13 +400,12 @@ TEST_P(EnvironmentalReverbDelayTest, SetAndGetDelay) { INSTANTIATE_TEST_SUITE_P( EnvironmentalReverbTest, EnvironmentalReverbDelayTest, - ::testing::Combine( - testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor, - kEnvReverbTypeUUID)), - testing::ValuesIn(EffectHelper::getTestValueSet( - kDescPair, EffectHelper::expandTestValueBasic))), + ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( + IFactory::descriptor, getEffectTypeUuidEnvReverb())), + testing::ValuesIn(EffectHelper::getTestValueSet< + EnvironmentalReverb, int, Range::environmentalReverb, + EnvironmentalReverb::delayMs>( + kDescPair, EffectHelper::expandTestValueBasic))), [](const testing::TestParamInfo& info) { auto descriptor = std::get<0>(info.param).second; std::string delay = std::to_string(std::get<1>(info.param)); @@ -444,13 +440,12 @@ TEST_P(EnvironmentalReverbDiffusionTest, SetAndGetDiffusion) { INSTANTIATE_TEST_SUITE_P( EnvironmentalReverbTest, EnvironmentalReverbDiffusionTest, - ::testing::Combine( - testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor, - kEnvReverbTypeUUID)), - testing::ValuesIn(EffectHelper::getTestValueSet( - kDescPair, EffectHelper::expandTestValueBasic))), + ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( + IFactory::descriptor, getEffectTypeUuidEnvReverb())), + testing::ValuesIn(EffectHelper::getTestValueSet< + EnvironmentalReverb, int, Range::environmentalReverb, + EnvironmentalReverb::diffusionPm>( + kDescPair, EffectHelper::expandTestValueBasic))), [](const testing::TestParamInfo& info) { auto descriptor = std::get<0>(info.param).second; std::string diffusion = std::to_string(std::get<1>(info.param)); @@ -485,13 +480,12 @@ TEST_P(EnvironmentalReverbDensityTest, SetAndGetDensity) { INSTANTIATE_TEST_SUITE_P( EnvironmentalReverbTest, EnvironmentalReverbDensityTest, - ::testing::Combine( - testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor, - kEnvReverbTypeUUID)), - testing::ValuesIn(EffectHelper::getTestValueSet( - kDescPair, EffectHelper::expandTestValueBasic))), + ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( + IFactory::descriptor, getEffectTypeUuidEnvReverb())), + testing::ValuesIn(EffectHelper::getTestValueSet< + EnvironmentalReverb, int, Range::environmentalReverb, + EnvironmentalReverb::densityPm>( + kDescPair, EffectHelper::expandTestValueBasic))), [](const testing::TestParamInfo& info) { auto descriptor = std::get<0>(info.param).second; std::string density = std::to_string(std::get<1>(info.param)); @@ -527,7 +521,7 @@ TEST_P(EnvironmentalReverbBypassTest, SetAndGetBypass) { INSTANTIATE_TEST_SUITE_P( EnvironmentalReverbTest, EnvironmentalReverbBypassTest, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kEnvReverbTypeUUID)), + IFactory::descriptor, getEffectTypeUuidEnvReverb())), testing::Bool()), [](const testing::TestParamInfo& info) { auto descriptor = std::get<0>(info.param).second; diff --git a/audio/aidl/vts/VtsHalEqualizerTargetTest.cpp b/audio/aidl/vts/VtsHalEqualizerTargetTest.cpp index 9beb0a7210..716a2c67b5 100644 --- a/audio/aidl/vts/VtsHalEqualizerTargetTest.cpp +++ b/audio/aidl/vts/VtsHalEqualizerTargetTest.cpp @@ -37,15 +37,14 @@ #include "AudioHalBinderServiceUtil.h" #include "EffectHelper.h" #include "TestUtils.h" -#include "effect-impl/EffectUUID.h" using namespace android; using aidl::android::hardware::audio::effect::Descriptor; using aidl::android::hardware::audio::effect::Equalizer; +using aidl::android::hardware::audio::effect::getEffectTypeUuidEqualizer; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kEqualizerTypeUUID; using aidl::android::hardware::audio::effect::Parameter; /** @@ -195,7 +194,7 @@ INSTANTIATE_TEST_SUITE_P( EqualizerTest, EqualizerTest, ::testing::Combine( testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kEqualizerTypeUUID)), + IFactory::descriptor, getEffectTypeUuidEqualizer())), testing::ValuesIn(EffectHelper::getTestValueSet( kDescPair, EffectHelper::expandTestValueBasic)), diff --git a/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp b/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp index 32ebc4f11c..7c79d1bfab 100644 --- a/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp +++ b/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp @@ -28,10 +28,10 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidHapticGenerator; using aidl::android::hardware::audio::effect::HapticGenerator; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kHapticGeneratorTypeUUID; using aidl::android::hardware::audio::effect::Parameter; /** @@ -179,7 +179,7 @@ TEST_P(HapticGeneratorParamTest, SetAndGetVibratorInformation) { INSTANTIATE_TEST_SUITE_P( HapticGeneratorValidTest, HapticGeneratorParamTest, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kHapticGeneratorTypeUUID)), + IFactory::descriptor, getEffectTypeUuidHapticGenerator())), testing::ValuesIn(kHapticScaleIdValues), testing::ValuesIn(kVibratorScaleValues), testing::ValuesIn(kResonantFrequencyValues), @@ -209,7 +209,7 @@ INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P( HapticGeneratorInvalidTest, HapticGeneratorParamTest, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kHapticGeneratorTypeUUID)), + IFactory::descriptor, getEffectTypeUuidHapticGenerator())), testing::Values(MIN_ID - 1), testing::Values(HapticGenerator::VibratorScale::NONE), testing::Values(MIN_FLOAT), testing::Values(MIN_FLOAT), @@ -419,7 +419,7 @@ TEST_P(HapticGeneratorScalesTest, SetMultipleVectorRepeat) { INSTANTIATE_TEST_SUITE_P( HapticGeneratorScalesTest, HapticGeneratorScalesTest, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kHapticGeneratorTypeUUID))), + IFactory::descriptor, getEffectTypeUuidHapticGenerator()))), [](const testing::TestParamInfo& info) { auto descriptor = std::get(info.param).second; std::string name = "Implementor_" + descriptor.common.implementor + "_name_" + diff --git a/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp b/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp index 5faf7f41e6..96b048ed18 100644 --- a/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp +++ b/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp @@ -25,9 +25,9 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidLoudnessEnhancer; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kLoudnessEnhancerTypeUUID; using aidl::android::hardware::audio::effect::LoudnessEnhancer; using aidl::android::hardware::audio::effect::Parameter; @@ -126,7 +126,7 @@ TEST_P(LoudnessEnhancerParamTest, SetAndGetGainMb) { INSTANTIATE_TEST_SUITE_P( LoudnessEnhancerTest, LoudnessEnhancerParamTest, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kLoudnessEnhancerTypeUUID)), + IFactory::descriptor, getEffectTypeUuidLoudnessEnhancer())), testing::ValuesIn(kGainMbValues)), [](const testing::TestParamInfo& info) { auto descriptor = std::get(info.param).second; diff --git a/audio/aidl/vts/VtsHalNSTargetTest.cpp b/audio/aidl/vts/VtsHalNSTargetTest.cpp index 4fcda6b242..5525c80894 100644 --- a/audio/aidl/vts/VtsHalNSTargetTest.cpp +++ b/audio/aidl/vts/VtsHalNSTargetTest.cpp @@ -27,9 +27,9 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidNoiseSuppression; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kNoiseSuppressionTypeUUID; using aidl::android::hardware::audio::effect::NoiseSuppression; using aidl::android::hardware::audio::effect::Parameter; @@ -146,7 +146,7 @@ TEST_P(NSParamTest, SetAndGetType) { INSTANTIATE_TEST_SUITE_P( NSParamTest, NSParamTest, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kNoiseSuppressionTypeUUID)), + IFactory::descriptor, getEffectTypeUuidNoiseSuppression())), testing::ValuesIn(NSParamTest::getLevelValues()), testing::ValuesIn(NSParamTest::getTypeValues())), [](const testing::TestParamInfo& info) { diff --git a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp index 7bce9c36ff..8fb4ebf339 100644 --- a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp +++ b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp @@ -24,10 +24,9 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidPresetReverb; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kEffectNullUuid; -using aidl::android::hardware::audio::effect::kPresetReverbTypeUUID; using aidl::android::hardware::audio::effect::Parameter; using aidl::android::hardware::audio::effect::PresetReverb; @@ -132,7 +131,7 @@ TEST_P(PresetReverbParamTest, SetAndGetPresets) { INSTANTIATE_TEST_SUITE_P( PresetReverbTest, PresetReverbParamTest, ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kPresetReverbTypeUUID)), + IFactory::descriptor, getEffectTypeUuidPresetReverb())), testing::ValuesIn(kPresetsValues)), [](const testing::TestParamInfo& info) { auto descriptor = std::get(info.param).second; diff --git a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp index 84b980f6d5..6b1da6388e 100644 --- a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp +++ b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp @@ -23,9 +23,9 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidVirtualizer; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kVirtualizerTypeUUID; using aidl::android::hardware::audio::effect::Parameter; using aidl::android::hardware::audio::effect::Virtualizer; @@ -134,7 +134,7 @@ INSTANTIATE_TEST_SUITE_P( VirtualizerTest, VirtualizerParamTest, ::testing::Combine( testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kVirtualizerTypeUUID)), + IFactory::descriptor, getEffectTypeUuidVirtualizer())), testing::ValuesIn(EffectHelper::getTestValueSet< Virtualizer, int, Range::virtualizer, Virtualizer::strengthPm>( kDescPair, EffectHelper::expandTestValueBasic))), diff --git a/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp b/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp index e273824fbd..f41ba30b12 100644 --- a/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp +++ b/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp @@ -26,9 +26,9 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidVisualizer; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kVisualizerTypeUUID; using aidl::android::hardware::audio::effect::Parameter; using aidl::android::hardware::audio::effect::Visualizer; @@ -177,7 +177,7 @@ INSTANTIATE_TEST_SUITE_P( VisualizerParamTest, VisualizerParamTest, ::testing::Combine( testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kVisualizerTypeUUID)), + IFactory::descriptor, getEffectTypeUuidVisualizer())), testing::ValuesIn(EffectHelper::getTestValueSet( kDescPair, EffectHelper::expandTestValueBasic)), diff --git a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp index fbd10a83bf..90b7f37946 100644 --- a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp +++ b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp @@ -23,9 +23,9 @@ using namespace android; using aidl::android::hardware::audio::effect::Descriptor; +using aidl::android::hardware::audio::effect::getEffectTypeUuidVolume; using aidl::android::hardware::audio::effect::IEffect; using aidl::android::hardware::audio::effect::IFactory; -using aidl::android::hardware::audio::effect::kVolumeTypeUUID; using aidl::android::hardware::audio::effect::Parameter; using aidl::android::hardware::audio::effect::Volume; @@ -140,7 +140,7 @@ INSTANTIATE_TEST_SUITE_P( VolumeTest, VolumeParamTest, ::testing::Combine( testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors( - IFactory::descriptor, kVolumeTypeUUID)), + IFactory::descriptor, getEffectTypeUuidVolume())), testing::ValuesIn( EffectHelper::getTestValueSet( kDescPair, EffectHelper::expandTestValueBasic)),