Audio V4: Make effect default wrapper device independent

What was done in this patch:
 # move headers in all-versions/default folder for qualified inclusion
mkdir -p audio/effect/all-versions/include/effect/all-versions/default/
mv audio/effect/all-versions/*[hp] $_
 # Go in the all-versions header folder
cd $_
 # Use a macro for the version
sed -i '/^#/!s/V2_0/AUDIO_HAL_VERSION/g' *
 #Remove 2.0 includes
sed -i "/include.*2.0/d" *
 # Add include guard to make sure AUDIO_HAL_VERSION is set
sed -i '/limitations under the License/!b;N;a\n#include <common/all-versions/IncludeGuard.h>' *
 # Remove guard include macro
sed -i '/^#.*[H_]$/d' *
 # Remove LOG_TAG
sed -i '/LOG_TAG/d' *
 # Remove local include (include "XXX")
sed -i '/include.*"/{N;/\n$/d;D}' *
 # Replace implementation with inclusion
cd audio/effect/2.0/
git checkout HEAD^^
ls *h *cpp| sed -r 's/.*h$/\0 \0/;s/(.*)cpp/\1impl.h \0/' |xargs -L1 printf '1h;2,$H;$!d;g;s$namespace.*}[^\\n]*$#define AUDIO_HAL_VERSION V2_0\\\n#include <effect/all-versions/default/%s>\\\n#undef AUDIO_HAL_VERSION$\000%s\000'|xargs -0 -n2 sed -i
+ manual update of Android.bp and removal of duplicate include

Bug: 38184704
Test: compile
Change-Id: If99871516f3069fcb9e699ab670a665d7d507e7d
This commit is contained in:
Kevin Rocard
2017-12-20 11:07:12 -08:00
parent 1bd2a336bc
commit 62588b69f6
62 changed files with 1106 additions and 388 deletions

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "AEC_Effect_HAL"
#include "AcousticEchoCancelerEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/AcousticEchoCancelerEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
#include <android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/AcousticEchoCancelerEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H

View File

@@ -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",

View File

@@ -0,0 +1,21 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "AudioBufferManager.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/AudioBufferManager.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,26 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_
#include <android/hardware/audio/effect/2.0/types.h>
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/AudioBufferManager.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUDIO_BUFFER_MANAGER_H_

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "AGC_Effect_HAL"
#include "AutomaticGainControlEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/AutomaticGainControlEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H
#include <android/hardware/audio/effect/2.0/IAutomaticGainControlEffect.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/AutomaticGainControlEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "BassBoost_HAL"
#include "BassBoostEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/BassBoostEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,30 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
#include <android/hardware/audio/effect/2.0/IBassBoostEffect.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/BassBoostEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Conversions.h"
#include "HidlUtils.h"
using ::android::hardware::audio::common::V2_0::HidlUtils;
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/Conversions.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,26 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_CONVERSIONS_H_
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_CONVERSIONS_H_
#include <android/hardware/audio/effect/2.0/types.h>
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/Conversions.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_CONVERSIONS_H_

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "Downmix_HAL"
#include "DownmixEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/DownmixEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H
#include <android/hardware/audio/effect/2.0/IDownmixEffect.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/DownmixEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <memory.h>
#define LOG_TAG "EffectHAL"
#define ATRACE_TAG ATRACE_TAG_AUDIO
#include "Conversions.h"
#include "Effect.h"
#include "common/all-versions/default/EffectMap.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/Effect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
#include <android/hardware/audio/effect/2.0/IEffect.h>
#include "AudioBufferManager.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/Effect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H

View File

@@ -0,0 +1,39 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "EffectFactoryHAL"
#include "EffectsFactory.h"
#include "AcousticEchoCancelerEffect.h"
#include "AutomaticGainControlEffect.h"
#include "BassBoostEffect.h"
#include "Conversions.h"
#include "DownmixEffect.h"
#include "Effect.h"
#include "EnvironmentalReverbEffect.h"
#include "EqualizerEffect.h"
#include "HidlUtils.h"
#include "LoudnessEnhancerEffect.h"
#include "NoiseSuppressionEffect.h"
#include "PresetReverbEffect.h"
#include "VirtualizerEffect.h"
#include "VisualizerEffect.h"
#include "common/all-versions/default/EffectMap.h"
using ::android::hardware::audio::common::V2_0::HidlUtils;
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/EffectsFactory.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H
#include <system/audio_effect.h>
#include <android/hardware/audio/effect/2.0/IEffectsFactory.h>
#include <hidl/MQDescriptor.h>
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/EffectsFactory.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "EnvReverb_HAL"
#include <android/log.h>
#include "EnvironmentalReverbEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/EnvironmentalReverbEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,30 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H
#include <system/audio_effects/effect_environmentalreverb.h>
#include <android/hardware/audio/effect/2.0/IEnvironmentalReverbEffect.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/EnvironmentalReverbEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "Equalizer_HAL"
#include "EqualizerEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/EqualizerEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H
#include <android/hardware/audio/effect/2.0/IEqualizerEffect.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/EqualizerEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "LoudnessEnhancer_HAL"
#include "LoudnessEnhancerEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/LoudnessEnhancerEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H
#include <android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/LoudnessEnhancerEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "NS_Effect_HAL"
#include "NoiseSuppressionEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/NoiseSuppressionEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H
#include <android/hardware/audio/effect/2.0/INoiseSuppressionEffect.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/NoiseSuppressionEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "PresetReverb_HAL"
#include "PresetReverbEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/PresetReverbEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H
#include <android/hardware/audio/effect/2.0/IPresetReverbEffect.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/PresetReverbEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "Virtualizer_HAL"
#include "VirtualizerEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/VirtualizerEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H
#include <android/hardware/audio/effect/2.0/IVirtualizerEffect.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/VirtualizerEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H

View File

@@ -0,0 +1,23 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "Visualizer_HAL"
#include "VisualizerEffect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/VisualizerEffect.impl.h>
#undef AUDIO_HAL_VERSION

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H
#include <android/hardware/audio/effect/2.0/IVisualizerEffect.h>
#include "Effect.h"
#define AUDIO_HAL_VERSION V2_0
#include <effect/all-versions/default/VisualizerEffect.h>
#undef AUDIO_HAL_VERSION
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H

View File

@@ -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",
],
}

View File

@@ -14,25 +14,21 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <android/hardware/audio/effect/2.0/IAcousticEchoCancelerEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAcousticEchoCancelerEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -42,7 +38,7 @@ using ::android::sp;
struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect {
explicit AcousticEchoCancelerEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -86,7 +82,8 @@ struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect follow.
// Methods from
// ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAcousticEchoCancelerEffect follow.
Return<Result> setEchoDelay(uint32_t echoDelayMs) override;
Return<void> getEchoDelay(getEchoDelay_cb _hidl_cb) override;
@@ -97,10 +94,8 @@ struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ACOUSTICECHOCANCELEREFFECT_H

View File

@@ -14,17 +14,16 @@
* limitations under the License.
*/
#define LOG_TAG "AEC_Effect_HAL"
#include <common/all-versions/IncludeGuard.h>
#include <android/log.h>
#include <system/audio_effects/effect_aec.h>
#include "AcousticEchoCancelerEffect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
AcousticEchoCancelerEffect::AcousticEchoCancelerEffect(effect_handle_t handle)
@@ -32,7 +31,7 @@ AcousticEchoCancelerEffect::AcousticEchoCancelerEffect(effect_handle_t handle)
AcousticEchoCancelerEffect::~AcousticEchoCancelerEffect() {}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> AcousticEchoCancelerEffect::init() {
return mEffect->init();
}
@@ -162,7 +161,8 @@ Return<Result> AcousticEchoCancelerEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::IAcousticEchoCancelerEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAcousticEchoCancelerEffect
// follow.
Return<Result> AcousticEchoCancelerEffect::setEchoDelay(uint32_t echoDelayMs) {
return mEffect->setParam(AEC_PARAM_ECHO_DELAY, echoDelayMs);
}
@@ -172,7 +172,7 @@ Return<void> AcousticEchoCancelerEffect::getEchoDelay(getEchoDelay_cb _hidl_cb)
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,26 +14,24 @@
* limitations under the License.
*/
#ifndef android_hardware_audio_effect_V2_0_AudioBufferManager_H_
#define android_hardware_audio_effect_V2_0_AudioBufferManager_H_
#include <common/all-versions/IncludeGuard.h>
#include <mutex>
#include <android/hardware/audio/effect/2.0/types.h>
#include <android/hidl/memory/1.0/IMemory.h>
#include <system/audio_effect.h>
#include <utils/KeyedVector.h>
#include <utils/RefBase.h>
#include <utils/Singleton.h>
using ::android::hardware::audio::effect::V2_0::AudioBuffer;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
using ::android::hidl::memory::V1_0::IMemory;
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
class AudioBufferWrapper : public RefBase {
@@ -53,13 +51,13 @@ class AudioBufferWrapper : public RefBase {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
using ::android::hardware::audio::effect::V2_0::implementation::AudioBufferWrapper;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::implementation::AudioBufferWrapper;
namespace android {
@@ -69,7 +67,7 @@ class AudioBufferManager : public Singleton<AudioBufferManager> {
bool wrap(const AudioBuffer& buffer, sp<AudioBufferWrapper>* wrapper);
private:
friend class hardware::audio::effect::V2_0::implementation::AudioBufferWrapper;
friend class hardware::audio::effect::AUDIO_HAL_VERSION::implementation::AudioBufferWrapper;
// Called by AudioBufferWrapper.
void removeEntry(uint64_t id);
@@ -79,5 +77,3 @@ class AudioBufferManager : public Singleton<AudioBufferManager> {
};
} // namespace android
#endif // android_hardware_audio_effect_V2_0_AudioBufferManager_H_

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
#include <common/all-versions/IncludeGuard.h>
#include <atomic>
#include <hidlmemory/mapping.h>
#include "AudioBufferManager.h"
namespace android {
ANDROID_SINGLETON_STATIC_INSTANCE(AudioBufferManager);
@@ -53,7 +53,7 @@ void AudioBufferManager::removeEntry(uint64_t id) {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
AudioBufferWrapper::AudioBufferWrapper(const AudioBuffer& buffer)
@@ -83,7 +83,7 @@ bool AudioBufferWrapper::init() {
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,27 +14,23 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <system/audio_effects/effect_agc.h>
#include <android/hardware/audio/effect/2.0/IAutomaticGainControlEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAutomaticGainControlEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -44,7 +40,7 @@ using ::android::sp;
struct AutomaticGainControlEffect : public IAutomaticGainControlEffect {
explicit AutomaticGainControlEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -88,7 +84,8 @@ struct AutomaticGainControlEffect : public IAutomaticGainControlEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect follow.
// Methods from
// ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAutomaticGainControlEffect follow.
Return<Result> setTargetLevel(int16_t targetLevelMb) override;
Return<void> getTargetLevel(getTargetLevel_cb _hidl_cb) override;
Return<Result> setCompGain(int16_t compGainMb) override;
@@ -111,10 +108,8 @@ struct AutomaticGainControlEffect : public IAutomaticGainControlEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_AUTOMATICGAINCONTROLEFFECT_H

View File

@@ -14,16 +14,15 @@
* limitations under the License.
*/
#define LOG_TAG "AGC_Effect_HAL"
#include <android/log.h>
#include <common/all-versions/IncludeGuard.h>
#include "AutomaticGainControlEffect.h"
#include <android/log.h>
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
AutomaticGainControlEffect::AutomaticGainControlEffect(effect_handle_t handle)
@@ -45,7 +44,7 @@ void AutomaticGainControlEffect::propertiesToHal(
halProperties->limiterEnabled = properties.limiterEnabled;
}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> AutomaticGainControlEffect::init() {
return mEffect->init();
}
@@ -175,7 +174,8 @@ Return<Result> AutomaticGainControlEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::IAutomaticGainControlEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IAutomaticGainControlEffect
// follow.
Return<Result> AutomaticGainControlEffect::setTargetLevel(int16_t targetLevelMb) {
return mEffect->setParam(AGC_PARAM_TARGET_LEVEL, targetLevelMb);
}
@@ -217,7 +217,7 @@ Return<void> AutomaticGainControlEffect::getAllProperties(getAllProperties_cb _h
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,25 +14,21 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <android/hardware/audio/effect/2.0/IBassBoostEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::effect::V2_0::IBassBoostEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IBassBoostEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -42,7 +38,7 @@ using ::android::sp;
struct BassBoostEffect : public IBassBoostEffect {
explicit BassBoostEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -86,7 +82,7 @@ struct BassBoostEffect : public IBassBoostEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IBassBoostEffect follow.
Return<void> isStrengthSupported(isStrengthSupported_cb _hidl_cb) override;
Return<Result> setStrength(uint16_t strength) override;
Return<void> getStrength(getStrength_cb _hidl_cb) override;
@@ -98,10 +94,8 @@ struct BassBoostEffect : public IBassBoostEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_BASSBOOSTEFFECT_H

View File

@@ -14,24 +14,23 @@
* limitations under the License.
*/
#define LOG_TAG "BassBoost_HAL"
#include <common/all-versions/IncludeGuard.h>
#include <android/log.h>
#include <system/audio_effects/effect_bassboost.h>
#include "BassBoostEffect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
BassBoostEffect::BassBoostEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {}
BassBoostEffect::~BassBoostEffect() {}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> BassBoostEffect::init() {
return mEffect->init();
}
@@ -158,7 +157,7 @@ Return<Result> BassBoostEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IBassBoostEffect follow.
Return<void> BassBoostEffect::isStrengthSupported(isStrengthSupported_cb _hidl_cb) {
return mEffect->getIntegerParam(BASSBOOST_PARAM_STRENGTH_SUPPORTED, _hidl_cb);
}
@@ -172,7 +171,7 @@ Return<void> BassBoostEffect::getStrength(getStrength_cb _hidl_cb) {
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,32 +14,28 @@
* limitations under the License.
*/
#ifndef android_hardware_audio_effect_V2_0_Conversions_H_
#define android_hardware_audio_effect_V2_0_Conversions_H_
#include <common/all-versions/IncludeGuard.h>
#include <string>
#include <android/hardware/audio/effect/2.0/types.h>
#include <system/audio_effect.h>
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
void effectDescriptorFromHal(const effect_descriptor_t& halDescriptor,
EffectDescriptor* descriptor);
std::string uuidToString(const effect_uuid_t& halUuid);
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // android_hardware_audio_effect_V2_0_Conversions_H_

View File

@@ -14,19 +14,18 @@
* limitations under the License.
*/
#include <common/all-versions/IncludeGuard.h>
#include <memory.h>
#include <stdio.h>
#include "Conversions.h"
#include "HidlUtils.h"
using ::android::hardware::audio::common::V2_0::HidlUtils;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::HidlUtils;
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
void effectDescriptorFromHal(const effect_descriptor_t& halDescriptor,
@@ -50,7 +49,7 @@ std::string uuidToString(const effect_uuid_t& halUuid) {
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,25 +14,21 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <android/hardware/audio/effect/2.0/IDownmixEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::effect::V2_0::IDownmixEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IDownmixEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -42,7 +38,7 @@ using ::android::sp;
struct DownmixEffect : public IDownmixEffect {
explicit DownmixEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -86,7 +82,7 @@ struct DownmixEffect : public IDownmixEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IDownmixEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IDownmixEffect follow.
Return<Result> setType(IDownmixEffect::Type preset) override;
Return<void> getType(getType_cb _hidl_cb) override;
@@ -97,10 +93,8 @@ struct DownmixEffect : public IDownmixEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H

View File

@@ -14,24 +14,23 @@
* limitations under the License.
*/
#define LOG_TAG "Downmix_HAL"
#include <common/all-versions/IncludeGuard.h>
#include <android/log.h>
#include <system/audio_effects/effect_downmix.h>
#include "DownmixEffect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
DownmixEffect::DownmixEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {}
DownmixEffect::~DownmixEffect() {}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> DownmixEffect::init() {
return mEffect->init();
}
@@ -158,7 +157,7 @@ Return<Result> DownmixEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::IDownmixEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IDownmixEffect follow.
Return<Result> DownmixEffect::setType(IDownmixEffect::Type preset) {
return mEffect->setParam(DOWNMIX_PARAM_TYPE, static_cast<downmix_type_t>(preset));
}
@@ -171,7 +170,7 @@ Return<void> DownmixEffect::getType(getType_cb _hidl_cb) {
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,14 +14,12 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <atomic>
#include <memory>
#include <vector>
#include <android/hardware/audio/effect/2.0/IEffect.h>
#include <fmq/EventFlag.h>
#include <fmq/MessageQueue.h>
#include <hidl/MQDescriptor.h>
@@ -30,28 +28,26 @@
#include <hardware/audio_effect.h>
#include "AudioBufferManager.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::common::V2_0::AudioDevice;
using ::android::hardware::audio::common::V2_0::AudioMode;
using ::android::hardware::audio::common::V2_0::AudioSource;
using ::android::hardware::audio::common::V2_0::Uuid;
using ::android::hardware::audio::effect::V2_0::AudioBuffer;
using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::V2_0::EffectConfig;
using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
using ::android::hardware::audio::effect::V2_0::EffectFeature;
using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter;
using ::android::hardware::audio::effect::V2_0::IEffect;
using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::Uuid;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectFeature;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -65,7 +61,7 @@ struct Effect : public IEffect {
explicit Effect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -235,10 +231,8 @@ struct Effect : public IEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECT_H

View File

@@ -14,29 +14,26 @@
* limitations under the License.
*/
#include <common/all-versions/IncludeGuard.h>
#include <memory.h>
#define LOG_TAG "EffectHAL"
#define ATRACE_TAG ATRACE_TAG_AUDIO
#include <android/log.h>
#include <media/EffectsFactoryApi.h>
#include <utils/Trace.h>
#include "Conversions.h"
#include "Effect.h"
#include "common/all-versions/default/EffectMap.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::common::V2_0::AudioChannelMask;
using ::android::hardware::audio::common::V2_0::AudioFormat;
using ::android::hardware::audio::effect::V2_0::MessageQueueFlagBits;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioChannelMask;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioFormat;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::MessageQueueFlagBits;
namespace {
@@ -479,7 +476,7 @@ Result Effect::setParameterImpl(uint32_t paramSize, const void* paramData, uint3
&halParamBuffer[0]);
}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> Effect::init() {
return sendCommandReturningStatus(EFFECT_CMD_INIT, "INIT");
}
@@ -707,7 +704,7 @@ Return<Result> Effect::close() {
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,12 +14,11 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H
#include <common/all-versions/IncludeGuard.h>
#include <hardware/audio_effect.h>
#include <system/audio_effect.h>
#include <android/hardware/audio/effect/2.0/IEffectsFactory.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
@@ -27,14 +26,14 @@ namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::common::V2_0::Uuid;
using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
using ::android::hardware::audio::effect::V2_0::IEffect;
using ::android::hardware::audio::effect::V2_0::IEffectsFactory;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::Uuid;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -42,7 +41,7 @@ using ::android::hardware::hidl_string;
using ::android::sp;
struct EffectsFactory : public IEffectsFactory {
// Methods from ::android::hardware::audio::effect::V2_0::IEffectsFactory follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory follow.
Return<void> getAllDescriptors(getAllDescriptors_cb _hidl_cb) override;
Return<void> getDescriptor(const Uuid& uid, getDescriptor_cb _hidl_cb) override;
Return<void> createEffect(const Uuid& uid, int32_t session, int32_t ioHandle,
@@ -57,10 +56,8 @@ struct EffectsFactory : public IEffectsFactory {
extern "C" IEffectsFactory* HIDL_FETCH_IEffectsFactory(const char* name);
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EFFECTSFACTORY_H

View File

@@ -14,7 +14,8 @@
* limitations under the License.
*/
#define LOG_TAG "EffectFactoryHAL"
#include <common/all-versions/IncludeGuard.h>
#include <android/log.h>
#include <media/EffectsFactoryApi.h>
#include <system/audio_effects/effect_aec.h>
@@ -29,30 +30,13 @@
#include <system/audio_effects/effect_virtualizer.h>
#include <system/audio_effects/effect_visualizer.h>
#include "AcousticEchoCancelerEffect.h"
#include "AutomaticGainControlEffect.h"
#include "BassBoostEffect.h"
#include "Conversions.h"
#include "DownmixEffect.h"
#include "Effect.h"
#include "EffectsFactory.h"
#include "EnvironmentalReverbEffect.h"
#include "EqualizerEffect.h"
#include "HidlUtils.h"
#include "LoudnessEnhancerEffect.h"
#include "NoiseSuppressionEffect.h"
#include "PresetReverbEffect.h"
#include "VirtualizerEffect.h"
#include "VisualizerEffect.h"
#include "common/all-versions/default/EffectMap.h"
using ::android::hardware::audio::common::V2_0::HidlUtils;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::HidlUtils;
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
// static
@@ -85,7 +69,7 @@ sp<IEffect> EffectsFactory::dispatchEffectInstanceCreation(const effect_descript
return new Effect(handle);
}
// Methods from ::android::hardware::audio::effect::V2_0::IEffectsFactory follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory follow.
Return<void> EffectsFactory::getAllDescriptors(getAllDescriptors_cb _hidl_cb) {
Result retval(Result::OK);
hidl_vec<EffectDescriptor> result;
@@ -199,7 +183,7 @@ IEffectsFactory* HIDL_FETCH_IEffectsFactory(const char* /* name */) {
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,37 +14,33 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <system/audio_effects/effect_environmentalreverb.h>
#include <android/hardware/audio/effect/2.0/IEnvironmentalReverbEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::common::V2_0::AudioDevice;
using ::android::hardware::audio::common::V2_0::AudioMode;
using ::android::hardware::audio::common::V2_0::AudioSource;
using ::android::hardware::audio::effect::V2_0::AudioBuffer;
using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::V2_0::EffectConfig;
using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter;
using ::android::hardware::audio::effect::V2_0::IEffect;
using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEnvironmentalReverbEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -54,7 +50,7 @@ using ::android::sp;
struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect {
explicit EnvironmentalReverbEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -98,7 +94,8 @@ struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect follow.
// Methods from
// ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEnvironmentalReverbEffect follow.
Return<Result> setBypass(bool bypass) override;
Return<void> getBypass(getBypass_cb _hidl_cb) override;
Return<Result> setRoomLevel(int16_t roomLevel) override;
@@ -137,10 +134,8 @@ struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_ENVIRONMENTALREVERBEFFECT_H

View File

@@ -14,16 +14,15 @@
* limitations under the License.
*/
#define LOG_TAG "EnvReverb_HAL"
#include <android/log.h>
#include <common/all-versions/IncludeGuard.h>
#include "EnvironmentalReverbEffect.h"
#include <android/log.h>
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
EnvironmentalReverbEffect::EnvironmentalReverbEffect(effect_handle_t handle)
@@ -59,7 +58,7 @@ void EnvironmentalReverbEffect::propertiesToHal(
halProperties->density = properties.density;
}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> EnvironmentalReverbEffect::init() {
return mEffect->init();
}
@@ -189,7 +188,8 @@ Return<Result> EnvironmentalReverbEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::IEnvironmentalReverbEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEnvironmentalReverbEffect
// follow.
Return<Result> EnvironmentalReverbEffect::setBypass(bool bypass) {
return mEffect->setParam(REVERB_PARAM_BYPASS, bypass);
}
@@ -295,7 +295,7 @@ Return<void> EnvironmentalReverbEffect::getAllProperties(getAllProperties_cb _hi
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,39 +14,35 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <vector>
#include <system/audio_effects/effect_equalizer.h>
#include <android/hardware/audio/effect/2.0/IEqualizerEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::common::V2_0::AudioDevice;
using ::android::hardware::audio::common::V2_0::AudioMode;
using ::android::hardware::audio::common::V2_0::AudioSource;
using ::android::hardware::audio::effect::V2_0::AudioBuffer;
using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::V2_0::EffectConfig;
using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter;
using ::android::hardware::audio::effect::V2_0::IEffect;
using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::V2_0::IEqualizerEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEqualizerEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -56,7 +52,7 @@ using ::android::sp;
struct EqualizerEffect : public IEqualizerEffect {
explicit EqualizerEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -100,7 +96,7 @@ struct EqualizerEffect : public IEqualizerEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IEqualizerEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEqualizerEffect follow.
Return<void> getNumBands(getNumBands_cb _hidl_cb) override;
Return<void> getLevelRange(getLevelRange_cb _hidl_cb) override;
Return<Result> setBandLevel(uint16_t band, int16_t level) override;
@@ -126,10 +122,8 @@ struct EqualizerEffect : public IEqualizerEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_EQUALIZEREFFECT_H

View File

@@ -14,18 +14,17 @@
* limitations under the License.
*/
#include <common/all-versions/IncludeGuard.h>
#include <memory.h>
#define LOG_TAG "Equalizer_HAL"
#include <android/log.h>
#include "EqualizerEffect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
EqualizerEffect::EqualizerEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {}
@@ -54,7 +53,7 @@ std::vector<uint8_t> EqualizerEffect::propertiesToHal(
return halBuffer;
}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> EqualizerEffect::init() {
return mEffect->init();
}
@@ -181,7 +180,7 @@ Return<Result> EqualizerEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::IEqualizerEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEqualizerEffect follow.
Return<void> EqualizerEffect::getNumBands(getNumBands_cb _hidl_cb) {
return mEffect->getIntegerParam(EQ_PARAM_NUM_BANDS, _hidl_cb);
}
@@ -284,7 +283,7 @@ Return<void> EqualizerEffect::getAllProperties(getAllProperties_cb _hidl_cb) {
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,35 +14,31 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <android/hardware/audio/effect/2.0/ILoudnessEnhancerEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::common::V2_0::AudioDevice;
using ::android::hardware::audio::common::V2_0::AudioMode;
using ::android::hardware::audio::common::V2_0::AudioSource;
using ::android::hardware::audio::effect::V2_0::AudioBuffer;
using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::V2_0::EffectConfig;
using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter;
using ::android::hardware::audio::effect::V2_0::IEffect;
using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::ILoudnessEnhancerEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -52,7 +48,7 @@ using ::android::sp;
struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect {
explicit LoudnessEnhancerEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -96,7 +92,8 @@ struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::ILoudnessEnhancerEffect
// follow.
Return<Result> setTargetGain(int32_t targetGainMb) override;
Return<void> getTargetGain(getTargetGain_cb _hidl_cb) override;
@@ -107,10 +104,8 @@ struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_LOUDNESSENHANCEREFFECT_H

View File

@@ -14,19 +14,18 @@
* limitations under the License.
*/
#include <common/all-versions/IncludeGuard.h>
#include <system/audio_effects/effect_loudnessenhancer.h>
#define LOG_TAG "LoudnessEnhancer_HAL"
#include <android/log.h>
#include <system/audio_effects/effect_aec.h>
#include "LoudnessEnhancerEffect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
LoudnessEnhancerEffect::LoudnessEnhancerEffect(effect_handle_t handle)
@@ -34,7 +33,7 @@ LoudnessEnhancerEffect::LoudnessEnhancerEffect(effect_handle_t handle)
LoudnessEnhancerEffect::~LoudnessEnhancerEffect() {}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> LoudnessEnhancerEffect::init() {
return mEffect->init();
}
@@ -161,7 +160,8 @@ Return<Result> LoudnessEnhancerEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::ILoudnessEnhancerEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::ILoudnessEnhancerEffect
// follow.
Return<Result> LoudnessEnhancerEffect::setTargetGain(int32_t targetGainMb) {
return mEffect->setParam(LOUDNESS_ENHANCER_DEFAULT_TARGET_GAIN_MB, targetGainMb);
}
@@ -180,7 +180,7 @@ Return<void> LoudnessEnhancerEffect::getTargetGain(getTargetGain_cb _hidl_cb) {
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,37 +14,33 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <system/audio_effects/effect_ns.h>
#include <android/hardware/audio/effect/2.0/INoiseSuppressionEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::common::V2_0::AudioDevice;
using ::android::hardware::audio::common::V2_0::AudioMode;
using ::android::hardware::audio::common::V2_0::AudioSource;
using ::android::hardware::audio::effect::V2_0::AudioBuffer;
using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::V2_0::EffectConfig;
using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter;
using ::android::hardware::audio::effect::V2_0::IEffect;
using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::INoiseSuppressionEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -54,7 +50,7 @@ using ::android::sp;
struct NoiseSuppressionEffect : public INoiseSuppressionEffect {
explicit NoiseSuppressionEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -98,7 +94,8 @@ struct NoiseSuppressionEffect : public INoiseSuppressionEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::INoiseSuppressionEffect
// follow.
Return<Result> setSuppressionLevel(INoiseSuppressionEffect::Level level) override;
Return<void> getSuppressionLevel(getSuppressionLevel_cb _hidl_cb) override;
Return<Result> setSuppressionType(INoiseSuppressionEffect::Type type) override;
@@ -119,10 +116,8 @@ struct NoiseSuppressionEffect : public INoiseSuppressionEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_NOISESUPPRESSIONEFFECT_H

View File

@@ -14,16 +14,15 @@
* limitations under the License.
*/
#define LOG_TAG "NS_Effect_HAL"
#include <android/log.h>
#include <common/all-versions/IncludeGuard.h>
#include "NoiseSuppressionEffect.h"
#include <android/log.h>
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
NoiseSuppressionEffect::NoiseSuppressionEffect(effect_handle_t handle)
@@ -43,7 +42,7 @@ void NoiseSuppressionEffect::propertiesToHal(
halProperties->type = static_cast<uint32_t>(properties.type);
}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> NoiseSuppressionEffect::init() {
return mEffect->init();
}
@@ -170,7 +169,8 @@ Return<Result> NoiseSuppressionEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::INoiseSuppressionEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::INoiseSuppressionEffect
// follow.
Return<Result> NoiseSuppressionEffect::setSuppressionLevel(INoiseSuppressionEffect::Level level) {
return mEffect->setParam(NS_PARAM_LEVEL, static_cast<int32_t>(level));
}
@@ -210,7 +210,7 @@ Return<void> NoiseSuppressionEffect::getAllProperties(getAllProperties_cb _hidl_
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,35 +14,31 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <android/hardware/audio/effect/2.0/IPresetReverbEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::common::V2_0::AudioDevice;
using ::android::hardware::audio::common::V2_0::AudioMode;
using ::android::hardware::audio::common::V2_0::AudioSource;
using ::android::hardware::audio::effect::V2_0::AudioBuffer;
using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::V2_0::EffectConfig;
using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter;
using ::android::hardware::audio::effect::V2_0::IEffect;
using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::V2_0::IPresetReverbEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IPresetReverbEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -52,7 +48,7 @@ using ::android::sp;
struct PresetReverbEffect : public IPresetReverbEffect {
explicit PresetReverbEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -96,7 +92,8 @@ struct PresetReverbEffect : public IPresetReverbEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IPresetReverbEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IPresetReverbEffect
// follow.
Return<Result> setPreset(IPresetReverbEffect::Preset preset) override;
Return<void> getPreset(getPreset_cb _hidl_cb) override;
@@ -107,10 +104,8 @@ struct PresetReverbEffect : public IPresetReverbEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_PRESETREVERBEFFECT_H

View File

@@ -14,24 +14,23 @@
* limitations under the License.
*/
#define LOG_TAG "PresetReverb_HAL"
#include <common/all-versions/IncludeGuard.h>
#include <android/log.h>
#include <system/audio_effects/effect_presetreverb.h>
#include "PresetReverbEffect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
PresetReverbEffect::PresetReverbEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {}
PresetReverbEffect::~PresetReverbEffect() {}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> PresetReverbEffect::init() {
return mEffect->init();
}
@@ -158,7 +157,7 @@ Return<Result> PresetReverbEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::IPresetReverbEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IPresetReverbEffect follow.
Return<Result> PresetReverbEffect::setPreset(IPresetReverbEffect::Preset preset) {
return mEffect->setParam(REVERB_PARAM_PRESET, static_cast<t_reverb_presets>(preset));
}
@@ -171,7 +170,7 @@ Return<void> PresetReverbEffect::getPreset(getPreset_cb _hidl_cb) {
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,36 +14,32 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <android/hardware/audio/effect/2.0/IVirtualizerEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::common::V2_0::AudioChannelMask;
using ::android::hardware::audio::common::V2_0::AudioDevice;
using ::android::hardware::audio::common::V2_0::AudioMode;
using ::android::hardware::audio::common::V2_0::AudioSource;
using ::android::hardware::audio::effect::V2_0::AudioBuffer;
using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::V2_0::EffectConfig;
using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter;
using ::android::hardware::audio::effect::V2_0::IEffect;
using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::V2_0::IVirtualizerEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioChannelMask;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVirtualizerEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -53,7 +49,7 @@ using ::android::sp;
struct VirtualizerEffect : public IVirtualizerEffect {
explicit VirtualizerEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -97,7 +93,8 @@ struct VirtualizerEffect : public IVirtualizerEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IVirtualizerEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVirtualizerEffect
// follow.
Return<bool> isStrengthSupported() override;
Return<Result> setStrength(uint16_t strength) override;
Return<void> getStrength(getStrength_cb _hidl_cb) override;
@@ -116,10 +113,8 @@ struct VirtualizerEffect : public IVirtualizerEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VIRTUALIZEREFFECT_H

View File

@@ -14,19 +14,18 @@
* limitations under the License.
*/
#include <common/all-versions/IncludeGuard.h>
#include <memory.h>
#define LOG_TAG "Virtualizer_HAL"
#include <android/log.h>
#include <system/audio_effects/effect_virtualizer.h>
#include "VirtualizerEffect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
VirtualizerEffect::VirtualizerEffect(effect_handle_t handle) : mEffect(new Effect(handle)) {}
@@ -43,7 +42,7 @@ void VirtualizerEffect::speakerAnglesFromHal(const int32_t* halAngles, uint32_t
}
}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> VirtualizerEffect::init() {
return mEffect->init();
}
@@ -170,7 +169,7 @@ Return<Result> VirtualizerEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::IVirtualizerEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVirtualizerEffect follow.
Return<bool> VirtualizerEffect::isStrengthSupported() {
bool halSupported = false;
mEffect->getParam(VIRTUALIZER_PARAM_STRENGTH_SUPPORTED, halSupported);
@@ -222,7 +221,7 @@ Return<void> VirtualizerEffect::getVirtualizationMode(getVirtualizationMode_cb _
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware

View File

@@ -14,35 +14,31 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H
#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H
#include <common/all-versions/IncludeGuard.h>
#include <android/hardware/audio/effect/2.0/IVisualizerEffect.h>
#include <hidl/Status.h>
#include <hidl/MQDescriptor.h>
#include "Effect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
using ::android::hardware::audio::common::V2_0::AudioDevice;
using ::android::hardware::audio::common::V2_0::AudioMode;
using ::android::hardware::audio::common::V2_0::AudioSource;
using ::android::hardware::audio::effect::V2_0::AudioBuffer;
using ::android::hardware::audio::effect::V2_0::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::V2_0::EffectConfig;
using ::android::hardware::audio::effect::V2_0::EffectDescriptor;
using ::android::hardware::audio::effect::V2_0::EffectOffloadParameter;
using ::android::hardware::audio::effect::V2_0::IEffect;
using ::android::hardware::audio::effect::V2_0::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::V2_0::IVisualizerEffect;
using ::android::hardware::audio::effect::V2_0::Result;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioDevice;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioMode;
using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioSource;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::AudioBuffer;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectAuxChannelsConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectConfig;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectOffloadParameter;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectBufferProviderCallback;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVisualizerEffect;
using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -52,7 +48,7 @@ using ::android::sp;
struct VisualizerEffect : public IVisualizerEffect {
explicit VisualizerEffect(effect_handle_t handle);
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> init() override;
Return<Result> setConfig(
const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider,
@@ -96,7 +92,7 @@ struct VisualizerEffect : public IVisualizerEffect {
const hidl_vec<uint8_t>& configData) override;
Return<Result> close() override;
// Methods from ::android::hardware::audio::effect::V2_0::IVisualizerEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVisualizerEffect follow.
Return<Result> setCaptureSize(uint16_t captureSize) override;
Return<void> getCaptureSize(getCaptureSize_cb _hidl_cb) override;
Return<Result> setScalingMode(IVisualizerEffect::ScalingMode scalingMode) override;
@@ -117,10 +113,8 @@ struct VisualizerEffect : public IVisualizerEffect {
};
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_VISUALIZEREFFECT_H

View File

@@ -14,17 +14,16 @@
* limitations under the License.
*/
#define LOG_TAG "Visualizer_HAL"
#include <common/all-versions/IncludeGuard.h>
#include <android/log.h>
#include <system/audio_effects/effect_visualizer.h>
#include "VisualizerEffect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace AUDIO_HAL_VERSION {
namespace implementation {
VisualizerEffect::VisualizerEffect(effect_handle_t handle)
@@ -32,7 +31,7 @@ VisualizerEffect::VisualizerEffect(effect_handle_t handle)
VisualizerEffect::~VisualizerEffect() {}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect follow.
Return<Result> VisualizerEffect::init() {
return mEffect->init();
}
@@ -159,7 +158,7 @@ Return<Result> VisualizerEffect::close() {
return mEffect->close();
}
// Methods from ::android::hardware::audio::effect::V2_0::IVisualizerEffect follow.
// Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IVisualizerEffect follow.
Return<Result> VisualizerEffect::setCaptureSize(uint16_t captureSize) {
Result retval = mEffect->setParam(VISUALIZER_PARAM_CAPTURE_SIZE, captureSize);
if (retval == Result::OK) {
@@ -246,7 +245,7 @@ Return<void> VisualizerEffect::measure(measure_cb _hidl_cb) {
}
} // namespace implementation
} // namespace V2_0
} // namespace AUDIO_HAL_VERSION
} // namespace effect
} // namespace audio
} // namespace hardware