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