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 #include <common/all-versions/IncludeGuard.h> 18 19 #include <hardware/audio_effect.h> 20 #include <system/audio_effect.h> 21 22 #include <hidl/Status.h> 23 24 #include <hidl/MQDescriptor.h> 25 namespace android { 26 namespace hardware { 27 namespace audio { 28 namespace effect { 29 namespace AUDIO_HAL_VERSION { 30 namespace implementation { 31 32 using ::android::hardware::audio::common::AUDIO_HAL_VERSION::Uuid; 33 using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::EffectDescriptor; 34 using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffect; 35 using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory; 36 using ::android::hardware::audio::effect::AUDIO_HAL_VERSION::Result; 37 using ::android::hardware::Return; 38 using ::android::hardware::Void; 39 using ::android::hardware::hidl_vec; 40 using ::android::hardware::hidl_string; 41 using ::android::sp; 42 43 struct EffectsFactory : public IEffectsFactory { 44 // Methods from ::android::hardware::audio::effect::AUDIO_HAL_VERSION::IEffectsFactory follow. 45 Return<void> getAllDescriptors(getAllDescriptors_cb _hidl_cb) override; 46 Return<void> getDescriptor(const Uuid& uid, getDescriptor_cb _hidl_cb) override; 47 Return<void> createEffect(const Uuid& uid, int32_t session, int32_t ioHandle, 48 createEffect_cb _hidl_cb) override; 49 Return<void> debugDump(const hidl_handle& fd); //< in V2_0::IEffectsFactory only, alias of debug 50 Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override; 51 52 private: 53 static sp<IEffect> dispatchEffectInstanceCreation(const effect_descriptor_t& halDescriptor, 54 effect_handle_t handle); 55 }; 56 57 extern "C" IEffectsFactory* HIDL_FETCH_IEffectsFactory(const char* name); 58 59 } // namespace implementation 60 } // namespace AUDIO_HAL_VERSION 61 } // namespace effect 62 } // namespace audio 63 } // namespace hardware 64 } // namespace android 65