Update EffectUUID initialization
Avoid dynamic initialization global UUID variables
Bug: 271500140
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: I7574c1fe1ba0aaff1d9d29a9eed10de1aef33806
diff --git a/audio/aidl/default/EffectConfig.cpp b/audio/aidl/default/EffectConfig.cpp
index c030b7a..5a83fef 100644
--- a/audio/aidl/default/EffectConfig.cpp
+++ b/audio/aidl/default/EffectConfig.cpp
@@ -16,6 +16,7 @@
#define LOG_TAG "AHAL_EffectConfig"
#include <android-base/logging.h>
+#include <system/audio_effects/effect_uuid.h>
#include "effectFactory-impl/EffectConfig.h"
@@ -163,15 +164,53 @@
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<std::string, UuidGetter> 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 638fa7f..c1ac3f2 100644
--- a/audio/aidl/default/EffectFactory.cpp
+++ b/audio/aidl/default/EffectFactory.cpp
@@ -14,20 +14,19 @@
* limitations under the License.
*/
+#include <dlfcn.h>
#include <iterator>
#include <memory>
#include <tuple>
-#include "include/effect-impl/EffectTypes.h"
-#define LOG_TAG "AHAL_EffectFactory"
-#include <dlfcn.h>
#include <unordered_set>
+#define LOG_TAG "AHAL_EffectFactory"
#include <android-base/logging.h>
#include <android/binder_ibinder_platform.h>
+#include <system/audio_effects/effect_uuid.h>
#include <system/thread_defs.h>
#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::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<AudioUuid> proxyUuid;
if (configLibs.proxyLibrary.has_value()) {
@@ -223,7 +222,7 @@
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 e90fe35..da1ad11 100644
--- a/audio/aidl/default/EffectImpl.cpp
+++ b/audio/aidl/default/EffectImpl.cpp
@@ -40,7 +40,7 @@
ndk::ScopedAStatus EffectImpl::open(const Parameter::Common& common,
const std::optional<Parameter::Specific>& 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 @@
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 @@
return setParameterSpecific(param.get<Parameter::specific>());
}
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::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 @@
break;
}
}
- LOG(DEBUG) << __func__ << param->toString();
+ LOG(DEBUG) << getEffectName() << __func__ << param->toString();
return ndk::ScopedAStatus::ok();
}
@@ -149,7 +150,8 @@
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 @@
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::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 @@
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 @@
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 4f8fb3c..844127d 100644
--- a/audio/aidl/default/EffectThread.cpp
+++ b/audio/aidl/default/EffectThread.cpp
@@ -36,7 +36,7 @@
RetCode EffectThread::createThread(std::shared_ptr<EffectContext> 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 @@
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 @@
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::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 @@
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 561f9a3..63a014a 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 <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 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 753207d..73cf42b 100644
--- a/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.h
+++ b/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.h
@@ -23,7 +23,6 @@
#include <memory>
#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 39290b4..ce10ae1 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 <android-base/logging.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
.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 6ba7328..7d2a69f 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 50712a4..1e336ac 100644
--- a/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.cpp
+++ b/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.cpp
@@ -17,22 +17,24 @@
#include <algorithm>
#include <cstddef>
#include <memory>
-
#define LOG_TAG "AHAL_AutomaticGainControlV2Sw"
+
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
.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 0b50f4d..9aa60ea 100644
--- a/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.h
+++ b/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.h
@@ -22,7 +22,6 @@
#include <memory>
#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 fb5374f..dbf2e15 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 <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
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 8d183dd..1132472 100644
--- a/audio/aidl/default/bassboost/BassBoostSw.h
+++ b/audio/aidl/default/bassboost/BassBoostSw.h
@@ -22,7 +22,6 @@
#include <memory>
#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 81a4c89..ce5fe20 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 <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
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 37c978b..3f8a09b 100644
--- a/audio/aidl/default/downmix/DownmixSw.h
+++ b/audio/aidl/default/downmix/DownmixSw.h
@@ -22,7 +22,6 @@
#include <memory>
#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 1dda6d1..ed6cfa0 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 <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 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 769f9ef..641cf71 100644
--- a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.h
+++ b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.h
@@ -25,7 +25,6 @@
#include <fmq/AidlMessageQueue.h>
#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 29288ca..73975c6 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 <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
.range = Range::make<Range::environmentalReverb>(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 dd2cf5d..5e31e2f 100644
--- a/audio/aidl/default/envReverb/EnvReverbSw.h
+++ b/audio/aidl/default/envReverb/EnvReverbSw.h
@@ -22,7 +22,6 @@
#include <memory>
#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 0fa7a11..9769924 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 <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
MAKE_RANGE(Equalizer, centerFreqMh, std::vector<int>({1}), std::vector<int>({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 f8987c7..56af3b5 100644
--- a/audio/aidl/default/equalizer/EqualizerSw.h
+++ b/audio/aidl/default/equalizer/EqualizerSw.h
@@ -22,7 +22,6 @@
#include <memory>
#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 db1e4a4..c4eebc0 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 <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
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 f432d40..e7a068b 100644
--- a/audio/aidl/default/extension/ExtensionEffect.h
+++ b/audio/aidl/default/extension/ExtensionEffect.h
@@ -22,7 +22,6 @@
#include <vector>
#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 944f715..27cdac8 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 <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
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 428f460..3bbe41a 100644
--- a/audio/aidl/default/hapticGenerator/HapticGeneratorSw.h
+++ b/audio/aidl/default/hapticGenerator/HapticGeneratorSw.h
@@ -16,13 +16,14 @@
#pragma once
-#include <aidl/android/hardware/audio/effect/BnEffect.h>
-#include <fmq/AidlMessageQueue.h>
#include <cstdlib>
+#include <map>
#include <memory>
+#include <aidl/android/hardware/audio/effect/BnEffect.h>
+#include <fmq/AidlMessageQueue.h>
+
#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 fe534d7..4bda7be 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 <ostream>
#include <string>
#include <aidl/android/hardware/audio/effect/BnEffect.h>
@@ -128,23 +127,4 @@
#define MAKE_RANGE(T, Tag, l, r) \
{ .min = T::make<T::Tag>(l), .max = T::make<T::Tag>(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 bc61c0f..0000000
--- 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 <map>
-
-#include <aidl/android/media/audio/common/AudioUuid.h>
-
-namespace aidl::android::hardware::audio::effect {
-
-using ::aidl::android::media::audio::common::AudioUuid;
-
-// ec7178ec-e5e1-4432-a3f4-4657e6795210
-static const AudioUuid kEffectNullUuid = {static_cast<int32_t>(0xec7178ec),
- 0xe5e1,
- 0x4432,
- 0xa3f4,
- {0x46, 0x57, 0xe6, 0x79, 0x52, 0x10}};
-// Zero UUID
-static const AudioUuid kEffectZeroUuid = {
- static_cast<int32_t>(0x0), 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
-
-// 7b491460-8d4d-11e0-bd61-0002a5d5c51b.
-static const AudioUuid kAcousticEchoCancelerTypeUUID = {static_cast<int32_t>(0x7b491460),
- 0x8d4d,
- 0x11e0,
- 0xbd61,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// bb392ec0-8d4d-11e0-a896-0002a5d5c51b
-static const AudioUuid kAcousticEchoCancelerSwImplUUID = {static_cast<int32_t>(0xbb392ec0),
- 0x8d4d,
- 0x11e0,
- 0xa896,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 0a8abfe0-654c-11e0-ba26-0002a5d5c51b
-static const AudioUuid kAutomaticGainControlV1TypeUUID = {static_cast<int32_t>(0x0a8abfe0),
- 0x654c,
- 0x11e0,
- 0xba26,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// aa8130e0-66fc-11e0-bad0-0002a5d5c51b
-static const AudioUuid kAutomaticGainControlV1SwImplUUID = {static_cast<int32_t>(0xaa8130e0),
- 0x66fc,
- 0x11e0,
- 0xbad0,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// ae3c653b-be18-4ab8-8938-418f0a7f06ac
-static const AudioUuid kAutomaticGainControlV2TypeUUID = {static_cast<int32_t>(0xae3c653b),
- 0xbe18,
- 0x4ab8,
- 0x8938,
- {0x41, 0x8f, 0x0a, 0x7f, 0x06, 0xac}};
-// 89f38e65-d4d2-4d64-ad0e-2b3e799ea886
-static const AudioUuid kAutomaticGainControlV2SwImplUUID = {static_cast<int32_t>(0x89f38e65),
- 0xd4d2,
- 0x4d64,
- 0xad0e,
- {0x2b, 0x3e, 0x79, 0x9e, 0xa8, 0x86}};
-// 0634f220-ddd4-11db-a0fc-0002a5d5c51b
-static const AudioUuid kBassBoostTypeUUID = {static_cast<int32_t>(0x0634f220),
- 0xddd4,
- 0x11db,
- 0xa0fc,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// fa8181f2-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kBassBoostSwImplUUID = {static_cast<int32_t>(0xfa8181f2),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 8631f300-72e2-11df-b57e-0002a5d5c51b
-static const AudioUuid kBassBoostBundleImplUUID = {static_cast<int32_t>(0x8631f300),
- 0x72e2,
- 0x11df,
- 0xb57e,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 14804144-a5ee-4d24-aa88-0002a5d5c51b
-static const AudioUuid kBassBoostProxyUUID = {static_cast<int32_t>(0x14804144),
- 0xa5ee,
- 0x4d24,
- 0xaa88,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 381e49cc-a858-4aa2-87f6-e8388e7601b2
-static const AudioUuid kDownmixTypeUUID = {static_cast<int32_t>(0x381e49cc),
- 0xa858,
- 0x4aa2,
- 0x87f6,
- {0xe8, 0x38, 0x8e, 0x76, 0x01, 0xb2}};
-// fa8187ba-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kDownmixSwImplUUID = {static_cast<int32_t>(0xfa8187ba),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 93f04452-e4fe-41cc-91f9-e475b6d1d69f
-static const AudioUuid kDownmixImplUUID = {static_cast<int32_t>(0x93f04452),
- 0xe4fe,
- 0x41cc,
- 0x91f9,
- {0xe4, 0x75, 0xb6, 0xd1, 0xd6, 0x9f}};
-// 0bed4300-ddd6-11db-8f34-0002a5d5c51b.
-static const AudioUuid kEqualizerTypeUUID = {static_cast<int32_t>(0x0bed4300),
- 0xddd6,
- 0x11db,
- 0x8f34,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 0bed4300-847d-11df-bb17-0002a5d5c51b
-static const AudioUuid kEqualizerSwImplUUID = {static_cast<int32_t>(0x0bed4300),
- 0x847d,
- 0x11df,
- 0xbb17,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// ce772f20-847d-11df-bb17-0002a5d5c51b
-static const AudioUuid kEqualizerBundleImplUUID = {static_cast<int32_t>(0xce772f20),
- 0x847d,
- 0x11df,
- 0xbb17,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// c8e70ecd-48ca-456e-8a4f-0002a5d5c51b
-static const AudioUuid kEqualizerProxyUUID = {static_cast<int32_t>(0xc8e70ecd),
- 0x48ca,
- 0x456e,
- 0x8a4f,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 7261676f-6d75-7369-6364-28e2fd3ac39e
-static const AudioUuid kDynamicsProcessingTypeUUID = {static_cast<int32_t>(0x7261676f),
- 0x6d75,
- 0x7369,
- 0x6364,
- {0x28, 0xe2, 0xfd, 0x3a, 0xc3, 0x9e}};
-// fa818d78-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kDynamicsProcessingSwImplUUID = {static_cast<int32_t>(0xfa818d78),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// e0e6539b-1781-7261-676f-6d7573696340
-static const AudioUuid kDynamicsProcessingImplUUID = {static_cast<int32_t>(0xe0e6539b),
- 0x1781,
- 0x7261,
- 0x676f,
- {0x6d, 0x75, 0x73, 0x69, 0x63, 0x40}};
-// 1411e6d6-aecd-4021-a1cf-a6aceb0d71e5
-static const AudioUuid kHapticGeneratorTypeUUID = {static_cast<int32_t>(0x1411e6d6),
- 0xaecd,
- 0x4021,
- 0xa1cf,
- {0xa6, 0xac, 0xeb, 0x0d, 0x71, 0xe5}};
-// fa819110-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kHapticGeneratorSwImplUUID = {static_cast<int32_t>(0xfa819110),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 97c4acd1-8b82-4f2f-832e-c2fe5d7a9931
-static const AudioUuid kHapticGeneratorImplUUID = {static_cast<int32_t>(0x97c4acd1),
- 0x8b82,
- 0x4f2f,
- 0x832e,
- {0xc2, 0xfe, 0x5d, 0x7a, 0x99, 0x31}};
-// fe3199be-aed0-413f-87bb-11260eb63cf1
-static const AudioUuid kLoudnessEnhancerTypeUUID = {static_cast<int32_t>(0xfe3199be),
- 0xaed0,
- 0x413f,
- 0x87bb,
- {0x11, 0x26, 0x0e, 0xb6, 0x3c, 0xf1}};
-// fa819610-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kLoudnessEnhancerSwImplUUID = {static_cast<int32_t>(0xfa819610),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// fa415329-2034-4bea-b5dc-5b381c8d1e2c
-static const AudioUuid kLoudnessEnhancerImplUUID = {static_cast<int32_t>(0xfa415329),
- 0x2034,
- 0x4bea,
- 0xb5dc,
- {0x5b, 0x38, 0x1c, 0x8d, 0x1e, 0x2c}};
-// c2e5d5f0-94bd-4763-9cac-4e234d06839e
-static const AudioUuid kEnvReverbTypeUUID = {static_cast<int32_t>(0xc2e5d5f0),
- 0x94bd,
- 0x4763,
- 0x9cac,
- {0x4e, 0x23, 0x4d, 0x06, 0x83, 0x9e}};
-// fa819886-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kEnvReverbSwImplUUID = {static_cast<int32_t>(0xfa819886),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 4a387fc0-8ab3-11df-8bad-0002a5d5c51b
-static const AudioUuid kAuxEnvReverbImplUUID = {static_cast<int32_t>(0x4a387fc0),
- 0x8ab3,
- 0x11df,
- 0x8bad,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// c7a511a0-a3bb-11df-860e-0002a5d5c51b
-static const AudioUuid kInsertEnvReverbImplUUID = {static_cast<int32_t>(0xc7a511a0),
- 0xa3bb,
- 0x11df,
- 0x860e,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 58b4b260-8e06-11e0-aa8e-0002a5d5c51b
-static const AudioUuid kNoiseSuppressionTypeUUID = {static_cast<int32_t>(0x58b4b260),
- 0x8e06,
- 0x11e0,
- 0xaa8e,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// c06c8400-8e06-11e0-9cb6-0002a5d5c51b
-static const AudioUuid kNoiseSuppressionSwImplUUID = {static_cast<int32_t>(0xc06c8400),
- 0x8e06,
- 0x11e0,
- 0x9cb6,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 47382d60-ddd8-11db-bf3a-0002a5d5c51b
-static const AudioUuid kPresetReverbTypeUUID = {static_cast<int32_t>(0x47382d60),
- 0xddd8,
- 0x11db,
- 0xbf3a,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// fa8199c6-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kPresetReverbSwImplUUID = {static_cast<int32_t>(0xfa8199c6),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// f29a1400-a3bb-11df-8ddc-0002a5d5c51b
-static const AudioUuid kAuxPresetReverbImplUUID = {static_cast<int32_t>(0xf29a1400),
- 0xa3bb,
- 0x11df,
- 0x8ddc,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 172cdf00-a3bc-11df-a72f-0002a5d5c51b
-static const AudioUuid kInsertPresetReverbImplUUID = {static_cast<int32_t>(0x172cdf00),
- 0xa3bc,
- 0x11df,
- 0xa72f,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 37cc2c00-dddd-11db-8577-0002a5d5c51b
-static const AudioUuid kVirtualizerTypeUUID = {static_cast<int32_t>(0x37cc2c00),
- 0xdddd,
- 0x11db,
- 0x8577,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// fa819d86-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kVirtualizerSwImplUUID = {static_cast<int32_t>(0xfa819d86),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 1d4033c0-8557-11df-9f2d-0002a5d5c51b
-static const AudioUuid kVirtualizerBundleImplUUID = {static_cast<int32_t>(0x1d4033c0),
- 0x8557,
- 0x11df,
- 0x9f2d,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// d3467faa-acc7-4d34-acaf-0002a5d5c51b
-static const AudioUuid kVirtualizerProxyUUID = {static_cast<int32_t>(0xd3467faa),
- 0xacc7,
- 0x4d34,
- 0xacaf,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// e46b26a0-dddd-11db-8afd-0002a5d5c51b
-static const AudioUuid kVisualizerTypeUUID = {static_cast<int32_t>(0xe46b26a0),
- 0xdddd,
- 0x11db,
- 0x8afd,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// fa81a0f6-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kVisualizerSwImplUUID = {static_cast<int32_t>(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<int32_t>(0xd069d9e0),
- 0x8329,
- 0x11df,
- 0x9168,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// fa81a2b8-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kVolumeTypeUUID = {static_cast<int32_t>(0xfa81a2b8),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// fa81a718-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kVolumeSwImplUUID = {static_cast<int32_t>(0xfa81a718),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 119341a0-8469-11df-81f9-0002a5d5c51b
-static const AudioUuid kVolumeBundleImplUUID = {static_cast<int32_t>(0x119341a0),
- 0x8469,
- 0x11df,
- 0x81f9,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-
-// fa81dbde-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kExtensionEffectTypeUUID = {static_cast<int32_t>(0xfa81dbde),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// fa81dd00-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kExtensionEffectImplUUID = {static_cast<int32_t>(0xfa81dd00),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-/**
- * @brief A map between effect name and effect type UUID.
- * All <name> 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<const std::string /* effect type */, const AudioUuid&> 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 c499811..c627a27 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 <functional>
+#include <map>
#include <memory>
#include <string>
#include <unordered_map>
@@ -62,6 +63,9 @@
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 fc9ef02..b7f63af 100644
--- a/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
+++ b/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
@@ -105,7 +105,7 @@
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 f115cc5..7954316 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 <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
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 e252f4a..25824f2 100644
--- a/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.h
+++ b/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.h
@@ -22,7 +22,6 @@
#include <memory>
#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 ba39b16..9b2cb7c 100644
--- a/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.cpp
+++ b/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.cpp
@@ -17,22 +17,25 @@
#include <algorithm>
#include <cstddef>
#include <memory>
+#define LOG_TAG "AHAL_NoiseSuppressionSw"
#define LOG_TAG "AHAL_NoiseSuppressionSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
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 22bf066..fc1e028 100644
--- a/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.h
+++ b/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.h
@@ -16,13 +16,13 @@
#pragma once
-#include <aidl/android/hardware/audio/effect/BnEffect.h>
-#include <fmq/AidlMessageQueue.h>
#include <cstdlib>
#include <memory>
+#include <aidl/android/hardware/audio/effect/BnEffect.h>
+#include <fmq/AidlMessageQueue.h>
+
#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 14546a4..3f02eb7 100644
--- a/audio/aidl/default/presetReverb/PresetReverbSw.cpp
+++ b/audio/aidl/default/presetReverb/PresetReverbSw.cpp
@@ -21,19 +21,21 @@
#include <android-base/logging.h>
#include <android/binder_enums.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
.range = Range::make<Range::presetReverb>(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 5061475..9ceee7c 100644
--- a/audio/aidl/default/presetReverb/PresetReverbSw.h
+++ b/audio/aidl/default/presetReverb/PresetReverbSw.h
@@ -22,7 +22,6 @@
#include <memory>
#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 c5a0e8d..e34464f 100644
--- a/audio/aidl/default/virtualizer/VirtualizerSw.cpp
+++ b/audio/aidl/default/virtualizer/VirtualizerSw.cpp
@@ -21,12 +21,14 @@
#include <Utils.h>
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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 @@
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* 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 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 @@
.range = Range::make<Range::virtualizer>(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 5c5b616..5e114d9 100644
--- a/audio/aidl/default/virtualizer/VirtualizerSw.h
+++ b/audio/aidl/default/virtualizer/VirtualizerSw.h
@@ -22,7 +22,6 @@
#include <memory>
#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 deb3204..0909f25 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 <android-base/logging.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 @@
.range = Range::make<Range::visualizer>(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 ee7276a..995774e 100644
--- a/audio/aidl/default/visualizer/VisualizerSw.h
+++ b/audio/aidl/default/visualizer/VisualizerSw.h
@@ -16,11 +16,10 @@
#pragma once
-#include <aidl/android/hardware/audio/effect/BnEffect.h>
#include <vector>
+#include <aidl/android/hardware/audio/effect/BnEffect.h>
#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 44cac44..8902584 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 <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#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<IEffect>* 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 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 Capability VolumeSw::kCapability = {.range = Range::make<Range::volume>(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 2dd4324..1432b2b 100644
--- a/audio/aidl/default/volume/VolumeSw.h
+++ b/audio/aidl/default/volume/VolumeSw.h
@@ -22,7 +22,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {