platform_hardware_interfaces/audio/effect/2.0/default/BassBoostEffect.cpp
Yifan Hong f9d303435d Update to use the correct logging library.
Test: mma compiles
Change-Id: Idb33dea5faaf1a5e54719c2a5a683d2d47e9b8e8
2016-12-01 17:47:02 -08:00

188 lines
6 KiB
C++

/*
* Copyright (C) 2016 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 <system/audio_effects/effect_bassboost.h>
#include <android/log.h>
#include "BassBoostEffect.h"
namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {
namespace implementation {
BassBoostEffect::BassBoostEffect(effect_handle_t handle)
: mEffect(new Effect(handle)) {
}
BassBoostEffect::~BassBoostEffect() {}
// Methods from ::android::hardware::audio::effect::V2_0::IEffect follow.
Return<Result> BassBoostEffect::init() {
return mEffect->init();
}
Return<Result> BassBoostEffect::setConfig(
const EffectConfig& config,
const sp<IEffectBufferProviderCallback>& inputBufferProvider,
const sp<IEffectBufferProviderCallback>& outputBufferProvider) {
return mEffect->setConfig(config, inputBufferProvider, outputBufferProvider);
}
Return<Result> BassBoostEffect::reset() {
return mEffect->reset();
}
Return<Result> BassBoostEffect::enable() {
return mEffect->enable();
}
Return<Result> BassBoostEffect::disable() {
return mEffect->disable();
}
Return<Result> BassBoostEffect::setDevice(AudioDevice device) {
return mEffect->setDevice(device);
}
Return<void> BassBoostEffect::setAndGetVolume(
const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) {
return mEffect->setAndGetVolume(volumes, _hidl_cb);
}
Return<Result> BassBoostEffect::setAudioMode(AudioMode mode) {
return mEffect->setAudioMode(mode);
}
Return<Result> BassBoostEffect::setConfigReverse(
const EffectConfig& config,
const sp<IEffectBufferProviderCallback>& inputBufferProvider,
const sp<IEffectBufferProviderCallback>& outputBufferProvider) {
return mEffect->setConfigReverse(config, inputBufferProvider, outputBufferProvider);
}
Return<Result> BassBoostEffect::setInputDevice(AudioDevice device) {
return mEffect->setInputDevice(device);
}
Return<void> BassBoostEffect::getConfig(getConfig_cb _hidl_cb) {
return mEffect->getConfig(_hidl_cb);
}
Return<void> BassBoostEffect::getConfigReverse(getConfigReverse_cb _hidl_cb) {
return mEffect->getConfigReverse(_hidl_cb);
}
Return<void> BassBoostEffect::getSupportedAuxChannelsConfigs(
uint32_t maxConfigs, getSupportedAuxChannelsConfigs_cb _hidl_cb) {
return mEffect->getSupportedAuxChannelsConfigs(maxConfigs, _hidl_cb);
}
Return<void> BassBoostEffect::getAuxChannelsConfig(getAuxChannelsConfig_cb _hidl_cb) {
return mEffect->getAuxChannelsConfig(_hidl_cb);
}
Return<Result> BassBoostEffect::setAuxChannelsConfig(
const EffectAuxChannelsConfig& config) {
return mEffect->setAuxChannelsConfig(config);
}
Return<Result> BassBoostEffect::setAudioSource(AudioSource source) {
return mEffect->setAudioSource(source);
}
Return<Result> BassBoostEffect::offload(const EffectOffloadParameter& param) {
return mEffect->offload(param);
}
Return<void> BassBoostEffect::getDescriptor(getDescriptor_cb _hidl_cb) {
return mEffect->getDescriptor(_hidl_cb);
}
Return<void> BassBoostEffect::process(
const AudioBuffer& inBuffer, uint32_t outFrameSize, process_cb _hidl_cb) {
return mEffect->process(inBuffer, outFrameSize, _hidl_cb);
}
Return<void> BassBoostEffect::processReverse(
const AudioBuffer& inBuffer,
uint32_t outFrameSize,
processReverse_cb _hidl_cb) {
return mEffect->processReverse(inBuffer, outFrameSize, _hidl_cb);
}
Return<void> BassBoostEffect::command(
uint32_t commandId,
const hidl_vec<uint8_t>& data,
uint32_t resultMaxSize,
command_cb _hidl_cb) {
return mEffect->command(commandId, data, resultMaxSize, _hidl_cb);
}
Return<Result> BassBoostEffect::setParameter(
const hidl_vec<uint8_t>& parameter, const hidl_vec<uint8_t>& value) {
return mEffect->setParameter(parameter, value);
}
Return<void> BassBoostEffect::getParameter(
const hidl_vec<uint8_t>& parameter,
uint32_t valueMaxSize,
getParameter_cb _hidl_cb) {
return mEffect->getParameter(parameter, valueMaxSize, _hidl_cb);
}
Return<void> BassBoostEffect::getSupportedConfigsForFeature(
uint32_t featureId,
uint32_t maxConfigs,
uint32_t configSize,
getSupportedConfigsForFeature_cb _hidl_cb) {
return mEffect->getSupportedConfigsForFeature(featureId, maxConfigs, configSize, _hidl_cb);
}
Return<void> BassBoostEffect::getCurrentConfigForFeature(
uint32_t featureId,
uint32_t configSize,
getCurrentConfigForFeature_cb _hidl_cb) {
return mEffect->getCurrentConfigForFeature(featureId, configSize, _hidl_cb);
}
Return<Result> BassBoostEffect::setCurrentConfigForFeature(
uint32_t featureId, const hidl_vec<uint8_t>& configData) {
return mEffect->setCurrentConfigForFeature(featureId, configData);
}
// Methods from ::android::hardware::audio::effect::V2_0::IBassBoostEffect follow.
Return<void> BassBoostEffect::isStrengthSupported(isStrengthSupported_cb _hidl_cb) {
return mEffect->getIntegerParam(BASSBOOST_PARAM_STRENGTH_SUPPORTED, _hidl_cb);
}
Return<Result> BassBoostEffect::setStrength(uint16_t strength) {
return mEffect->setParam(BASSBOOST_PARAM_STRENGTH, strength);
}
Return<void> BassBoostEffect::getStrength(getStrength_cb _hidl_cb) {
return mEffect->getIntegerParam(BASSBOOST_PARAM_STRENGTH, _hidl_cb);
}
} // namespace implementation
} // namespace V2_0
} // namespace effect
} // namespace audio
} // namespace hardware
} // namespace android