blob: a616e866055ba8089d061f08f3ed83000c9ae6ad [file] [log] [blame]
Mikhail Naganov4a3d5c22016-08-15 13:47:42 -07001/*
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_EFFECTS_FACTORY_HAL_INTERFACE_H
18#define ANDROID_HARDWARE_EFFECTS_FACTORY_HAL_INTERFACE_H
19
Mikhail Naganova0c91332016-09-19 10:01:12 -070020#include <media/audiohal/EffectHalInterface.h>
Mikhail Naganov00260b52016-10-13 12:54:24 -070021#include <system/audio_effect.h>
Mikhail Naganov4a3d5c22016-08-15 13:47:42 -070022#include <utils/Errors.h>
23#include <utils/RefBase.h>
24
Mikhail Naganov4a3d5c22016-08-15 13:47:42 -070025namespace android {
26
Mikhail Naganove4f1f632016-08-31 11:35:10 -070027class EffectsFactoryHalInterface : public RefBase
Mikhail Naganov4a3d5c22016-08-15 13:47:42 -070028{
29 public:
Mikhail Naganov4a3d5c22016-08-15 13:47:42 -070030 // Returns the number of different effects in all loaded libraries.
31 virtual status_t queryNumberEffects(uint32_t *pNumEffects) = 0;
32
33 // Returns a descriptor of the next available effect.
34 virtual status_t getDescriptor(uint32_t index,
35 effect_descriptor_t *pDescriptor) = 0;
36
37 virtual status_t getDescriptor(const effect_uuid_t *pEffectUuid,
38 effect_descriptor_t *pDescriptor) = 0;
39
40 // Creates an effect engine of the specified type.
41 // To release the effect engine, it is necessary to release references
42 // to the returned effect object.
43 virtual status_t createEffect(const effect_uuid_t *pEffectUuid,
44 int32_t sessionId, int32_t ioId,
45 sp<EffectHalInterface> *effect) = 0;
46
47 virtual status_t dumpEffects(int fd) = 0;
48
49 static sp<EffectsFactoryHalInterface> create();
50
51 // Helper function to compare effect uuid to EFFECT_UUID_NULL.
52 static bool isNullUuid(const effect_uuid_t *pEffectUuid);
53
54 protected:
55 // Subclasses can not be constructed directly by clients.
56 EffectsFactoryHalInterface() {}
Mikhail Naganov1dc98672016-08-18 17:50:29 -070057
58 virtual ~EffectsFactoryHalInterface() {}
Mikhail Naganov4a3d5c22016-08-15 13:47:42 -070059};
60
61} // namespace android
62
63#endif // ANDROID_HARDWARE_EFFECTS_FACTORY_HAL_INTERFACE_H