diff options
| author | Kevin Rocard <krocard@google.com> | 2017-12-20 11:07:12 -0800 |
|---|---|---|
| committer | Kevin Rocard <krocard@google.com> | 2018-01-20 10:49:57 -0800 |
| commit | 62588b69f6289e2ccb7a363a4b0727d51b76bfb5 (patch) | |
| tree | c956373a378a8939ffcaa7c5489d1ac63307ea51 /audio | |
| parent | 1bd2a336bc13b14a7fd556ce6e39b6b4c1d3b1c8 (diff) | |
| download | android_hardware_interfaces-62588b69f6289e2ccb7a363a4b0727d51b76bfb5.tar.gz android_hardware_interfaces-62588b69f6289e2ccb7a363a4b0727d51b76bfb5.tar.bz2 android_hardware_interfaces-62588b69f6289e2ccb7a363a4b0727d51b76bfb5.zip | |
Audio V4: Make effect default wrapper device independent
What was done in this patch:
# move headers in all-versions/default folder for qualified inclusion
mkdir -p audio/effect/all-versions/include/effect/all-versions/default/
mv audio/effect/all-versions/*[hp] $_
# Go in the all-versions header folder
cd $_
# Use a macro for the version
sed -i '/^#/!s/V2_0/AUDIO_HAL_VERSION/g' *
#Remove 2.0 includes
sed -i "/include.*2.0/d" *
# Add include guard to make sure AUDIO_HAL_VERSION is set
sed -i '/limitations under the License/!b;N;a\n#include <common/all-versions/IncludeGuard.h>' *
# Remove guard include macro
sed -i '/^#.*[H_]$/d' *
# Remove LOG_TAG
sed -i '/LOG_TAG/d' *
# Remove local include (include "XXX")
sed -i '/include.*"/{N;/\n$/d;D}' *
# Replace implementation with inclusion
cd audio/effect/2.0/
git checkout HEAD^^
ls *h *cpp| sed -r 's/.*h$/\0 \0/;s/(.*)cpp/\1impl.h \0/' |xargs -L1 printf '1h;2,$H;$!d;g;s$namespace.*}[^\\n]*$#define AUDIO_HAL_VERSION V2_0\\\n#include <effect/all-versions/default/%s>\\\n#undef AUDIO_HAL_VERSION$\000%s\000'|xargs -0 -n2 sed -i
+ manual update of Android.bp and removal of duplicate include
Bug: 38184704
Test: compile
Change-Id: If99871516f3069fcb9e699ab670a665d7d507e7d
Diffstat (limited to 'audio')
62 files changed, 1106 insertions, 388 deletions
diff --git a/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp b/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp new file mode 100644 index 000000000..cadc2f1b4 --- /dev/null +++ b/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "AEC_Effect_HAL" + +#include "AcousticEchoCancelerEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/AcousticEchoCancelerEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/AcousticEchoCancelerEffect.h b/audio/effect/2.0/default/AcousticEchoCancelerEffect.h new file mode 100644 index 000000000..d36335c7b --- /dev/null +++ b/audio/effect/2.0/default/AcousticEchoCancelerEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H + +#include <android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/AcousticEchoCancelerEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H diff --git a/audio/effect/all-versions/Android.bp b/audio/effect/2.0/default/Android.bp index f2b36d349..db0098849 100644 --- a/audio/effect/all-versions/Android.bp +++ b/audio/effect/2.0/default/Android.bp @@ -39,6 +39,8 @@ cc_library_shared { ], header_libs: [ + "android.hardware.audio.common.util@all-versions", + "android.hardware.audio.effect@all-versions-impl", "libaudio_system_headers", "libaudioclient_headers", "libeffects_headers", diff --git a/audio/effect/2.0/default/AudioBufferManager.cpp b/audio/effect/2.0/default/AudioBufferManager.cpp new file mode 100644 index 000000000..39918dd1c --- /dev/null +++ b/audio/effect/2.0/default/AudioBufferManager.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2017 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. + */ + +#include "AudioBufferManager.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/AudioBufferManager.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/AudioBufferManager.h b/audio/effect/2.0/default/AudioBufferManager.h new file mode 100644 index 000000000..789fbd1c8 --- /dev/null +++ b/audio/effect/2.0/default/AudioBufferManager.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_ +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_ + +#include <android/hardware/audio/effect/2.0/types.h> + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/AudioBufferManager.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_ diff --git a/audio/effect/2.0/default/AutomaticGainControlEffect.cpp b/audio/effect/2.0/default/AutomaticGainControlEffect.cpp new file mode 100644 index 000000000..7e00a8065 --- /dev/null +++ b/audio/effect/2.0/default/AutomaticGainControlEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "AGC_Effect_HAL" + +#include "AutomaticGainControlEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/AutomaticGainControlEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/AutomaticGainControlEffect.h b/audio/effect/2.0/default/AutomaticGainControlEffect.h new file mode 100644 index 000000000..ef440d2e4 --- /dev/null +++ b/audio/effect/2.0/default/AutomaticGainControlEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H + +#include <android/hardware/audio/effect/2.0/IAutomaticGainControlEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/AutomaticGainControlEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H diff --git a/audio/effect/2.0/default/BassBoostEffect.cpp b/audio/effect/2.0/default/BassBoostEffect.cpp new file mode 100644 index 000000000..df9e892d6 --- /dev/null +++ b/audio/effect/2.0/default/BassBoostEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "BassBoost_HAL" + +#include "BassBoostEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/BassBoostEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/BassBoostEffect.h b/audio/effect/2.0/default/BassBoostEffect.h new file mode 100644 index 000000000..83179e28e --- /dev/null +++ b/audio/effect/2.0/default/BassBoostEffect.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H + +#include <android/hardware/audio/effect/2.0/IBassBoostEffect.h> + +#include <hidl/MQDescriptor.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/BassBoostEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H diff --git a/audio/effect/2.0/default/Conversions.cpp b/audio/effect/2.0/default/Conversions.cpp new file mode 100644 index 000000000..b59752c98 --- /dev/null +++ b/audio/effect/2.0/default/Conversions.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2017 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. + */ + +#include "Conversions.h" +#include "HidlUtils.h" + +using ::android::hardware::audio::common::V2_0::HidlUtils; + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/Conversions.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/Conversions.h b/audio/effect/2.0/default/Conversions.h new file mode 100644 index 000000000..94c7f66ea --- /dev/null +++ b/audio/effect/2.0/default/Conversions.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_CONVERSIONS_H_ +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_CONVERSIONS_H_ + +#include <android/hardware/audio/effect/2.0/types.h> + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/Conversions.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_CONVERSIONS_H_ diff --git a/audio/effect/2.0/default/DownmixEffect.cpp b/audio/effect/2.0/default/DownmixEffect.cpp new file mode 100644 index 000000000..1a51e1364 --- /dev/null +++ b/audio/effect/2.0/default/DownmixEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "Downmix_HAL" + +#include "DownmixEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/DownmixEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/DownmixEffect.h b/audio/effect/2.0/default/DownmixEffect.h new file mode 100644 index 000000000..6dbbb3283 --- /dev/null +++ b/audio/effect/2.0/default/DownmixEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H + +#include <android/hardware/audio/effect/2.0/IDownmixEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/DownmixEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H diff --git a/audio/effect/2.0/default/Effect.cpp b/audio/effect/2.0/default/Effect.cpp new file mode 100644 index 000000000..e234e520b --- /dev/null +++ b/audio/effect/2.0/default/Effect.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#include <memory.h> + +#define LOG_TAG "EffectHAL" +#define ATRACE_TAG ATRACE_TAG_AUDIO + +#include "Conversions.h" +#include "Effect.h" +#include "common/all-versions/default/EffectMap.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/Effect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/Effect.h b/audio/effect/2.0/default/Effect.h new file mode 100644 index 000000000..a4d194dab --- /dev/null +++ b/audio/effect/2.0/default/Effect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H + +#include <android/hardware/audio/effect/2.0/IEffect.h> + +#include "AudioBufferManager.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/Effect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H diff --git a/audio/effect/2.0/default/EffectsFactory.cpp b/audio/effect/2.0/default/EffectsFactory.cpp new file mode 100644 index 000000000..a48a85f7c --- /dev/null +++ b/audio/effect/2.0/default/EffectsFactory.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "EffectFactoryHAL" +#include "EffectsFactory.h" +#include "AcousticEchoCancelerEffect.h" +#include "AutomaticGainControlEffect.h" +#include "BassBoostEffect.h" +#include "Conversions.h" +#include "DownmixEffect.h" +#include "Effect.h" +#include "EnvironmentalReverbEffect.h" +#include "EqualizerEffect.h" +#include "HidlUtils.h" +#include "LoudnessEnhancerEffect.h" +#include "NoiseSuppressionEffect.h" +#include "PresetReverbEffect.h" +#include "VirtualizerEffect.h" +#include "VisualizerEffect.h" +#include "common/all-versions/default/EffectMap.h" + +using ::android::hardware::audio::common::V2_0::HidlUtils; + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/EffectsFactory.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/EffectsFactory.h b/audio/effect/2.0/default/EffectsFactory.h new file mode 100644 index 000000000..f1bfbcff4 --- /dev/null +++ b/audio/effect/2.0/default/EffectsFactory.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H + +#include <system/audio_effect.h> + +#include <android/hardware/audio/effect/2.0/IEffectsFactory.h> + +#include <hidl/MQDescriptor.h> +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/EffectsFactory.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H diff --git a/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp b/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp new file mode 100644 index 000000000..017dd1f4c --- /dev/null +++ b/audio/effect/2.0/default/EnvironmentalReverbEffect.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "EnvReverb_HAL" +#include <android/log.h> + +#include "EnvironmentalReverbEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/EnvironmentalReverbEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/EnvironmentalReverbEffect.h b/audio/effect/2.0/default/EnvironmentalReverbEffect.h new file mode 100644 index 000000000..d93a53f42 --- /dev/null +++ b/audio/effect/2.0/default/EnvironmentalReverbEffect.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H + +#include <system/audio_effects/effect_environmentalreverb.h> + +#include <android/hardware/audio/effect/2.0/IEnvironmentalReverbEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/EnvironmentalReverbEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H diff --git a/audio/effect/2.0/default/EqualizerEffect.cpp b/audio/effect/2.0/default/EqualizerEffect.cpp new file mode 100644 index 000000000..d6e056c42 --- /dev/null +++ b/audio/effect/2.0/default/EqualizerEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "Equalizer_HAL" + +#include "EqualizerEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/EqualizerEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/EqualizerEffect.h b/audio/effect/2.0/default/EqualizerEffect.h new file mode 100644 index 000000000..54cdd50e1 --- /dev/null +++ b/audio/effect/2.0/default/EqualizerEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H + +#include <android/hardware/audio/effect/2.0/IEqualizerEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/EqualizerEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H diff --git a/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp b/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp new file mode 100644 index 000000000..2dca0f4c3 --- /dev/null +++ b/audio/effect/2.0/default/LoudnessEnhancerEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "LoudnessEnhancer_HAL" + +#include "LoudnessEnhancerEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/LoudnessEnhancerEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/LoudnessEnhancerEffect.h b/audio/effect/2.0/default/LoudnessEnhancerEffect.h new file mode 100644 index 000000000..992e238ef --- /dev/null +++ b/audio/effect/2.0/default/LoudnessEnhancerEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H + +#include <android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/LoudnessEnhancerEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H diff --git a/audio/effect/2.0/default/NoiseSuppressionEffect.cpp b/audio/effect/2.0/default/NoiseSuppressionEffect.cpp new file mode 100644 index 000000000..089e811e0 --- /dev/null +++ b/audio/effect/2.0/default/NoiseSuppressionEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "NS_Effect_HAL" + +#include "NoiseSuppressionEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/NoiseSuppressionEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/NoiseSuppressionEffect.h b/audio/effect/2.0/default/NoiseSuppressionEffect.h new file mode 100644 index 000000000..0eee4b51b --- /dev/null +++ b/audio/effect/2.0/default/NoiseSuppressionEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H + +#include <android/hardware/audio/effect/2.0/INoiseSuppressionEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/NoiseSuppressionEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H diff --git a/audio/effect/2.0/default/PresetReverbEffect.cpp b/audio/effect/2.0/default/PresetReverbEffect.cpp new file mode 100644 index 000000000..0648f6a8e --- /dev/null +++ b/audio/effect/2.0/default/PresetReverbEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "PresetReverb_HAL" + +#include "PresetReverbEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/PresetReverbEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/PresetReverbEffect.h b/audio/effect/2.0/default/PresetReverbEffect.h new file mode 100644 index 000000000..1ea1626ff --- /dev/null +++ b/audio/effect/2.0/default/PresetReverbEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H + +#include <android/hardware/audio/effect/2.0/IPresetReverbEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/PresetReverbEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H diff --git a/audio/effect/2.0/default/VirtualizerEffect.cpp b/audio/effect/2.0/default/VirtualizerEffect.cpp new file mode 100644 index 000000000..63d3eb925 --- /dev/null +++ b/audio/effect/2.0/default/VirtualizerEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "Virtualizer_HAL" + +#include "VirtualizerEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/VirtualizerEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/VirtualizerEffect.h b/audio/effect/2.0/default/VirtualizerEffect.h new file mode 100644 index 000000000..04f93c4c7 --- /dev/null +++ b/audio/effect/2.0/default/VirtualizerEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H + +#include <android/hardware/audio/effect/2.0/IVirtualizerEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/VirtualizerEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H diff --git a/audio/effect/2.0/default/VisualizerEffect.cpp b/audio/effect/2.0/default/VisualizerEffect.cpp new file mode 100644 index 000000000..523552466 --- /dev/null +++ b/audio/effect/2.0/default/VisualizerEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 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. + */ + +#define LOG_TAG "Visualizer_HAL" + +#include "VisualizerEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/VisualizerEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/2.0/default/VisualizerEffect.h b/audio/effect/2.0/default/VisualizerEffect.h new file mode 100644 index 000000000..940f15de9 --- /dev/null +++ b/audio/effect/2.0/default/VisualizerEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 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. + */ + +#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H + +#include <android/hardware/audio/effect/2.0/IVisualizerEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include <effect/all-versions/default/VisualizerEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H diff --git a/audio/effect/all-versions/default/Android.bp b/audio/effect/all-versions/default/Android.bp new file mode 100644 index 000000000..ed2a09305 --- /dev/null +++ b/audio/effect/all-versions/default/Android.bp @@ -0,0 +1,31 @@ +cc_library_headers { + name: "android.hardware.audio.effect@all-versions-impl", + defaults: ["hidl_defaults"], + vendor: true, + relative_install_path: "hw", + + export_include_dirs: ["include"], + + shared_libs: [ + "libbase", + "libcutils", + "libeffects", + "libfmq", + "libhidlbase", + "libhidlmemory", + "libhidltransport", + "liblog", + "libutils", + "android.hardware.audio.common-util", + "android.hidl.memory@1.0", + ], + + header_libs: [ + "libaudio_system_headers", + "libaudioclient_headers", + "libeffects_headers", + "libhardware_headers", + "libmedia_headers", + "android.hardware.audio.common.util@all-versions", + ], +} diff --git a/audio/effect/all-versions/AcousticEchoCancelerEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.h index b9833bd01..b63f2fb93 100644 --- a/audio/effect/all-versions/AcousticEchoCancelerEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.h @@ -14,25 +14,21 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H +#include <common/all-versions/IncludeGuard.h> -#include <android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAcousticEchoCancelerEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -42,7 +38,7 @@ using ::android::sp; struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect { explicit AcousticEchoCancelerEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -86,7 +82,8 @@ struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect follow. + // Methods from + // ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAcousticEchoCancelerEffect follow. Return<Result> setEchoDelay(uint32_t echoDelayMs) override; Return<void> getEchoDelay(getEchoDelay_cb _hidl_cb) override; @@ -97,10 +94,8 @@ struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H diff --git a/audio/effect/all-versions/AcousticEchoCancelerEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h index 9315e3e15..bee360785 100644 --- a/audio/effect/all-versions/AcousticEchoCancelerEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h @@ -14,17 +14,16 @@ * limitations under the License. */ -#define LOG_TAG "AEC_Effect_HAL" +#include <common/all-versions/IncludeGuard.h> + #include <android/log.h> #include <system/audio_effects/effect_aec.h> -#include "AcousticEchoCancelerEffect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { AcousticEchoCancelerEffect::AcousticEchoCancelerEffect(effect_handle_t handle) @@ -32,7 +31,7 @@ AcousticEchoCancelerEffect::AcousticEchoCancelerEffect(effect_handle_t handle) AcousticEchoCancelerEffect::~AcousticEchoCancelerEffect() {} -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> AcousticEchoCancelerEffect::init() { return mEffect->init(); } @@ -162,7 +161,8 @@ Return<Result> AcousticEchoCancelerEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAcousticEchoCancelerEffect +// follow. Return<Result> AcousticEchoCancelerEffect::setEchoDelay(uint32_t echoDelayMs) { return mEffect->setParam(AEC_PARAM_ECHO_DELAY, echoDelayMs); } @@ -172,7 +172,7 @@ Return<void> AcousticEchoCancelerEffect::getEchoDelay(getEchoDelay_cb _hidl_cb) } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/AudioBufferManager.h b/audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.h index e19db126a..34dea2d03 100644 --- a/audio/effect/all-versions/AudioBufferManager.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.h @@ -14,26 +14,24 @@ * limitations under the License. */ -#ifndef android_hardware_audio_effect_V2_0_AudioBufferManager_H_ -#define android_hardware_audio_effect_V2_0_AudioBufferManager_H_ +#include <common/all-versions/IncludeGuard.h> #include <mutex> -#include <android/hardware/audio/effect/2.0/types.h> #include <android/hidl/memory/1.0/IMemory.h> #include <system/audio_effect.h> #include <utils/KeyedVector.h> #include <utils/RefBase.h> #include <utils/Singleton.h> -using ::android::hardware::audio::effect::V2_0::AudioBuffer; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer; using ::android::hidl::memory::V1_0::IMemory; namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { class AudioBufferWrapper : public RefBase { @@ -53,13 +51,13 @@ class AudioBufferWrapper : public RefBase { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android -using ::android::hardware::audio::effect::V2_0::implementation::AudioBufferWrapper; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::implementation::AudioBufferWrapper; namespace android { @@ -69,7 +67,7 @@ class AudioBufferManager : public Singleton<AudioBufferManager> { bool wrap(const AudioBuffer& buffer, sp<AudioBufferWrapper>* wrapper); private: - friend class hardware::audio::effect::V2_0::implementation::AudioBufferWrapper; + friend class hardware::audio::effect::AUDIO_HAL_VERSION::implementation::AudioBufferWrapper; // Called by AudioBufferWrapper. void removeEntry(uint64_t id); @@ -79,5 +77,3 @@ class AudioBufferManager : public Singleton<AudioBufferManager> { }; } // namespace android - -#endif // android_hardware_audio_effect_V2_0_AudioBufferManager_H_ diff --git a/audio/effect/all-versions/AudioBufferManager.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.impl.h index 3d4d3d53a..71ccd2d52 100644 --- a/audio/effect/all-versions/AudioBufferManager.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.impl.h @@ -14,12 +14,12 @@ * limitations under the License. */ +#include <common/all-versions/IncludeGuard.h> + #include <atomic> #include <hidlmemory/mapping.h> -#include "AudioBufferManager.h" - namespace android { ANDROID_SINGLETON_STATIC_INSTANCE(AudioBufferManager); @@ -53,7 +53,7 @@ void AudioBufferManager::removeEntry(uint64_t id) { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { AudioBufferWrapper::AudioBufferWrapper(const AudioBuffer& buffer) @@ -83,7 +83,7 @@ bool AudioBufferWrapper::init() { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/AutomaticGainControlEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.h index 5536e148d..941f45da3 100644 --- a/audio/effect/all-versions/AutomaticGainControlEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.h @@ -14,27 +14,23 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H +#include <common/all-versions/IncludeGuard.h> #include <system/audio_effects/effect_agc.h> -#include <android/hardware/audio/effect/2.0/IAutomaticGainControlEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAutomaticGainControlEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -44,7 +40,7 @@ using ::android::sp; struct AutomaticGainControlEffect : public IAutomaticGainControlEffect { explicit AutomaticGainControlEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -88,7 +84,8 @@ struct AutomaticGainControlEffect : public IAutomaticGainControlEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect follow. + // Methods from + // ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAutomaticGainControlEffect follow. Return<Result> setTargetLevel(int16_t targetLevelMb) override; Return<void> getTargetLevel(getTargetLevel_cb _hidl_cb) override; Return<Result> setCompGain(int16_t compGainMb) override; @@ -111,10 +108,8 @@ struct AutomaticGainControlEffect : public IAutomaticGainControlEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H diff --git a/audio/effect/all-versions/AutomaticGainControlEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h index 382a4bced..af05d9b78 100644 --- a/audio/effect/all-versions/AutomaticGainControlEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h @@ -14,16 +14,15 @@ * limitations under the License. */ -#define LOG_TAG "AGC_Effect_HAL" -#include <android/log.h> +#include <common/all-versions/IncludeGuard.h> -#include "AutomaticGainControlEffect.h" +#include <android/log.h> namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { AutomaticGainControlEffect::AutomaticGainControlEffect(effect_handle_t handle) @@ -45,7 +44,7 @@ void AutomaticGainControlEffect::propertiesToHal( halProperties->limiterEnabled = properties.limiterEnabled; } -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> AutomaticGainControlEffect::init() { return mEffect->init(); } @@ -175,7 +174,8 @@ Return<Result> AutomaticGainControlEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAutomaticGainControlEffect +// follow. Return<Result> AutomaticGainControlEffect::setTargetLevel(int16_t targetLevelMb) { return mEffect->setParam(AGC_PARAM_TARGET_LEVEL, targetLevelMb); } @@ -217,7 +217,7 @@ Return<void> AutomaticGainControlEffect::getAllProperties(getAllProperties_cb _h } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/BassBoostEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.h index 278f37b9c..00926217b 100644 --- a/audio/effect/all-versions/BassBoostEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.h @@ -14,25 +14,21 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H +#include <common/all-versions/IncludeGuard.h> -#include <android/hardware/audio/effect/2.0/IBassBoostEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::effect::V2_0::IBassBoostEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IBassBoostEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -42,7 +38,7 @@ using ::android::sp; struct BassBoostEffect : public IBassBoostEffect { explicit BassBoostEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -86,7 +82,7 @@ struct BassBoostEffect : public IBassBoostEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IBassBoostEffect follow. Return<void> isStrengthSupported(isStrengthSupported_cb _hidl_cb) override; Return<Result> setStrength(uint16_t strength) override; Return<void> getStrength(getStrength_cb _hidl_cb) override; @@ -98,10 +94,8 @@ struct BassBoostEffect : public IBassBoostEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H diff --git a/audio/effect/all-versions/BassBoostEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.impl.h index 3366fcc43..1fc8d1b42 100644 --- a/audio/effect/all-versions/BassBoostEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.impl.h @@ -14,24 +14,23 @@ * limitations under the License. */ -#define LOG_TAG "BassBoost_HAL" +#include <common/all-versions/IncludeGuard.h> + #include <android/log.h> #include <system/audio_effects/effect_bassboost.h> -#include "BassBoostEffect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { BassBoostEffect::BassBoostEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {} BassBoostEffect::~BassBoostEffect() {} -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> BassBoostEffect::init() { return mEffect->init(); } @@ -158,7 +157,7 @@ Return<Result> BassBoostEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IBassBoostEffect follow. Return<void> BassBoostEffect::isStrengthSupported(isStrengthSupported_cb _hidl_cb) { return mEffect->getIntegerParam(BASSBOOST_PARAM_STRENGTH_SUPPORTED, _hidl_cb); } @@ -172,7 +171,7 @@ Return<void> BassBoostEffect::getStrength(getStrength_cb _hidl_cb) { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/Conversions.h b/audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.h index e13f36b61..3f9317f76 100644 --- a/audio/effect/all-versions/Conversions.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.h @@ -14,32 +14,28 @@ * limitations under the License. */ -#ifndef android_hardware_audio_effect_V2_0_Conversions_H_ -#define android_hardware_audio_effect_V2_0_Conversions_H_ +#include <common/all-versions/IncludeGuard.h> #include <string> -#include <android/hardware/audio/effect/2.0/types.h> #include <system/audio_effect.h> namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::effect::V2_0::EffectDescriptor; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; void effectDescriptorFromHal(const effect_descriptor_t& halDescriptor, EffectDescriptor* descriptor); std::string uuidToString(const effect_uuid_t& halUuid); } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // android_hardware_audio_effect_V2_0_Conversions_H_ diff --git a/audio/effect/all-versions/Conversions.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.impl.h index 0b485d567..44adf4b2c 100644 --- a/audio/effect/all-versions/Conversions.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.impl.h @@ -14,19 +14,18 @@ * limitations under the License. */ +#include <common/all-versions/IncludeGuard.h> + #include <memory.h> #include <stdio.h> -#include "Conversions.h" -#include "HidlUtils.h" - -using ::android::hardware::audio::common::V2_0::HidlUtils; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::HidlUtils; namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { void effectDescriptorFromHal(const effect_descriptor_t& halDescriptor, @@ -50,7 +49,7 @@ std::string uuidToString(const effect_uuid_t& halUuid) { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/DownmixEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.h index edcc95a80..e461ca80b 100644 --- a/audio/effect/all-versions/DownmixEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.h @@ -14,25 +14,21 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H +#include <common/all-versions/IncludeGuard.h> -#include <android/hardware/audio/effect/2.0/IDownmixEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::effect::V2_0::IDownmixEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IDownmixEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -42,7 +38,7 @@ using ::android::sp; struct DownmixEffect : public IDownmixEffect { explicit DownmixEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -86,7 +82,7 @@ struct DownmixEffect : public IDownmixEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IDownmixEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IDownmixEffect follow. Return<Result> setType(IDownmixEffect::Type preset) override; Return<void> getType(getType_cb _hidl_cb) override; @@ -97,10 +93,8 @@ struct DownmixEffect : public IDownmixEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H diff --git a/audio/effect/all-versions/DownmixEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.impl.h index e45f996a0..98710f89d 100644 --- a/audio/effect/all-versions/DownmixEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.impl.h @@ -14,24 +14,23 @@ * limitations under the License. */ -#define LOG_TAG "Downmix_HAL" +#include <common/all-versions/IncludeGuard.h> + #include <android/log.h> #include <system/audio_effects/effect_downmix.h> -#include "DownmixEffect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { DownmixEffect::DownmixEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {} DownmixEffect::~DownmixEffect() {} -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> DownmixEffect::init() { return mEffect->init(); } @@ -158,7 +157,7 @@ Return<Result> DownmixEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::IDownmixEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IDownmixEffect follow. Return<Result> DownmixEffect::setType(IDownmixEffect::Type preset) { return mEffect->setParam(DOWNMIX_PARAM_TYPE, static_cast<downmix_type_t>(preset)); } @@ -171,7 +170,7 @@ Return<void> DownmixEffect::getType(getType_cb _hidl_cb) { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/Effect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.h index 8f95e5edc..81b0b2442 100644 --- a/audio/effect/all-versions/Effect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.h @@ -14,14 +14,12 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H +#include <common/all-versions/IncludeGuard.h> #include <atomic> #include <memory> #include <vector> -#include <android/hardware/audio/effect/2.0/IEffect.h> #include <fmq/EventFlag.h> #include <fmq/MessageQueue.h> #include <hidl/MQDescriptor.h> @@ -30,28 +28,26 @@ #include <hardware/audio_effect.h> -#include "AudioBufferManager.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::common::V2_0::AudioDevice; -using ::android::hardware::audio::common::V2_0::AudioMode; -using ::android::hardware::audio::common::V2_0::AudioSource; -using ::android::hardware::audio::common::V2_0::Uuid; -using ::android::hardware::audio::effect::V2_0::AudioBuffer; -using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig; -using ::android::hardware::audio::effect::V2_0::EffectConfig; -using ::android::hardware::audio::effect::V2_0::EffectDescriptor; -using ::android::hardware::audio::effect::V2_0::EffectFeature; -using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter; -using ::android::hardware::audio::effect::V2_0::IEffect; -using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::Uuid; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectFeature; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -65,7 +61,7 @@ struct Effect : public IEffect { explicit Effect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -235,10 +231,8 @@ struct Effect : public IEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H diff --git a/audio/effect/all-versions/Effect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.impl.h index 487bbe6a5..d3761464b 100644 --- a/audio/effect/all-versions/Effect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.impl.h @@ -14,29 +14,26 @@ * limitations under the License. */ +#include <common/all-versions/IncludeGuard.h> + #include <memory.h> -#define LOG_TAG "EffectHAL" #define ATRACE_TAG ATRACE_TAG_AUDIO #include <android/log.h> #include <media/EffectsFactoryApi.h> #include <utils/Trace.h> -#include "Conversions.h" -#include "Effect.h" -#include "common/all-versions/default/EffectMap.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::common::V2_0::AudioChannelMask; -using ::android::hardware::audio::common::V2_0::AudioFormat; -using ::android::hardware::audio::effect::V2_0::MessageQueueFlagBits; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioChannelMask; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioFormat; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::MessageQueueFlagBits; namespace { @@ -479,7 +476,7 @@ Result Effect::setParameterImpl(uint32_t paramSize, const void* paramData, uint3 &halParamBuffer[0]); } -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> Effect::init() { return sendCommandReturningStatus(EFFECT_CMD_INIT, "INIT"); } @@ -707,7 +704,7 @@ Return<Result> Effect::close() { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/EffectsFactory.h b/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.h index 34bdb403d..e586abb80 100644 --- a/audio/effect/all-versions/EffectsFactory.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.h @@ -14,12 +14,11 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H +#include <common/all-versions/IncludeGuard.h> +#include <hardware/audio_effect.h> #include <system/audio_effect.h> -#include <android/hardware/audio/effect/2.0/IEffectsFactory.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> @@ -27,14 +26,14 @@ namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::common::V2_0::Uuid; -using ::android::hardware::audio::effect::V2_0::EffectDescriptor; -using ::android::hardware::audio::effect::V2_0::IEffect; -using ::android::hardware::audio::effect::V2_0::IEffectsFactory; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::Uuid; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -42,7 +41,7 @@ using ::android::hardware::hidl_string; using ::android::sp; struct EffectsFactory : public IEffectsFactory { - // Methods from ::android::hardware::audio::effect::V2_0::IEffectsFactory follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory follow. Return<void> getAllDescriptors(getAllDescriptors_cb _hidl_cb) override; Return<void> getDescriptor(const Uuid& uid, getDescriptor_cb _hidl_cb) override; Return<void> createEffect(const Uuid& uid, int32_t session, int32_t ioHandle, @@ -57,10 +56,8 @@ struct EffectsFactory : public IEffectsFactory { extern "C" IEffectsFactory* HIDL_FETCH_IEffectsFactory(const char* name); } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H diff --git a/audio/effect/all-versions/EffectsFactory.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.impl.h index 67fd22a79..b2a36a96f 100644 --- a/audio/effect/all-versions/EffectsFactory.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.impl.h @@ -14,7 +14,8 @@ * limitations under the License. */ -#define LOG_TAG "EffectFactoryHAL" +#include <common/all-versions/IncludeGuard.h> + #include <android/log.h> #include <media/EffectsFactoryApi.h> #include <system/audio_effects/effect_aec.h> @@ -29,30 +30,13 @@ #include <system/audio_effects/effect_virtualizer.h> #include <system/audio_effects/effect_visualizer.h> -#include "AcousticEchoCancelerEffect.h" -#include "AutomaticGainControlEffect.h" -#include "BassBoostEffect.h" -#include "Conversions.h" -#include "DownmixEffect.h" -#include "Effect.h" -#include "EffectsFactory.h" -#include "EnvironmentalReverbEffect.h" -#include "EqualizerEffect.h" -#include "HidlUtils.h" -#include "LoudnessEnhancerEffect.h" -#include "NoiseSuppressionEffect.h" -#include "PresetReverbEffect.h" -#include "VirtualizerEffect.h" -#include "VisualizerEffect.h" -#include "common/all-versions/default/EffectMap.h" - -using ::android::hardware::audio::common::V2_0::HidlUtils; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::HidlUtils; namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { // static @@ -85,7 +69,7 @@ sp<IEffect> EffectsFactory::dispatchEffectInstanceCreation(const effect_descript return new Effect(handle); } -// Methods from ::android::hardware::audio::effect::V2_0::IEffectsFactory follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory follow. Return<void> EffectsFactory::getAllDescriptors(getAllDescriptors_cb _hidl_cb) { Result retval(Result::OK); hidl_vec<EffectDescriptor> result; @@ -199,7 +183,7 @@ IEffectsFactory* HIDL_FETCH_IEffectsFactory(const char* /* name */) { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/EnvironmentalReverbEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.h index a0ae54631..8351e5517 100644 --- a/audio/effect/all-versions/EnvironmentalReverbEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.h @@ -14,37 +14,33 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H +#include <common/all-versions/IncludeGuard.h> #include <system/audio_effects/effect_environmentalreverb.h> -#include <android/hardware/audio/effect/2.0/IEnvironmentalReverbEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::common::V2_0::AudioDevice; -using ::android::hardware::audio::common::V2_0::AudioMode; -using ::android::hardware::audio::common::V2_0::AudioSource; -using ::android::hardware::audio::effect::V2_0::AudioBuffer; -using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig; -using ::android::hardware::audio::effect::V2_0::EffectConfig; -using ::android::hardware::audio::effect::V2_0::EffectDescriptor; -using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter; -using ::android::hardware::audio::effect::V2_0::IEffect; -using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback; -using ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEnvironmentalReverbEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -54,7 +50,7 @@ using ::android::sp; struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect { explicit EnvironmentalReverbEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -98,7 +94,8 @@ struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect follow. + // Methods from + // ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEnvironmentalReverbEffect follow. Return<Result> setBypass(bool bypass) override; Return<void> getBypass(getBypass_cb _hidl_cb) override; Return<Result> setRoomLevel(int16_t roomLevel) override; @@ -137,10 +134,8 @@ struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H diff --git a/audio/effect/all-versions/EnvironmentalReverbEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h index a10ad0ece..9090b8ab7 100644 --- a/audio/effect/all-versions/EnvironmentalReverbEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h @@ -14,16 +14,15 @@ * limitations under the License. */ -#define LOG_TAG "EnvReverb_HAL" -#include <android/log.h> +#include <common/all-versions/IncludeGuard.h> -#include "EnvironmentalReverbEffect.h" +#include <android/log.h> namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { EnvironmentalReverbEffect::EnvironmentalReverbEffect(effect_handle_t handle) @@ -59,7 +58,7 @@ void EnvironmentalReverbEffect::propertiesToHal( halProperties->density = properties.density; } -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> EnvironmentalReverbEffect::init() { return mEffect->init(); } @@ -189,7 +188,8 @@ Return<Result> EnvironmentalReverbEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEnvironmentalReverbEffect +// follow. Return<Result> EnvironmentalReverbEffect::setBypass(bool bypass) { return mEffect->setParam(REVERB_PARAM_BYPASS, bypass); } @@ -295,7 +295,7 @@ Return<void> EnvironmentalReverbEffect::getAllProperties(getAllProperties_cb _hi } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/EqualizerEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.h index 4f73f8eb4..c2b8ef8b5 100644 --- a/audio/effect/all-versions/EqualizerEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.h @@ -14,39 +14,35 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H +#include <common/all-versions/IncludeGuard.h> #include <vector> #include <system/audio_effects/effect_equalizer.h> -#include <android/hardware/audio/effect/2.0/IEqualizerEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::common::V2_0::AudioDevice; -using ::android::hardware::audio::common::V2_0::AudioMode; -using ::android::hardware::audio::common::V2_0::AudioSource; -using ::android::hardware::audio::effect::V2_0::AudioBuffer; -using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig; -using ::android::hardware::audio::effect::V2_0::EffectConfig; -using ::android::hardware::audio::effect::V2_0::EffectDescriptor; -using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter; -using ::android::hardware::audio::effect::V2_0::IEffect; -using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback; -using ::android::hardware::audio::effect::V2_0::IEqualizerEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEqualizerEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -56,7 +52,7 @@ using ::android::sp; struct EqualizerEffect : public IEqualizerEffect { explicit EqualizerEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -100,7 +96,7 @@ struct EqualizerEffect : public IEqualizerEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IEqualizerEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEqualizerEffect follow. Return<void> getNumBands(getNumBands_cb _hidl_cb) override; Return<void> getLevelRange(getLevelRange_cb _hidl_cb) override; Return<Result> setBandLevel(uint16_t band, int16_t level) override; @@ -126,10 +122,8 @@ struct EqualizerEffect : public IEqualizerEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H diff --git a/audio/effect/all-versions/EqualizerEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.impl.h index d587c93e5..78485e48f 100644 --- a/audio/effect/all-versions/EqualizerEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.impl.h @@ -14,18 +14,17 @@ * limitations under the License. */ +#include <common/all-versions/IncludeGuard.h> + #include <memory.h> -#define LOG_TAG "Equalizer_HAL" #include <android/log.h> -#include "EqualizerEffect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { EqualizerEffect::EqualizerEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {} @@ -54,7 +53,7 @@ std::vector<uint8_t> EqualizerEffect::propertiesToHal( return halBuffer; } -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> EqualizerEffect::init() { return mEffect->init(); } @@ -181,7 +180,7 @@ Return<Result> EqualizerEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::IEqualizerEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEqualizerEffect follow. Return<void> EqualizerEffect::getNumBands(getNumBands_cb _hidl_cb) { return mEffect->getIntegerParam(EQ_PARAM_NUM_BANDS, _hidl_cb); } @@ -284,7 +283,7 @@ Return<void> EqualizerEffect::getAllProperties(getAllProperties_cb _hidl_cb) { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/LoudnessEnhancerEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.h index 73d45e332..e4f1bd5e9 100644 --- a/audio/effect/all-versions/LoudnessEnhancerEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.h @@ -14,35 +14,31 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H +#include <common/all-versions/IncludeGuard.h> -#include <android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::common::V2_0::AudioDevice; -using ::android::hardware::audio::common::V2_0::AudioMode; -using ::android::hardware::audio::common::V2_0::AudioSource; -using ::android::hardware::audio::effect::V2_0::AudioBuffer; -using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig; -using ::android::hardware::audio::effect::V2_0::EffectConfig; -using ::android::hardware::audio::effect::V2_0::EffectDescriptor; -using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter; -using ::android::hardware::audio::effect::V2_0::IEffect; -using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback; -using ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::ILoudnessEnhancerEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -52,7 +48,7 @@ using ::android::sp; struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect { explicit LoudnessEnhancerEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -96,7 +92,8 @@ struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::ILoudnessEnhancerEffect + // follow. Return<Result> setTargetGain(int32_t targetGainMb) override; Return<void> getTargetGain(getTargetGain_cb _hidl_cb) override; @@ -107,10 +104,8 @@ struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H diff --git a/audio/effect/all-versions/LoudnessEnhancerEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h index 7c25579d1..3f4f379a2 100644 --- a/audio/effect/all-versions/LoudnessEnhancerEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h @@ -14,19 +14,18 @@ * limitations under the License. */ +#include <common/all-versions/IncludeGuard.h> + #include <system/audio_effects/effect_loudnessenhancer.h> -#define LOG_TAG "LoudnessEnhancer_HAL" #include <android/log.h> #include <system/audio_effects/effect_aec.h> -#include "LoudnessEnhancerEffect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { LoudnessEnhancerEffect::LoudnessEnhancerEffect(effect_handle_t handle) @@ -34,7 +33,7 @@ LoudnessEnhancerEffect::LoudnessEnhancerEffect(effect_handle_t handle) LoudnessEnhancerEffect::~LoudnessEnhancerEffect() {} -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> LoudnessEnhancerEffect::init() { return mEffect->init(); } @@ -161,7 +160,8 @@ Return<Result> LoudnessEnhancerEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::ILoudnessEnhancerEffect +// follow. Return<Result> LoudnessEnhancerEffect::setTargetGain(int32_t targetGainMb) { return mEffect->setParam(LOUDNESS_ENHANCER_DEFAULT_TARGET_GAIN_MB, targetGainMb); } @@ -180,7 +180,7 @@ Return<void> LoudnessEnhancerEffect::getTargetGain(getTargetGain_cb _hidl_cb) { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/NoiseSuppressionEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.h index d8334416f..7b64ba015 100644 --- a/audio/effect/all-versions/NoiseSuppressionEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.h @@ -14,37 +14,33 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H +#include <common/all-versions/IncludeGuard.h> #include <system/audio_effects/effect_ns.h> -#include <android/hardware/audio/effect/2.0/INoiseSuppressionEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::common::V2_0::AudioDevice; -using ::android::hardware::audio::common::V2_0::AudioMode; -using ::android::hardware::audio::common::V2_0::AudioSource; -using ::android::hardware::audio::effect::V2_0::AudioBuffer; -using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig; -using ::android::hardware::audio::effect::V2_0::EffectConfig; -using ::android::hardware::audio::effect::V2_0::EffectDescriptor; -using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter; -using ::android::hardware::audio::effect::V2_0::IEffect; -using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback; -using ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::INoiseSuppressionEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -54,7 +50,7 @@ using ::android::sp; struct NoiseSuppressionEffect : public INoiseSuppressionEffect { explicit NoiseSuppressionEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -98,7 +94,8 @@ struct NoiseSuppressionEffect : public INoiseSuppressionEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::INoiseSuppressionEffect + // follow. Return<Result> setSuppressionLevel(INoiseSuppressionEffect::Level level) override; Return<void> getSuppressionLevel(getSuppressionLevel_cb _hidl_cb) override; Return<Result> setSuppressionType(INoiseSuppressionEffect::Type type) override; @@ -119,10 +116,8 @@ struct NoiseSuppressionEffect : public INoiseSuppressionEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H diff --git a/audio/effect/all-versions/NoiseSuppressionEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h index fe3042187..e5fc454a4 100644 --- a/audio/effect/all-versions/NoiseSuppressionEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h @@ -14,16 +14,15 @@ * limitations under the License. */ -#define LOG_TAG "NS_Effect_HAL" -#include <android/log.h> +#include <common/all-versions/IncludeGuard.h> -#include "NoiseSuppressionEffect.h" +#include <android/log.h> namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { NoiseSuppressionEffect::NoiseSuppressionEffect(effect_handle_t handle) @@ -43,7 +42,7 @@ void NoiseSuppressionEffect::propertiesToHal( halProperties->type = static_cast<uint32_t>(properties.type); } -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> NoiseSuppressionEffect::init() { return mEffect->init(); } @@ -170,7 +169,8 @@ Return<Result> NoiseSuppressionEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::INoiseSuppressionEffect +// follow. Return<Result> NoiseSuppressionEffect::setSuppressionLevel(INoiseSuppressionEffect::Level level) { return mEffect->setParam(NS_PARAM_LEVEL, static_cast<int32_t>(level)); } @@ -210,7 +210,7 @@ Return<void> NoiseSuppressionEffect::getAllProperties(getAllProperties_cb _hidl_ } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/PresetReverbEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.h index fc836513a..3114acd8d 100644 --- a/audio/effect/all-versions/PresetReverbEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.h @@ -14,35 +14,31 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H +#include <common/all-versions/IncludeGuard.h> -#include <android/hardware/audio/effect/2.0/IPresetReverbEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::common::V2_0::AudioDevice; -using ::android::hardware::audio::common::V2_0::AudioMode; -using ::android::hardware::audio::common::V2_0::AudioSource; -using ::android::hardware::audio::effect::V2_0::AudioBuffer; -using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig; -using ::android::hardware::audio::effect::V2_0::EffectConfig; -using ::android::hardware::audio::effect::V2_0::EffectDescriptor; -using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter; -using ::android::hardware::audio::effect::V2_0::IEffect; -using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback; -using ::android::hardware::audio::effect::V2_0::IPresetReverbEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IPresetReverbEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -52,7 +48,7 @@ using ::android::sp; struct PresetReverbEffect : public IPresetReverbEffect { explicit PresetReverbEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -96,7 +92,8 @@ struct PresetReverbEffect : public IPresetReverbEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IPresetReverbEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IPresetReverbEffect + // follow. Return<Result> setPreset(IPresetReverbEffect::Preset preset) override; Return<void> getPreset(getPreset_cb _hidl_cb) override; @@ -107,10 +104,8 @@ struct PresetReverbEffect : public IPresetReverbEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H diff --git a/audio/effect/all-versions/PresetReverbEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.impl.h index 4f1ccd3f0..32198d50e 100644 --- a/audio/effect/all-versions/PresetReverbEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.impl.h @@ -14,24 +14,23 @@ * limitations under the License. */ -#define LOG_TAG "PresetReverb_HAL" +#include <common/all-versions/IncludeGuard.h> + #include <android/log.h> #include <system/audio_effects/effect_presetreverb.h> -#include "PresetReverbEffect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { PresetReverbEffect::PresetReverbEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {} PresetReverbEffect::~PresetReverbEffect() {} -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> PresetReverbEffect::init() { return mEffect->init(); } @@ -158,7 +157,7 @@ Return<Result> PresetReverbEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::IPresetReverbEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IPresetReverbEffect follow. Return<Result> PresetReverbEffect::setPreset(IPresetReverbEffect::Preset preset) { return mEffect->setParam(REVERB_PARAM_PRESET, static_cast<t_reverb_presets>(preset)); } @@ -171,7 +170,7 @@ Return<void> PresetReverbEffect::getPreset(getPreset_cb _hidl_cb) { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/VirtualizerEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.h index 911cecae6..371589488 100644 --- a/audio/effect/all-versions/VirtualizerEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.h @@ -14,36 +14,32 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H +#include <common/all-versions/IncludeGuard.h> -#include <android/hardware/audio/effect/2.0/IVirtualizerEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::common::V2_0::AudioChannelMask; -using ::android::hardware::audio::common::V2_0::AudioDevice; -using ::android::hardware::audio::common::V2_0::AudioMode; -using ::android::hardware::audio::common::V2_0::AudioSource; -using ::android::hardware::audio::effect::V2_0::AudioBuffer; -using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig; -using ::android::hardware::audio::effect::V2_0::EffectConfig; -using ::android::hardware::audio::effect::V2_0::EffectDescriptor; -using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter; -using ::android::hardware::audio::effect::V2_0::IEffect; -using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback; -using ::android::hardware::audio::effect::V2_0::IVirtualizerEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioChannelMask; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVirtualizerEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -53,7 +49,7 @@ using ::android::sp; struct VirtualizerEffect : public IVirtualizerEffect { explicit VirtualizerEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -97,7 +93,8 @@ struct VirtualizerEffect : public IVirtualizerEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IVirtualizerEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVirtualizerEffect + // follow. Return<bool> isStrengthSupported() override; Return<Result> setStrength(uint16_t strength) override; Return<void> getStrength(getStrength_cb _hidl_cb) override; @@ -116,10 +113,8 @@ struct VirtualizerEffect : public IVirtualizerEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H diff --git a/audio/effect/all-versions/VirtualizerEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.impl.h index bb96855be..6fb800559 100644 --- a/audio/effect/all-versions/VirtualizerEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.impl.h @@ -14,19 +14,18 @@ * limitations under the License. */ +#include <common/all-versions/IncludeGuard.h> + #include <memory.h> -#define LOG_TAG "Virtualizer_HAL" #include <android/log.h> #include <system/audio_effects/effect_virtualizer.h> -#include "VirtualizerEffect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { VirtualizerEffect::VirtualizerEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {} @@ -43,7 +42,7 @@ void VirtualizerEffect::speakerAnglesFromHal(const int32_t* halAngles, uint32_t } } -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> VirtualizerEffect::init() { return mEffect->init(); } @@ -170,7 +169,7 @@ Return<Result> VirtualizerEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::IVirtualizerEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVirtualizerEffect follow. Return<bool> VirtualizerEffect::isStrengthSupported() { bool halSupported = false; mEffect->getParam(VIRTUALIZER_PARAM_STRENGTH_SUPPORTED, halSupported); @@ -222,7 +221,7 @@ Return<void> VirtualizerEffect::getVirtualizationMode(getVirtualizationMode_cb _ } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware diff --git a/audio/effect/all-versions/VisualizerEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.h index 58a3dbfd4..80502210c 100644 --- a/audio/effect/all-versions/VisualizerEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.h @@ -14,35 +14,31 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H -#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H +#include <common/all-versions/IncludeGuard.h> -#include <android/hardware/audio/effect/2.0/IVisualizerEffect.h> #include <hidl/Status.h> #include <hidl/MQDescriptor.h> -#include "Effect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { -using ::android::hardware::audio::common::V2_0::AudioDevice; -using ::android::hardware::audio::common::V2_0::AudioMode; -using ::android::hardware::audio::common::V2_0::AudioSource; -using ::android::hardware::audio::effect::V2_0::AudioBuffer; -using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig; -using ::android::hardware::audio::effect::V2_0::EffectConfig; -using ::android::hardware::audio::effect::V2_0::EffectDescriptor; -using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter; -using ::android::hardware::audio::effect::V2_0::IEffect; -using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback; -using ::android::hardware::audio::effect::V2_0::IVisualizerEffect; -using ::android::hardware::audio::effect::V2_0::Result; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVisualizerEffect; +using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -52,7 +48,7 @@ using ::android::sp; struct VisualizerEffect : public IVisualizerEffect { explicit VisualizerEffect(effect_handle_t handle); - // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> init() override; Return<Result> setConfig( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, @@ -96,7 +92,7 @@ struct VisualizerEffect : public IVisualizerEffect { const hidl_vec<uint8_t>& configData) override; Return<Result> close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IVisualizerEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVisualizerEffect follow. Return<Result> setCaptureSize(uint16_t captureSize) override; Return<void> getCaptureSize(getCaptureSize_cb _hidl_cb) override; Return<Result> setScalingMode(IVisualizerEffect::ScalingMode scalingMode) override; @@ -117,10 +113,8 @@ struct VisualizerEffect : public IVisualizerEffect { }; } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware } // namespace android - -#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H diff --git a/audio/effect/all-versions/VisualizerEffect.cpp b/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.impl.h index bac3a0312..035145368 100644 --- a/audio/effect/all-versions/VisualizerEffect.cpp +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.impl.h @@ -14,17 +14,16 @@ * limitations under the License. */ -#define LOG_TAG "Visualizer_HAL" +#include <common/all-versions/IncludeGuard.h> + #include <android/log.h> #include <system/audio_effects/effect_visualizer.h> -#include "VisualizerEffect.h" - namespace android { namespace hardware { namespace audio { namespace effect { -namespace V2_0 { +namespace AUDIO_HAL_VERSION { namespace implementation { VisualizerEffect::VisualizerEffect(effect_handle_t handle) @@ -32,7 +31,7 @@ VisualizerEffect::VisualizerEffect(effect_handle_t handle) VisualizerEffect::~VisualizerEffect() {} -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return<Result> VisualizerEffect::init() { return mEffect->init(); } @@ -159,7 +158,7 @@ Return<Result> VisualizerEffect::close() { return mEffect->close(); } -// Methods from ::android::hardware::audio::effect::V2_0::IVisualizerEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVisualizerEffect follow. Return<Result> VisualizerEffect::setCaptureSize(uint16_t captureSize) { Result retval = mEffect->setParam(VISUALIZER_PARAM_CAPTURE_SIZE, captureSize); if (retval == Result::OK) { @@ -246,7 +245,7 @@ Return<void> VisualizerEffect::measure(measure_cb _hidl_cb) { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware |
