diff options
author | Kevin Rocard <krocard@google.com> | 2018-03-01 15:08:07 -0800 |
---|---|---|
committer | Kevin Rocard <krocard@google.com> | 2018-03-06 11:30:51 -0800 |
commit | af7f78daa6517f49f9c54de05dedb1f691ca883f (patch) | |
tree | deee47a1b9e91a177f190038a1caee047732f2eb /audio/effect/all-versions | |
parent | f1c1f6e7ac7f9ac2d2a8e804450402340e8b7fca (diff) | |
download | platform_hardware_interfaces-af7f78daa6517f49f9c54de05dedb1f691ca883f.tar.gz platform_hardware_interfaces-af7f78daa6517f49f9c54de05dedb1f691ca883f.tar.bz2 platform_hardware_interfaces-af7f78daa6517f49f9c54de05dedb1f691ca883f.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
Merged-In: If412eb55ebf6afc773593547af9395a09b6825c2
Cherry-picked from master
Signed-off-by: Kevin Rocard <krocard@google.com>
Diffstat (limited to 'audio/effect/all-versions')
25 files changed, 108 insertions, 56 deletions
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); } |