From 62588b69f6289e2ccb7a363a4b0727d51b76bfb5 Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Wed, 20 Dec 2017 11:07:12 -0800 Subject: [PATCH] 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 ' * # 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 \\\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 --- .../default/AcousticEchoCancelerEffect.cpp | 23 ++++++++++ .../2.0/default/AcousticEchoCancelerEffect.h | 28 ++++++++++++ .../{all-versions => 2.0/default}/Android.bp | 2 + .../effect/2.0/default/AudioBufferManager.cpp | 21 +++++++++ audio/effect/2.0/default/AudioBufferManager.h | 26 +++++++++++ .../default/AutomaticGainControlEffect.cpp | 23 ++++++++++ .../2.0/default/AutomaticGainControlEffect.h | 28 ++++++++++++ audio/effect/2.0/default/BassBoostEffect.cpp | 23 ++++++++++ audio/effect/2.0/default/BassBoostEffect.h | 30 +++++++++++++ audio/effect/2.0/default/Conversions.cpp | 24 +++++++++++ audio/effect/2.0/default/Conversions.h | 26 +++++++++++ audio/effect/2.0/default/DownmixEffect.cpp | 23 ++++++++++ audio/effect/2.0/default/DownmixEffect.h | 28 ++++++++++++ audio/effect/2.0/default/Effect.cpp | 28 ++++++++++++ audio/effect/2.0/default/Effect.h | 28 ++++++++++++ audio/effect/2.0/default/EffectsFactory.cpp | 39 +++++++++++++++++ audio/effect/2.0/default/EffectsFactory.h | 29 +++++++++++++ .../2.0/default/EnvironmentalReverbEffect.cpp | 24 +++++++++++ .../2.0/default/EnvironmentalReverbEffect.h | 30 +++++++++++++ audio/effect/2.0/default/EqualizerEffect.cpp | 23 ++++++++++ audio/effect/2.0/default/EqualizerEffect.h | 28 ++++++++++++ .../2.0/default/LoudnessEnhancerEffect.cpp | 23 ++++++++++ .../2.0/default/LoudnessEnhancerEffect.h | 28 ++++++++++++ .../2.0/default/NoiseSuppressionEffect.cpp | 23 ++++++++++ .../2.0/default/NoiseSuppressionEffect.h | 28 ++++++++++++ .../effect/2.0/default/PresetReverbEffect.cpp | 23 ++++++++++ audio/effect/2.0/default/PresetReverbEffect.h | 28 ++++++++++++ .../effect/2.0/default/VirtualizerEffect.cpp | 23 ++++++++++ audio/effect/2.0/default/VirtualizerEffect.h | 28 ++++++++++++ audio/effect/2.0/default/VisualizerEffect.cpp | 23 ++++++++++ audio/effect/2.0/default/VisualizerEffect.h | 28 ++++++++++++ audio/effect/all-versions/default/Android.bp | 31 +++++++++++++ .../default}/AcousticEchoCancelerEffect.h | 21 ++++----- .../AcousticEchoCancelerEffect.impl.h} | 14 +++--- .../default}/AudioBufferManager.h | 16 +++---- .../default/AudioBufferManager.impl.h} | 8 ++-- .../default}/AutomaticGainControlEffect.h | 21 ++++----- .../AutomaticGainControlEffect.impl.h} | 14 +++--- .../all-versions/default}/BassBoostEffect.h | 20 +++------ .../default/BassBoostEffect.impl.h} | 13 +++--- .../all-versions/default}/Conversions.h | 12 ++---- .../all-versions/default/Conversions.impl.h} | 11 +++-- .../all-versions/default}/DownmixEffect.h | 20 +++------ .../default/DownmixEffect.impl.h} | 13 +++--- .../effect/all-versions/default}/Effect.h | 40 ++++++++--------- .../all-versions/default/Effect.impl.h} | 19 ++++---- .../all-versions/default}/EffectsFactory.h | 23 +++++----- .../default/EffectsFactory.impl.h} | 28 +++--------- .../default}/EnvironmentalReverbEffect.h | 41 ++++++++---------- .../default/EnvironmentalReverbEffect.impl.h} | 14 +++--- .../all-versions/default}/EqualizerEffect.h | 40 ++++++++--------- .../default/EqualizerEffect.impl.h} | 13 +++--- .../default}/LoudnessEnhancerEffect.h | 41 ++++++++---------- .../default/LoudnessEnhancerEffect.impl.h} | 14 +++--- .../default}/NoiseSuppressionEffect.h | 41 ++++++++---------- .../default/NoiseSuppressionEffect.impl.h} | 14 +++--- .../default}/PresetReverbEffect.h | 41 ++++++++---------- .../default/PresetReverbEffect.impl.h} | 13 +++--- .../all-versions/default}/VirtualizerEffect.h | 43 ++++++++----------- .../default/VirtualizerEffect.impl.h} | 13 +++--- .../all-versions/default}/VisualizerEffect.h | 40 ++++++++--------- .../default/VisualizerEffect.impl.h} | 13 +++--- 62 files changed, 1106 insertions(+), 388 deletions(-) create mode 100644 audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp create mode 100644 audio/effect/2.0/default/AcousticEchoCancelerEffect.h rename audio/effect/{all-versions => 2.0/default}/Android.bp (91%) create mode 100644 audio/effect/2.0/default/AudioBufferManager.cpp create mode 100644 audio/effect/2.0/default/AudioBufferManager.h create mode 100644 audio/effect/2.0/default/AutomaticGainControlEffect.cpp create mode 100644 audio/effect/2.0/default/AutomaticGainControlEffect.h create mode 100644 audio/effect/2.0/default/BassBoostEffect.cpp create mode 100644 audio/effect/2.0/default/BassBoostEffect.h create mode 100644 audio/effect/2.0/default/Conversions.cpp create mode 100644 audio/effect/2.0/default/Conversions.h create mode 100644 audio/effect/2.0/default/DownmixEffect.cpp create mode 100644 audio/effect/2.0/default/DownmixEffect.h create mode 100644 audio/effect/2.0/default/Effect.cpp create mode 100644 audio/effect/2.0/default/Effect.h create mode 100644 audio/effect/2.0/default/EffectsFactory.cpp create mode 100644 audio/effect/2.0/default/EffectsFactory.h create mode 100644 audio/effect/2.0/default/EnvironmentalReverbEffect.cpp create mode 100644 audio/effect/2.0/default/EnvironmentalReverbEffect.h create mode 100644 audio/effect/2.0/default/EqualizerEffect.cpp create mode 100644 audio/effect/2.0/default/EqualizerEffect.h create mode 100644 audio/effect/2.0/default/LoudnessEnhancerEffect.cpp create mode 100644 audio/effect/2.0/default/LoudnessEnhancerEffect.h create mode 100644 audio/effect/2.0/default/NoiseSuppressionEffect.cpp create mode 100644 audio/effect/2.0/default/NoiseSuppressionEffect.h create mode 100644 audio/effect/2.0/default/PresetReverbEffect.cpp create mode 100644 audio/effect/2.0/default/PresetReverbEffect.h create mode 100644 audio/effect/2.0/default/VirtualizerEffect.cpp create mode 100644 audio/effect/2.0/default/VirtualizerEffect.h create mode 100644 audio/effect/2.0/default/VisualizerEffect.cpp create mode 100644 audio/effect/2.0/default/VisualizerEffect.h create mode 100644 audio/effect/all-versions/default/Android.bp rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/AcousticEchoCancelerEffect.h (87%) rename audio/effect/all-versions/{AcousticEchoCancelerEffect.cpp => default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h} (95%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/AudioBufferManager.h (79%) rename audio/effect/all-versions/{AudioBufferManager.cpp => default/include/effect/all-versions/default/AudioBufferManager.impl.h} (96%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/AutomaticGainControlEffect.h (89%) rename audio/effect/all-versions/{AutomaticGainControlEffect.cpp => default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h} (96%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/BassBoostEffect.h (88%) rename audio/effect/all-versions/{BassBoostEffect.cpp => default/include/effect/all-versions/default/BassBoostEffect.impl.h} (95%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/Conversions.h (76%) rename audio/effect/all-versions/{Conversions.cpp => default/include/effect/all-versions/default/Conversions.impl.h} (91%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/DownmixEffect.h (88%) rename audio/effect/all-versions/{DownmixEffect.cpp => default/include/effect/all-versions/default/DownmixEffect.impl.h} (95%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/Effect.h (90%) rename audio/effect/all-versions/{Effect.cpp => default/include/effect/all-versions/default/Effect.impl.h} (98%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/EffectsFactory.h (72%) rename audio/effect/all-versions/{EffectsFactory.cpp => default/include/effect/all-versions/default/EffectsFactory.impl.h} (90%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/EnvironmentalReverbEffect.h (83%) rename audio/effect/all-versions/{EnvironmentalReverbEffect.cpp => default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h} (97%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/EqualizerEffect.h (81%) rename audio/effect/all-versions/{EqualizerEffect.cpp => default/include/effect/all-versions/default/EqualizerEffect.impl.h} (97%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/LoudnessEnhancerEffect.h (77%) rename audio/effect/all-versions/{LoudnessEnhancerEffect.cpp => default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h} (95%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/NoiseSuppressionEffect.h (79%) rename audio/effect/all-versions/{NoiseSuppressionEffect.cpp => default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h} (96%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/PresetReverbEffect.h (77%) rename audio/effect/all-versions/{PresetReverbEffect.cpp => default/include/effect/all-versions/default/PresetReverbEffect.impl.h} (95%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/VirtualizerEffect.h (78%) rename audio/effect/all-versions/{VirtualizerEffect.cpp => default/include/effect/all-versions/default/VirtualizerEffect.impl.h} (96%) rename audio/effect/all-versions/{ => default/include/effect/all-versions/default}/VisualizerEffect.h (79%) rename audio/effect/all-versions/{VisualizerEffect.cpp => default/include/effect/all-versions/default/VisualizerEffect.impl.h} (96%) diff --git a/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp b/audio/effect/2.0/default/AcousticEchoCancelerEffect.cpp new file mode 100644 index 0000000000..cadc2f1b43 --- /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 +#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 0000000000..d36335c7b3 --- /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 + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 similarity index 91% rename from audio/effect/all-versions/Android.bp rename to audio/effect/2.0/default/Android.bp index f2b36d3492..db0098849c 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 0000000000..39918dd1c7 --- /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 +#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 0000000000..789fbd1c8f --- /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 + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..7e00a8065f --- /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 +#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 0000000000..ef440d2e40 --- /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 + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..df9e892d60 --- /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 +#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 0000000000..83179e28ef --- /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 + +#include + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..b59752c982 --- /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 +#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 0000000000..94c7f66ea6 --- /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 + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..1a51e13641 --- /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 +#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 0000000000..6dbbb32836 --- /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 + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..e234e520b8 --- /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 + +#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 +#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 0000000000..a4d194dab9 --- /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 + +#include "AudioBufferManager.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..a48a85f7c2 --- /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 +#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 0000000000..f1bfbcff4c --- /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 + +#include + +#include +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..017dd1f4cb --- /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 + +#include "EnvironmentalReverbEffect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..d93a53f42f --- /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 + +#include + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..d6e056c421 --- /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 +#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 0000000000..54cdd50e13 --- /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 + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..2dca0f4c39 --- /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 +#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 0000000000..992e238ef1 --- /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 + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..089e811e09 --- /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 +#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 0000000000..0eee4b51b2 --- /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 + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..0648f6a8eb --- /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 +#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 0000000000..1ea1626ffa --- /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 + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..63d3eb925f --- /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 +#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 0000000000..04f93c4c72 --- /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 + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..523552466d --- /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 +#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 0000000000..940f15de9b --- /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 + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V2_0 +#include +#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 0000000000..ed2a093050 --- /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 similarity index 87% rename from audio/effect/all-versions/AcousticEchoCancelerEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.h index b9833bd018..b63f2fb937 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 -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -86,7 +82,8 @@ struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect follow. + // Methods from + // ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAcousticEchoCancelerEffect follow. Return setEchoDelay(uint32_t echoDelayMs) override; Return 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 similarity index 95% rename from audio/effect/all-versions/AcousticEchoCancelerEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h index 9315e3e156..bee3607854 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 + #include #include -#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 AcousticEchoCancelerEffect::init() { return mEffect->init(); } @@ -162,7 +161,8 @@ Return 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 AcousticEchoCancelerEffect::setEchoDelay(uint32_t echoDelayMs) { return mEffect->setParam(AEC_PARAM_ECHO_DELAY, echoDelayMs); } @@ -172,7 +172,7 @@ Return 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 similarity index 79% rename from audio/effect/all-versions/AudioBufferManager.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.h index e19db126ad..34dea2d03b 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 #include -#include #include #include #include #include #include -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 { bool wrap(const AudioBuffer& buffer, sp* 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 { }; } // 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 similarity index 96% rename from audio/effect/all-versions/AudioBufferManager.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/AudioBufferManager.impl.h index 3d4d3d53af..71ccd2d520 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 + #include #include -#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 similarity index 89% rename from audio/effect/all-versions/AutomaticGainControlEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.h index 5536e148dd..941f45da3c 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 #include -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -88,7 +84,8 @@ struct AutomaticGainControlEffect : public IAutomaticGainControlEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect follow. + // Methods from + // ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAutomaticGainControlEffect follow. Return setTargetLevel(int16_t targetLevelMb) override; Return getTargetLevel(getTargetLevel_cb _hidl_cb) override; Return 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 similarity index 96% rename from audio/effect/all-versions/AutomaticGainControlEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h index 382a4bced7..af05d9b780 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 +#include -#include "AutomaticGainControlEffect.h" +#include 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 AutomaticGainControlEffect::init() { return mEffect->init(); } @@ -175,7 +174,8 @@ Return 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 AutomaticGainControlEffect::setTargetLevel(int16_t targetLevelMb) { return mEffect->setParam(AGC_PARAM_TARGET_LEVEL, targetLevelMb); } @@ -217,7 +217,7 @@ Return 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 similarity index 88% rename from audio/effect/all-versions/BassBoostEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.h index 278f37b9cb..00926217b5 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 -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -86,7 +82,7 @@ struct BassBoostEffect : public IBassBoostEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IBassBoostEffect follow. Return isStrengthSupported(isStrengthSupported_cb _hidl_cb) override; Return setStrength(uint16_t strength) override; Return 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 similarity index 95% rename from audio/effect/all-versions/BassBoostEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.impl.h index 3366fcc43a..1fc8d1b428 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 + #include #include -#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 BassBoostEffect::init() { return mEffect->init(); } @@ -158,7 +157,7 @@ Return 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 BassBoostEffect::isStrengthSupported(isStrengthSupported_cb _hidl_cb) { return mEffect->getIntegerParam(BASSBOOST_PARAM_STRENGTH_SUPPORTED, _hidl_cb); } @@ -172,7 +171,7 @@ Return 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 similarity index 76% rename from audio/effect/all-versions/Conversions.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.h index e13f36b61d..3f9317f763 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 #include -#include #include 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 similarity index 91% rename from audio/effect/all-versions/Conversions.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/Conversions.impl.h index 0b485d5675..44adf4b2ce 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 + #include #include -#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 similarity index 88% rename from audio/effect/all-versions/DownmixEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.h index edcc95a801..e461ca80b7 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 -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -86,7 +82,7 @@ struct DownmixEffect : public IDownmixEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IDownmixEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IDownmixEffect follow. Return setType(IDownmixEffect::Type preset) override; Return 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 similarity index 95% rename from audio/effect/all-versions/DownmixEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.impl.h index e45f996a02..98710f89dc 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 + #include #include -#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 DownmixEffect::init() { return mEffect->init(); } @@ -158,7 +157,7 @@ Return 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 DownmixEffect::setType(IDownmixEffect::Type preset) { return mEffect->setParam(DOWNMIX_PARAM_TYPE, static_cast(preset)); } @@ -171,7 +170,7 @@ Return 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 similarity index 90% rename from audio/effect/all-versions/Effect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/Effect.h index 8f95e5edcb..81b0b24425 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 #include #include #include -#include #include #include #include @@ -30,28 +28,26 @@ #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& 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 similarity index 98% rename from audio/effect/all-versions/Effect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/Effect.impl.h index 487bbe6a5e..d3761464be 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 + #include -#define LOG_TAG "EffectHAL" #define ATRACE_TAG ATRACE_TAG_AUDIO #include #include #include -#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 Effect::init() { return sendCommandReturningStatus(EFFECT_CMD_INIT, "INIT"); } @@ -707,7 +704,7 @@ Return 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 similarity index 72% rename from audio/effect/all-versions/EffectsFactory.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.h index 34bdb403d3..e586abb807 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 +#include #include -#include #include #include @@ -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 getAllDescriptors(getAllDescriptors_cb _hidl_cb) override; Return getDescriptor(const Uuid& uid, getDescriptor_cb _hidl_cb) override; Return 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 similarity index 90% rename from audio/effect/all-versions/EffectsFactory.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.impl.h index 67fd22a794..b2a36a96f8 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 + #include #include #include @@ -29,30 +30,13 @@ #include #include -#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 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 EffectsFactory::getAllDescriptors(getAllDescriptors_cb _hidl_cb) { Result retval(Result::OK); hidl_vec 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 similarity index 83% rename from audio/effect/all-versions/EnvironmentalReverbEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.h index a0ae54631b..8351e5517a 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 #include -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -98,7 +94,8 @@ struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect follow. + // Methods from + // ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEnvironmentalReverbEffect follow. Return setBypass(bool bypass) override; Return getBypass(getBypass_cb _hidl_cb) override; Return 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 similarity index 97% rename from audio/effect/all-versions/EnvironmentalReverbEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h index a10ad0eceb..9090b8ab78 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 +#include -#include "EnvironmentalReverbEffect.h" +#include 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 EnvironmentalReverbEffect::init() { return mEffect->init(); } @@ -189,7 +188,8 @@ Return 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 EnvironmentalReverbEffect::setBypass(bool bypass) { return mEffect->setParam(REVERB_PARAM_BYPASS, bypass); } @@ -295,7 +295,7 @@ Return 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 similarity index 81% rename from audio/effect/all-versions/EqualizerEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.h index 4f73f8eb4c..c2b8ef8b52 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 #include #include -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -100,7 +96,7 @@ struct EqualizerEffect : public IEqualizerEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IEqualizerEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEqualizerEffect follow. Return getNumBands(getNumBands_cb _hidl_cb) override; Return getLevelRange(getLevelRange_cb _hidl_cb) override; Return 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 similarity index 97% rename from audio/effect/all-versions/EqualizerEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.impl.h index d587c93e53..78485e48fd 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 + #include -#define LOG_TAG "Equalizer_HAL" #include -#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 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 EqualizerEffect::init() { return mEffect->init(); } @@ -181,7 +180,7 @@ Return 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 EqualizerEffect::getNumBands(getNumBands_cb _hidl_cb) { return mEffect->getIntegerParam(EQ_PARAM_NUM_BANDS, _hidl_cb); } @@ -284,7 +283,7 @@ Return 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 similarity index 77% rename from audio/effect/all-versions/LoudnessEnhancerEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.h index 73d45e3326..e4f1bd5e93 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 -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -96,7 +92,8 @@ struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::ILoudnessEnhancerEffect + // follow. Return setTargetGain(int32_t targetGainMb) override; Return 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 similarity index 95% rename from audio/effect/all-versions/LoudnessEnhancerEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h index 7c25579d17..3f4f379a27 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 + #include -#define LOG_TAG "LoudnessEnhancer_HAL" #include #include -#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 LoudnessEnhancerEffect::init() { return mEffect->init(); } @@ -161,7 +160,8 @@ Return 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 LoudnessEnhancerEffect::setTargetGain(int32_t targetGainMb) { return mEffect->setParam(LOUDNESS_ENHANCER_DEFAULT_TARGET_GAIN_MB, targetGainMb); } @@ -180,7 +180,7 @@ Return 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 similarity index 79% rename from audio/effect/all-versions/NoiseSuppressionEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.h index d8334416f1..7b64ba015a 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 #include -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -98,7 +94,8 @@ struct NoiseSuppressionEffect : public INoiseSuppressionEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::INoiseSuppressionEffect + // follow. Return setSuppressionLevel(INoiseSuppressionEffect::Level level) override; Return getSuppressionLevel(getSuppressionLevel_cb _hidl_cb) override; Return 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 similarity index 96% rename from audio/effect/all-versions/NoiseSuppressionEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h index fe3042187e..e5fc454a44 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 +#include -#include "NoiseSuppressionEffect.h" +#include 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(properties.type); } -// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. +// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow. Return NoiseSuppressionEffect::init() { return mEffect->init(); } @@ -170,7 +169,8 @@ Return 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 NoiseSuppressionEffect::setSuppressionLevel(INoiseSuppressionEffect::Level level) { return mEffect->setParam(NS_PARAM_LEVEL, static_cast(level)); } @@ -210,7 +210,7 @@ Return 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 similarity index 77% rename from audio/effect/all-versions/PresetReverbEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.h index fc836513a8..3114acd8d7 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 -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -96,7 +92,8 @@ struct PresetReverbEffect : public IPresetReverbEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IPresetReverbEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IPresetReverbEffect + // follow. Return setPreset(IPresetReverbEffect::Preset preset) override; Return 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 similarity index 95% rename from audio/effect/all-versions/PresetReverbEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.impl.h index 4f1ccd3f06..32198d50e5 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 + #include #include -#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 PresetReverbEffect::init() { return mEffect->init(); } @@ -158,7 +157,7 @@ Return 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 PresetReverbEffect::setPreset(IPresetReverbEffect::Preset preset) { return mEffect->setParam(REVERB_PARAM_PRESET, static_cast(preset)); } @@ -171,7 +170,7 @@ Return 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 similarity index 78% rename from audio/effect/all-versions/VirtualizerEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.h index 911cecae6b..371589488f 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 -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -97,7 +93,8 @@ struct VirtualizerEffect : public IVirtualizerEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IVirtualizerEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVirtualizerEffect + // follow. Return isStrengthSupported() override; Return setStrength(uint16_t strength) override; Return 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 similarity index 96% rename from audio/effect/all-versions/VirtualizerEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.impl.h index bb96855bef..6fb8005590 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 + #include -#define LOG_TAG "Virtualizer_HAL" #include #include -#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 VirtualizerEffect::init() { return mEffect->init(); } @@ -170,7 +169,7 @@ Return 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 VirtualizerEffect::isStrengthSupported() { bool halSupported = false; mEffect->getParam(VIRTUALIZER_PARAM_STRENGTH_SUPPORTED, halSupported); @@ -222,7 +221,7 @@ Return 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 similarity index 79% rename from audio/effect/all-versions/VisualizerEffect.h rename to audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.h index 58a3dbfd49..80502210cf 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 -#include #include #include -#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 init() override; Return setConfig( const EffectConfig& config, const sp& inputBufferProvider, @@ -96,7 +92,7 @@ struct VisualizerEffect : public IVisualizerEffect { const hidl_vec& configData) override; Return close() override; - // Methods from ::android::hardware::audio::effect::V2_0::IVisualizerEffect follow. + // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVisualizerEffect follow. Return setCaptureSize(uint16_t captureSize) override; Return getCaptureSize(getCaptureSize_cb _hidl_cb) override; Return 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 similarity index 96% rename from audio/effect/all-versions/VisualizerEffect.cpp rename to audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.impl.h index bac3a0312a..035145368b 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 + #include #include -#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 VisualizerEffect::init() { return mEffect->init(); } @@ -159,7 +158,7 @@ Return 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 VisualizerEffect::setCaptureSize(uint16_t captureSize) { Result retval = mEffect->setParam(VISUALIZER_PARAM_CAPTURE_SIZE, captureSize); if (retval == Result::OK) { @@ -246,7 +245,7 @@ Return VisualizerEffect::measure(measure_cb _hidl_cb) { } } // namespace implementation -} // namespace V2_0 +} // namespace AUDIO_HAL_VERSION } // namespace effect } // namespace audio } // namespace hardware