DownmixEffect.h revision a331de14219b34b08f4cbb462a45f1fd82a92d48
1/* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H 18#define ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H 19 20#include <android/hardware/audio/effect/2.0/IDownmixEffect.h> 21#include <hidl/Status.h> 22 23#include <hidl/MQDescriptor.h> 24 25#include "Effect.h" 26 27namespace android { 28namespace hardware { 29namespace audio { 30namespace effect { 31namespace V2_0 { 32namespace implementation { 33 34using ::android::hardware::audio::effect::V2_0::IDownmixEffect; 35using ::android::hardware::audio::effect::V2_0::Result; 36using ::android::hardware::Return; 37using ::android::hardware::Void; 38using ::android::hardware::hidl_vec; 39using ::android::hardware::hidl_string; 40using ::android::sp; 41 42struct DownmixEffect : public IDownmixEffect { 43 explicit DownmixEffect(effect_handle_t handle); 44 45 // Methods from ::android::hardware::audio::effect::V2_0::IEffect follow. 46 Return<Result> init() override; 47 Return<Result> setConfig( 48 const EffectConfig& config, 49 const sp<IEffectBufferProviderCallback>& inputBufferProvider, 50 const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; 51 Return<Result> reset() override; 52 Return<Result> enable() override; 53 Return<Result> disable() override; 54 Return<Result> setDevice(AudioDevice device) override; 55 Return<void> setAndGetVolume( 56 const hidl_vec<uint32_t>& volumes, setAndGetVolume_cb _hidl_cb) override; 57 Return<Result> setAudioMode(AudioMode mode) override; 58 Return<Result> setConfigReverse( 59 const EffectConfig& config, 60 const sp<IEffectBufferProviderCallback>& inputBufferProvider, 61 const sp<IEffectBufferProviderCallback>& outputBufferProvider) override; 62 Return<Result> setInputDevice(AudioDevice device) override; 63 Return<void> getConfig(getConfig_cb _hidl_cb) override; 64 Return<void> getConfigReverse(getConfigReverse_cb _hidl_cb) override; 65 Return<void> getSupportedAuxChannelsConfigs( 66 uint32_t maxConfigs, getSupportedAuxChannelsConfigs_cb _hidl_cb) override; 67 Return<void> getAuxChannelsConfig(getAuxChannelsConfig_cb _hidl_cb) override; 68 Return<Result> setAuxChannelsConfig(const EffectAuxChannelsConfig& config) override; 69 Return<Result> setAudioSource(AudioSource source) override; 70 Return<Result> offload(const EffectOffloadParameter& param) override; 71 Return<void> getDescriptor(getDescriptor_cb _hidl_cb) override; 72 Return<void> prepareForProcessing(prepareForProcessing_cb _hidl_cb) override; 73 Return<Result> setProcessBuffers( 74 const AudioBuffer& inBuffer, const AudioBuffer& outBuffer) override; 75 Return<void> command( 76 uint32_t commandId, 77 const hidl_vec<uint8_t>& data, 78 uint32_t resultMaxSize, 79 command_cb _hidl_cb) override; 80 Return<Result> setParameter( 81 const hidl_vec<uint8_t>& parameter, const hidl_vec<uint8_t>& value) override; 82 Return<void> getParameter( 83 const hidl_vec<uint8_t>& parameter, 84 uint32_t valueMaxSize, 85 getParameter_cb _hidl_cb) override; 86 Return<void> getSupportedConfigsForFeature( 87 uint32_t featureId, 88 uint32_t maxConfigs, 89 uint32_t configSize, 90 getSupportedConfigsForFeature_cb _hidl_cb) override; 91 Return<void> getCurrentConfigForFeature( 92 uint32_t featureId, 93 uint32_t configSize, 94 getCurrentConfigForFeature_cb _hidl_cb) override; 95 Return<Result> setCurrentConfigForFeature( 96 uint32_t featureId, const hidl_vec<uint8_t>& configData) override; 97 Return<Result> close() override; 98 99 // Methods from ::android::hardware::audio::effect::V2_0::IDownmixEffect follow. 100 Return<Result> setType(IDownmixEffect::Type preset) override; 101 Return<void> getType(getType_cb _hidl_cb) override; 102 103 private: 104 sp<Effect> mEffect; 105 106 virtual ~DownmixEffect(); 107}; 108 109} // namespace implementation 110} // namespace V2_0 111} // namespace effect 112} // namespace audio 113} // namespace hardware 114} // namespace android 115 116#endif // ANDROID_HARDWARE_AUDIO_EFFECT_V2_0_DOWNMIXEFFECT_H 117