blob: f0d09ec3a463f6cb8e48fcf84b708bc97eb11b26 [file] [log] [blame]
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -07001/*
Kevin Rocard96d2cd92018-11-14 16:22:07 -08002 * Copyright (C) 2018 The Android Open Source Project
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -07003 *
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
Kevin Rocard96d2cd92018-11-14 16:22:07 -080017#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>
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070025
Kevin Rocard62588b62017-12-20 11:07:12 -080026#include <hardware/audio_effect.h>
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070027#include <system/audio_effect.h>
28
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070029#include <hidl/Status.h>
30
31#include <hidl/MQDescriptor.h>
32namespace android {
33namespace hardware {
34namespace audio {
35namespace effect {
Kevin Rocard96d2cd92018-11-14 16:22:07 -080036namespace CPP_VERSION {
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070037namespace implementation {
38
Kevin Rocard55b10612018-11-12 12:33:16 -080039using ::android::sp;
40using ::android::hardware::hidl_string;
41using ::android::hardware::hidl_vec;
42using ::android::hardware::Return;
43using ::android::hardware::Void;
Mikhail Naganov3907f762018-12-13 09:42:17 -080044using namespace ::android::hardware::audio::common::CPP_VERSION;
45using namespace ::android::hardware::audio::effect::CPP_VERSION;
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070046
47struct EffectsFactory : public IEffectsFactory {
Kevin Rocard96d2cd92018-11-14 16:22:07 -080048 // Methods from ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory follow.
Kevin Rocard22505e62017-12-14 18:50:12 -080049 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;
Kevin Rocard55b10612018-11-12 12:33:16 -080053 Return<void> debugDump(
Kevin Rocard96d2cd92018-11-14 16:22:07 -080054 const hidl_handle& fd); //< in CPP_VERSION::IEffectsFactory only, alias of debug
Kevin Rocard3d410272018-04-19 17:52:32 -070055 Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& options) override;
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070056
Kevin Rocard22505e62017-12-14 18:50:12 -080057 private:
58 static sp<IEffect> dispatchEffectInstanceCreation(const effect_descriptor_t& halDescriptor,
59 effect_handle_t handle);
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070060};
61
62extern "C" IEffectsFactory* HIDL_FETCH_IEffectsFactory(const char* name);
63
64} // namespace implementation
Kevin Rocard96d2cd92018-11-14 16:22:07 -080065} // namespace CPP_VERSION
Mikhail Naganov7cbf2f12016-10-27 20:05:35 -070066} // namespace effect
67} // namespace audio
68} // namespace hardware
69} // namespace android
Kevin Rocard96d2cd92018-11-14 16:22:07 -080070
71#endif // ANDROID_HARDWARE_AUDIO_EFFECT_EFFECTSFACTORY_H