diff options
author | Kevin Rocard <krocard@google.com> | 2018-03-01 15:08:07 -0800 |
---|---|---|
committer | Kevin Rocard <krocard@google.com> | 2018-03-02 13:20:02 -0800 |
commit | 30a7fcca2922536c0a1f402c3c21bdf3a2008514 (patch) | |
tree | cf425d705008d7fba130061ef75b66a8977af85e | |
parent | ab1f548cf13a7619175360bb2c563f28414fe84a (diff) | |
download | platform_hardware_interfaces-30a7fcca2922536c0a1f402c3c21bdf3a2008514.tar.gz platform_hardware_interfaces-30a7fcca2922536c0a1f402c3c21bdf3a2008514.tar.bz2 platform_hardware_interfaces-30a7fcca2922536c0a1f402c3c21bdf3a2008514.zip |
Audio V4: Implement the shim effect 4.0 -> legacy
All the new files added are a copy of the 2.0 ones, with just the
version 2 that was changed to 4.
Due to the rollback on the retrocompatiblity breakage,
the split of implementation is not strictly needed any more.
This makes the current split in .impl.h and double include
unnecessary complicated.
This will need to be factorized in a future patch.
Bug: 38184704
Test: compile
Change-Id: If412eb55ebf6afc773593547af9395a09b6825c2
Signed-off-by: Kevin Rocard <krocard@google.com>
59 files changed, 1026 insertions, 56 deletions
diff --git a/audio/common/2.0/default/VersionUtils.h b/audio/common/2.0/default/VersionUtils.h new file mode 100644 index 0000000000..fef468080e --- /dev/null +++ b/audio/common/2.0/default/VersionUtils.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2018 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_VERSION_UTILS_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H + +#include <android/hardware/audio/common/2.0/types.h> + +namespace android { +namespace hardware { +namespace audio { +namespace common { +namespace V2_0 { +namespace implementation { + +typedef common::V2_0::AudioDevice AudioDeviceBitfield; +typedef common::V2_0::AudioChannelMask AudioChannelBitfield; + +} // namespace implementation +} // namespace V2_0 +} // namespace common +} // namespace audio +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H diff --git a/audio/common/4.0/default/VersionUtils.h b/audio/common/4.0/default/VersionUtils.h new file mode 100644 index 0000000000..515c792222 --- /dev/null +++ b/audio/common/4.0/default/VersionUtils.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2018 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_VERSION_UTILS_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H + +#include <android/hardware/audio/4.0/types.h> + +namespace android { +namespace hardware { +namespace audio { +namespace common { +namespace V4_0 { +namespace implementation { + +typedef hidl_bitfield<common::V4_0::AudioDevice> AudioDeviceBitfield; +typedef hidl_bitfield<common::V4_0::AudioChannelMask> AudioChannelBitfield; + +} // namespace implementation +} // namespace V4_0 +} // namespace common +} // namespace audio +} // namespace hardware +} // namespace android + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_VERSION_UTILS_H diff --git a/audio/effect/4.0/default/AcousticEchoCancelerEffect.cpp b/audio/effect/4.0/default/AcousticEchoCancelerEffect.cpp new file mode 100644 index 0000000000..242740e582 --- /dev/null +++ b/audio/effect/4.0/default/AcousticEchoCancelerEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/AcousticEchoCancelerEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/AcousticEchoCancelerEffect.h b/audio/effect/4.0/default/AcousticEchoCancelerEffect.h new file mode 100644 index 0000000000..0ac0a1e0df --- /dev/null +++ b/audio/effect/4.0/default/AcousticEchoCancelerEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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_V4_0_ACOUSTICECHOCANCELEREFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ACOUSTICECHOCANCELEREFFECT_H + +#include <android/hardware/audio/effect/4.0/IAcousticEchoCancelerEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/AcousticEchoCancelerEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ACOUSTICECHOCANCELEREFFECT_H diff --git a/audio/effect/4.0/default/Android.bp b/audio/effect/4.0/default/Android.bp new file mode 100644 index 0000000000..dcb2269a9b --- /dev/null +++ b/audio/effect/4.0/default/Android.bp @@ -0,0 +1,50 @@ +cc_library_shared { + name: "android.hardware.audio.effect@4.0-impl", + defaults: ["hidl_defaults"], + vendor: true, + relative_install_path: "hw", + srcs: [ + "AcousticEchoCancelerEffect.cpp", + "AudioBufferManager.cpp", + "AutomaticGainControlEffect.cpp", + "BassBoostEffect.cpp", + "Conversions.cpp", + "DownmixEffect.cpp", + "Effect.cpp", + "EffectsFactory.cpp", + "EnvironmentalReverbEffect.cpp", + "EqualizerEffect.cpp", + "LoudnessEnhancerEffect.cpp", + "NoiseSuppressionEffect.cpp", + "PresetReverbEffect.cpp", + "VirtualizerEffect.cpp", + "VisualizerEffect.cpp", + ], + + shared_libs: [ + "libbase", + "libcutils", + "libeffects", + "libfmq", + "libhidlbase", + "libhidlmemory", + "libhidltransport", + "liblog", + "libutils", + "android.hardware.audio.common-util", + "android.hardware.audio.common@4.0", + "android.hardware.audio.common@4.0-util", + "android.hardware.audio.effect@4.0", + "android.hidl.memory@1.0", + ], + + header_libs: [ + "android.hardware.audio.common.util@all-versions", + "android.hardware.audio.effect@all-versions-impl", + "libaudio_system_headers", + "libaudioclient_headers", + "libeffects_headers", + "libhardware_headers", + "libmedia_headers", + ], +} diff --git a/audio/effect/4.0/default/AudioBufferManager.cpp b/audio/effect/4.0/default/AudioBufferManager.cpp new file mode 100644 index 0000000000..2d75f3fdbb --- /dev/null +++ b/audio/effect/4.0/default/AudioBufferManager.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/AudioBufferManager.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/AudioBufferManager.h b/audio/effect/4.0/default/AudioBufferManager.h new file mode 100644 index 0000000000..1f151e6b99 --- /dev/null +++ b/audio/effect/4.0/default/AudioBufferManager.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2018 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_V4_0_AUDIO_BUFFER_MANAGER_H_ +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_AUDIO_BUFFER_MANAGER_H_ + +#include <android/hardware/audio/effect/4.0/types.h> + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/AudioBufferManager.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_AUDIO_BUFFER_MANAGER_H_ diff --git a/audio/effect/4.0/default/AutomaticGainControlEffect.cpp b/audio/effect/4.0/default/AutomaticGainControlEffect.cpp new file mode 100644 index 0000000000..9d21c8ae6b --- /dev/null +++ b/audio/effect/4.0/default/AutomaticGainControlEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/AutomaticGainControlEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/AutomaticGainControlEffect.h b/audio/effect/4.0/default/AutomaticGainControlEffect.h new file mode 100644 index 0000000000..7f12007f8f --- /dev/null +++ b/audio/effect/4.0/default/AutomaticGainControlEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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_V4_0_AUTOMATICGAINCONTROLEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_AUTOMATICGAINCONTROLEFFECT_H + +#include <android/hardware/audio/effect/4.0/IAutomaticGainControlEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/AutomaticGainControlEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_AUTOMATICGAINCONTROLEFFECT_H diff --git a/audio/effect/4.0/default/BassBoostEffect.cpp b/audio/effect/4.0/default/BassBoostEffect.cpp new file mode 100644 index 0000000000..74a626b79e --- /dev/null +++ b/audio/effect/4.0/default/BassBoostEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/BassBoostEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/BassBoostEffect.h b/audio/effect/4.0/default/BassBoostEffect.h new file mode 100644 index 0000000000..206a75fab4 --- /dev/null +++ b/audio/effect/4.0/default/BassBoostEffect.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2018 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_V4_0_BASSBOOSTEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_BASSBOOSTEFFECT_H + +#include <android/hardware/audio/effect/4.0/IBassBoostEffect.h> + +#include <hidl/MQDescriptor.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/BassBoostEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_BASSBOOSTEFFECT_H diff --git a/audio/effect/4.0/default/Conversions.cpp b/audio/effect/4.0/default/Conversions.cpp new file mode 100644 index 0000000000..91285ae6b8 --- /dev/null +++ b/audio/effect/4.0/default/Conversions.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2018 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::V4_0::HidlUtils; + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/Conversions.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/Conversions.h b/audio/effect/4.0/default/Conversions.h new file mode 100644 index 0000000000..50e380fe2e --- /dev/null +++ b/audio/effect/4.0/default/Conversions.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2018 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_V4_0_CONVERSIONS_H_ +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_CONVERSIONS_H_ + +#include <android/hardware/audio/effect/4.0/types.h> + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/Conversions.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_CONVERSIONS_H_ diff --git a/audio/effect/4.0/default/DownmixEffect.cpp b/audio/effect/4.0/default/DownmixEffect.cpp new file mode 100644 index 0000000000..07fcab2f1c --- /dev/null +++ b/audio/effect/4.0/default/DownmixEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/DownmixEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/DownmixEffect.h b/audio/effect/4.0/default/DownmixEffect.h new file mode 100644 index 0000000000..5ae820b76f --- /dev/null +++ b/audio/effect/4.0/default/DownmixEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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_V4_0_DOWNMIXEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_DOWNMIXEFFECT_H + +#include <android/hardware/audio/effect/4.0/IDownmixEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/DownmixEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_DOWNMIXEFFECT_H diff --git a/audio/effect/4.0/default/Effect.cpp b/audio/effect/4.0/default/Effect.cpp new file mode 100644 index 0000000000..707044bff0 --- /dev/null +++ b/audio/effect/4.0/default/Effect.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/Effect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/Effect.h b/audio/effect/4.0/default/Effect.h new file mode 100644 index 0000000000..9ca79c4596 --- /dev/null +++ b/audio/effect/4.0/default/Effect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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_V4_0_EFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EFFECT_H + +#include <android/hardware/audio/effect/4.0/IEffect.h> + +#include "AudioBufferManager.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/Effect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EFFECT_H diff --git a/audio/effect/4.0/default/EffectsFactory.cpp b/audio/effect/4.0/default/EffectsFactory.cpp new file mode 100644 index 0000000000..ee0413df8f --- /dev/null +++ b/audio/effect/4.0/default/EffectsFactory.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2018 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::V4_0::HidlUtils; + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/EffectsFactory.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/EffectsFactory.h b/audio/effect/4.0/default/EffectsFactory.h new file mode 100644 index 0000000000..48e4b4cb9f --- /dev/null +++ b/audio/effect/4.0/default/EffectsFactory.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2018 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_V4_0_EFFECTSFACTORY_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EFFECTSFACTORY_H + +#include <system/audio_effect.h> + +#include <android/hardware/audio/effect/4.0/IEffectsFactory.h> + +#include <hidl/MQDescriptor.h> +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/EffectsFactory.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EFFECTSFACTORY_H diff --git a/audio/effect/4.0/default/EnvironmentalReverbEffect.cpp b/audio/effect/4.0/default/EnvironmentalReverbEffect.cpp new file mode 100644 index 0000000000..cc3102d1f8 --- /dev/null +++ b/audio/effect/4.0/default/EnvironmentalReverbEffect.cpp @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/EnvironmentalReverbEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/EnvironmentalReverbEffect.h b/audio/effect/4.0/default/EnvironmentalReverbEffect.h new file mode 100644 index 0000000000..c0fb25c02c --- /dev/null +++ b/audio/effect/4.0/default/EnvironmentalReverbEffect.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2018 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_V4_0_ENVIRONMENTALREVERBEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ENVIRONMENTALREVERBEFFECT_H + +#include <system/audio_effects/effect_environmentalreverb.h> + +#include <android/hardware/audio/effect/4.0/IEnvironmentalReverbEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/EnvironmentalReverbEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_ENVIRONMENTALREVERBEFFECT_H diff --git a/audio/effect/4.0/default/EqualizerEffect.cpp b/audio/effect/4.0/default/EqualizerEffect.cpp new file mode 100644 index 0000000000..d0a40bc3cd --- /dev/null +++ b/audio/effect/4.0/default/EqualizerEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/EqualizerEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/EqualizerEffect.h b/audio/effect/4.0/default/EqualizerEffect.h new file mode 100644 index 0000000000..7c9463b01e --- /dev/null +++ b/audio/effect/4.0/default/EqualizerEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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_V4_0_EQUALIZEREFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EQUALIZEREFFECT_H + +#include <android/hardware/audio/effect/4.0/IEqualizerEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/EqualizerEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_EQUALIZEREFFECT_H diff --git a/audio/effect/4.0/default/LoudnessEnhancerEffect.cpp b/audio/effect/4.0/default/LoudnessEnhancerEffect.cpp new file mode 100644 index 0000000000..e3c5184225 --- /dev/null +++ b/audio/effect/4.0/default/LoudnessEnhancerEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/LoudnessEnhancerEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/LoudnessEnhancerEffect.h b/audio/effect/4.0/default/LoudnessEnhancerEffect.h new file mode 100644 index 0000000000..64fa26add8 --- /dev/null +++ b/audio/effect/4.0/default/LoudnessEnhancerEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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_V4_0_LOUDNESSENHANCEREFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_LOUDNESSENHANCEREFFECT_H + +#include <android/hardware/audio/effect/4.0/ILoudnessEnhancerEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/LoudnessEnhancerEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_LOUDNESSENHANCEREFFECT_H diff --git a/audio/effect/4.0/default/NoiseSuppressionEffect.cpp b/audio/effect/4.0/default/NoiseSuppressionEffect.cpp new file mode 100644 index 0000000000..e83a8e3373 --- /dev/null +++ b/audio/effect/4.0/default/NoiseSuppressionEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/NoiseSuppressionEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/NoiseSuppressionEffect.h b/audio/effect/4.0/default/NoiseSuppressionEffect.h new file mode 100644 index 0000000000..36d45afaf7 --- /dev/null +++ b/audio/effect/4.0/default/NoiseSuppressionEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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_V4_0_NOISESUPPRESSIONEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_NOISESUPPRESSIONEFFECT_H + +#include <android/hardware/audio/effect/4.0/INoiseSuppressionEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/NoiseSuppressionEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_NOISESUPPRESSIONEFFECT_H diff --git a/audio/effect/4.0/default/OWNERS b/audio/effect/4.0/default/OWNERS new file mode 100644 index 0000000000..6fdc97ca29 --- /dev/null +++ b/audio/effect/4.0/default/OWNERS @@ -0,0 +1,3 @@ +elaurent@google.com +krocard@google.com +mnaganov@google.com diff --git a/audio/effect/4.0/default/PresetReverbEffect.cpp b/audio/effect/4.0/default/PresetReverbEffect.cpp new file mode 100644 index 0000000000..0c23be73af --- /dev/null +++ b/audio/effect/4.0/default/PresetReverbEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/PresetReverbEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/PresetReverbEffect.h b/audio/effect/4.0/default/PresetReverbEffect.h new file mode 100644 index 0000000000..3eeae0a04b --- /dev/null +++ b/audio/effect/4.0/default/PresetReverbEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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_V4_0_PRESETREVERBEFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_PRESETREVERBEFFECT_H + +#include <android/hardware/audio/effect/4.0/IPresetReverbEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/PresetReverbEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_PRESETREVERBEFFECT_H diff --git a/audio/effect/4.0/default/VirtualizerEffect.cpp b/audio/effect/4.0/default/VirtualizerEffect.cpp new file mode 100644 index 0000000000..f50e8adb7b --- /dev/null +++ b/audio/effect/4.0/default/VirtualizerEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/VirtualizerEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/VirtualizerEffect.h b/audio/effect/4.0/default/VirtualizerEffect.h new file mode 100644 index 0000000000..8e7114e569 --- /dev/null +++ b/audio/effect/4.0/default/VirtualizerEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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_V4_0_VIRTUALIZEREFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_VIRTUALIZEREFFECT_H + +#include <android/hardware/audio/effect/4.0/IVirtualizerEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/VirtualizerEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_VIRTUALIZEREFFECT_H diff --git a/audio/effect/4.0/default/VisualizerEffect.cpp b/audio/effect/4.0/default/VisualizerEffect.cpp new file mode 100644 index 0000000000..8d4f100ced --- /dev/null +++ b/audio/effect/4.0/default/VisualizerEffect.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 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 V4_0 +#include <effect/all-versions/default/VisualizerEffect.impl.h> +#undef AUDIO_HAL_VERSION diff --git a/audio/effect/4.0/default/VisualizerEffect.h b/audio/effect/4.0/default/VisualizerEffect.h new file mode 100644 index 0000000000..6b5ab9c393 --- /dev/null +++ b/audio/effect/4.0/default/VisualizerEffect.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2018 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_V4_0_VISUALIZEREFFECT_H +#define ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_VISUALIZEREFFECT_H + +#include <android/hardware/audio/effect/4.0/IVisualizerEffect.h> + +#include "Effect.h" + +#define AUDIO_HAL_VERSION V4_0 +#include <effect/all-versions/default/VisualizerEffect.h> +#undef AUDIO_HAL_VERSION + +#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V4_0_VISUALIZEREFFECT_H diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.h index b63f2fb937..852cb3fd15 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.h @@ -20,6 +20,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -46,7 +48,7 @@ struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -54,7 +56,7 @@ struct AcousticEchoCancelerEffect : public IAcousticEchoCancelerEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h index bee3607854..8ad80a22a0 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/AcousticEchoCancelerEffect.impl.h @@ -19,6 +19,8 @@ #include <android/log.h> #include <system/audio_effects/effect_aec.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -54,7 +56,7 @@ Return<Result> AcousticEchoCancelerEffect::disable() { return mEffect->disable(); } -Return<Result> AcousticEchoCancelerEffect::setDevice(AudioDevice device) { +Return<Result> AcousticEchoCancelerEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -78,7 +80,7 @@ Return<Result> AcousticEchoCancelerEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> AcousticEchoCancelerEffect::setInputDevice(AudioDevice device) { +Return<Result> AcousticEchoCancelerEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.h index 941f45da3c..5ac43eb9bc 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.h @@ -22,6 +22,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -48,7 +50,7 @@ struct AutomaticGainControlEffect : public IAutomaticGainControlEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -56,7 +58,7 @@ struct AutomaticGainControlEffect : public IAutomaticGainControlEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h index af05d9b780..e2e751e86b 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/AutomaticGainControlEffect.impl.h @@ -18,6 +18,8 @@ #include <android/log.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -67,7 +69,7 @@ Return<Result> AutomaticGainControlEffect::disable() { return mEffect->disable(); } -Return<Result> AutomaticGainControlEffect::setDevice(AudioDevice device) { +Return<Result> AutomaticGainControlEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -91,7 +93,7 @@ Return<Result> AutomaticGainControlEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> AutomaticGainControlEffect::setInputDevice(AudioDevice device) { +Return<Result> AutomaticGainControlEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.h index 00926217b5..29173ddebe 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.h @@ -20,6 +20,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -46,7 +48,7 @@ struct BassBoostEffect : public IBassBoostEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -54,7 +56,7 @@ struct BassBoostEffect : public IBassBoostEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.impl.h index 1fc8d1b428..7bcb4a3497 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/BassBoostEffect.impl.h @@ -19,6 +19,8 @@ #include <android/log.h> #include <system/audio_effects/effect_bassboost.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -53,7 +55,7 @@ Return<Result> BassBoostEffect::disable() { return mEffect->disable(); } -Return<Result> BassBoostEffect::setDevice(AudioDevice device) { +Return<Result> BassBoostEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -76,7 +78,7 @@ Return<Result> BassBoostEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> BassBoostEffect::setInputDevice(AudioDevice device) { +Return<Result> BassBoostEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.h index e461ca80b7..3e3aa78477 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.h @@ -20,6 +20,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -46,7 +48,7 @@ struct DownmixEffect : public IDownmixEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -54,7 +56,7 @@ struct DownmixEffect : public IDownmixEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.impl.h index 98710f89dc..abef10ea09 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/DownmixEffect.impl.h @@ -19,6 +19,8 @@ #include <android/log.h> #include <system/audio_effects/effect_downmix.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -53,7 +55,7 @@ Return<Result> DownmixEffect::disable() { return mEffect->disable(); } -Return<Result> DownmixEffect::setDevice(AudioDevice device) { +Return<Result> DownmixEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -76,7 +78,7 @@ Return<Result> DownmixEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> DownmixEffect::setInputDevice(AudioDevice device) { +Return<Result> DownmixEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.h index 81b0b24425..b546e0eb32 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.h @@ -28,6 +28,8 @@ #include <hardware/audio_effect.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -39,6 +41,7 @@ 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::common::AUDIO_HAL_VERSION::implementation::AudioDeviceBitfield; 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; @@ -69,7 +72,7 @@ struct Effect : public IEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -77,7 +80,7 @@ struct Effect : public IEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.impl.h index d3761464be..61c9805663 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/Effect.impl.h @@ -24,6 +24,8 @@ #include <media/EffectsFactoryApi.h> #include <utils/Trace.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -33,6 +35,7 @@ namespace implementation { using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioChannelMask; using ::android::hardware::audio::common::AUDIO_HAL_VERSION::AudioFormat; +using ::android::hardware::audio::common::AUDIO_HAL_VERSION::implementation::AudioChannelBitfield; using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::MessageQueueFlagBits; namespace { @@ -174,8 +177,8 @@ std::unique_ptr<uint8_t[]> Effect::hidlVecToHal(const hidl_vec<T>& vec, uint32_t // static void Effect::effectAuxChannelsConfigFromHal(const channel_config_t& halConfig, EffectAuxChannelsConfig* config) { - config->mainChannels = AudioChannelMask(halConfig.main_channels); - config->auxChannels = AudioChannelMask(halConfig.aux_channels); + config->mainChannels = AudioChannelBitfield(halConfig.main_channels); + config->auxChannels = AudioChannelBitfield(halConfig.aux_channels); } // static @@ -191,10 +194,10 @@ void Effect::effectBufferConfigFromHal(const buffer_config_t& halConfig, config->buffer.id = 0; config->buffer.frameCount = 0; config->samplingRateHz = halConfig.samplingRate; - config->channels = AudioChannelMask(halConfig.channels); + config->channels = AudioChannelBitfield(halConfig.channels); config->format = AudioFormat(halConfig.format); config->accessMode = EffectBufferAccess(halConfig.accessMode); - config->mask = EffectConfigParameters(halConfig.mask); + config->mask = static_cast<decltype(config->mask)>(halConfig.mask); } // static @@ -500,7 +503,7 @@ Return<Result> Effect::disable() { return sendCommandReturningStatus(EFFECT_CMD_DISABLE, "DISABLE"); } -Return<Result> Effect::setDevice(AudioDevice device) { +Return<Result> Effect::setDevice(AudioDeviceBitfield device) { uint32_t halDevice = static_cast<uint32_t>(device); return sendCommand(EFFECT_CMD_SET_DEVICE, "SET_DEVICE", sizeof(uint32_t), &halDevice); } @@ -539,7 +542,7 @@ Return<Result> Effect::setConfigReverse( inputBufferProvider, outputBufferProvider); } -Return<Result> Effect::setInputDevice(AudioDevice device) { +Return<Result> Effect::setInputDevice(AudioDeviceBitfield device) { uint32_t halDevice = static_cast<uint32_t>(device); return sendCommand(EFFECT_CMD_SET_INPUT_DEVICE, "SET_INPUT_DEVICE", sizeof(uint32_t), &halDevice); diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.h b/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.h index e586abb807..313c8c2df6 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EffectsFactory.h @@ -46,7 +46,7 @@ struct EffectsFactory : public IEffectsFactory { Return<void> getDescriptor(const Uuid& uid, getDescriptor_cb _hidl_cb) override; Return<void> createEffect(const Uuid& uid, int32_t session, int32_t ioHandle, createEffect_cb _hidl_cb) override; - Return<void> debugDump(const hidl_handle& fd) override; + Return<void> debugDump(const hidl_handle& fd); private: static sp<IEffect> dispatchEffectInstanceCreation(const effect_descriptor_t& halDescriptor, diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.h index 8351e5517a..d2f8cc3a84 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.h @@ -22,6 +22,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -58,7 +60,7 @@ struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -66,7 +68,7 @@ struct EnvironmentalReverbEffect : public IEnvironmentalReverbEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h index 9090b8ab78..39a4092e8c 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EnvironmentalReverbEffect.impl.h @@ -18,6 +18,8 @@ #include <android/log.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -81,7 +83,7 @@ Return<Result> EnvironmentalReverbEffect::disable() { return mEffect->disable(); } -Return<Result> EnvironmentalReverbEffect::setDevice(AudioDevice device) { +Return<Result> EnvironmentalReverbEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -105,7 +107,7 @@ Return<Result> EnvironmentalReverbEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> EnvironmentalReverbEffect::setInputDevice(AudioDevice device) { +Return<Result> EnvironmentalReverbEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.h index c2b8ef8b52..de520521fa 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.h @@ -24,6 +24,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -60,7 +62,7 @@ struct EqualizerEffect : public IEqualizerEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -68,7 +70,7 @@ struct EqualizerEffect : public IEqualizerEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.impl.h index 78485e48fd..db6bed8d2e 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/EqualizerEffect.impl.h @@ -20,6 +20,8 @@ #include <android/log.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -76,7 +78,7 @@ Return<Result> EqualizerEffect::disable() { return mEffect->disable(); } -Return<Result> EqualizerEffect::setDevice(AudioDevice device) { +Return<Result> EqualizerEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -99,7 +101,7 @@ Return<Result> EqualizerEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> EqualizerEffect::setInputDevice(AudioDevice device) { +Return<Result> EqualizerEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.h index e4f1bd5e93..b59b077e76 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.h @@ -20,6 +20,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -56,7 +58,7 @@ struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -64,7 +66,7 @@ struct LoudnessEnhancerEffect : public ILoudnessEnhancerEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h index 3f4f379a27..88210e954b 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/LoudnessEnhancerEffect.impl.h @@ -21,6 +21,8 @@ #include <android/log.h> #include <system/audio_effects/effect_aec.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -56,7 +58,7 @@ Return<Result> LoudnessEnhancerEffect::disable() { return mEffect->disable(); } -Return<Result> LoudnessEnhancerEffect::setDevice(AudioDevice device) { +Return<Result> LoudnessEnhancerEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -79,7 +81,7 @@ Return<Result> LoudnessEnhancerEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> LoudnessEnhancerEffect::setInputDevice(AudioDevice device) { +Return<Result> LoudnessEnhancerEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.h index 7b64ba015a..af1635b717 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.h @@ -22,6 +22,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -58,7 +60,7 @@ struct NoiseSuppressionEffect : public INoiseSuppressionEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -66,7 +68,7 @@ struct NoiseSuppressionEffect : public INoiseSuppressionEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h index e5fc454a44..f32399c51c 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/NoiseSuppressionEffect.impl.h @@ -18,6 +18,8 @@ #include <android/log.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -65,7 +67,7 @@ Return<Result> NoiseSuppressionEffect::disable() { return mEffect->disable(); } -Return<Result> NoiseSuppressionEffect::setDevice(AudioDevice device) { +Return<Result> NoiseSuppressionEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -88,7 +90,7 @@ Return<Result> NoiseSuppressionEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> NoiseSuppressionEffect::setInputDevice(AudioDevice device) { +Return<Result> NoiseSuppressionEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.h index 3114acd8d7..1a91ab49b2 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.h @@ -20,6 +20,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -56,7 +58,7 @@ struct PresetReverbEffect : public IPresetReverbEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -64,7 +66,7 @@ struct PresetReverbEffect : public IPresetReverbEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.impl.h index 32198d50e5..eab68fb703 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/PresetReverbEffect.impl.h @@ -19,6 +19,8 @@ #include <android/log.h> #include <system/audio_effects/effect_presetreverb.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -53,7 +55,7 @@ Return<Result> PresetReverbEffect::disable() { return mEffect->disable(); } -Return<Result> PresetReverbEffect::setDevice(AudioDevice device) { +Return<Result> PresetReverbEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -76,7 +78,7 @@ Return<Result> PresetReverbEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> PresetReverbEffect::setInputDevice(AudioDevice device) { +Return<Result> PresetReverbEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.h index 371589488f..c0d5a0034d 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.h @@ -20,6 +20,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -31,6 +33,7 @@ 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::common::AUDIO_HAL_VERSION::implementation::AudioChannelBitfield; 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; @@ -57,7 +60,7 @@ struct VirtualizerEffect : public IVirtualizerEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -65,7 +68,7 @@ struct VirtualizerEffect : public IVirtualizerEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( @@ -98,7 +101,7 @@ struct VirtualizerEffect : public IVirtualizerEffect { Return<bool> isStrengthSupported() override; Return<Result> setStrength(uint16_t strength) override; Return<void> getStrength(getStrength_cb _hidl_cb) override; - Return<void> getVirtualSpeakerAngles(AudioChannelMask mask, AudioDevice device, + Return<void> getVirtualSpeakerAngles(AudioChannelBitfield mask, AudioDevice device, getVirtualSpeakerAngles_cb _hidl_cb) override; Return<Result> forceVirtualizationMode(AudioDevice device) override; Return<void> getVirtualizationMode(getVirtualizationMode_cb _hidl_cb) override; diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.impl.h index 6fb8005590..23b09a89dd 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/VirtualizerEffect.impl.h @@ -21,6 +21,8 @@ #include <android/log.h> #include <system/audio_effects/effect_virtualizer.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -36,7 +38,7 @@ void VirtualizerEffect::speakerAnglesFromHal(const int32_t* halAngles, uint32_t hidl_vec<SpeakerAngle>& speakerAngles) { speakerAngles.resize(channelCount); for (uint32_t i = 0; i < channelCount; ++i) { - speakerAngles[i].mask = AudioChannelMask(*halAngles++); + speakerAngles[i].mask = AudioChannelBitfield(*halAngles++); speakerAngles[i].azimuth = *halAngles++; speakerAngles[i].elevation = *halAngles++; } @@ -65,7 +67,7 @@ Return<Result> VirtualizerEffect::disable() { return mEffect->disable(); } -Return<Result> VirtualizerEffect::setDevice(AudioDevice device) { +Return<Result> VirtualizerEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -88,7 +90,7 @@ Return<Result> VirtualizerEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> VirtualizerEffect::setInputDevice(AudioDevice device) { +Return<Result> VirtualizerEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } @@ -184,7 +186,8 @@ Return<void> VirtualizerEffect::getStrength(getStrength_cb _hidl_cb) { return mEffect->getIntegerParam(VIRTUALIZER_PARAM_STRENGTH, _hidl_cb); } -Return<void> VirtualizerEffect::getVirtualSpeakerAngles(AudioChannelMask mask, AudioDevice device, +Return<void> VirtualizerEffect::getVirtualSpeakerAngles(AudioChannelBitfield mask, + AudioDevice device, getVirtualSpeakerAngles_cb _hidl_cb) { uint32_t channelCount = audio_channel_count_from_out_mask(static_cast<audio_channel_mask_t>(mask)); diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.h b/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.h index 80502210cf..114d3b7ae5 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.h @@ -20,6 +20,8 @@ #include <hidl/MQDescriptor.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -56,7 +58,7 @@ struct VisualizerEffect : public IVisualizerEffect { Return<Result> reset() override; Return<Result> enable() override; Return<Result> disable() override; - Return<Result> setDevice(AudioDevice device) override; + Return<Result> setDevice(AudioDeviceBitfield device) override; Return<void> setAndGetVolume(const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; Return<Result> volumeChangeNotification(const hidl_vec<uint32_t>& volumes) override; @@ -64,7 +66,7 @@ struct VisualizerEffect : public IVisualizerEffect { Return<Result> setConfigReverse( const EffectConfig& config, const sp<IEffectBufferProviderCallback>& inputBufferProvider, const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; - Return<Result> setInputDevice(AudioDevice device) override; + Return<Result> setInputDevice(AudioDeviceBitfield device) override; Return<void> getConfig(getConfig_cb _hidl_cb) override; Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; Return<void> getSupportedAuxChannelsConfigs( diff --git a/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.impl.h b/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.impl.h index 035145368b..9f2195b5cb 100644 --- a/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.impl.h +++ b/audio/effect/all-versions/default/include/effect/all-versions/default/VisualizerEffect.impl.h @@ -19,6 +19,8 @@ #include <android/log.h> #include <system/audio_effects/effect_visualizer.h> +#include "VersionUtils.h" + namespace android { namespace hardware { namespace audio { @@ -54,7 +56,7 @@ Return<Result> VisualizerEffect::disable() { return mEffect->disable(); } -Return<Result> VisualizerEffect::setDevice(AudioDevice device) { +Return<Result> VisualizerEffect::setDevice(AudioDeviceBitfield device) { return mEffect->setDevice(device); } @@ -77,7 +79,7 @@ Return<Result> VisualizerEffect::setConfigReverse( return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider); } -Return<Result> VisualizerEffect::setInputDevice(AudioDevice device) { +Return<Result> VisualizerEffect::setInputDevice(AudioDeviceBitfield device) { return mEffect->setInputDevice(device); } |