blob: 77f774fdeed9043290437f8d4d28b34d16b7d2bd [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_EFFECT_HAL_LOCAL_H
18#define ANDROID_HARDWARE_EFFECT_HAL_LOCAL_H
19
Mikhail Naganov00260b52016-10-13 12:54:24 -070020#include <hardware/audio_effect.h>
Mikhail Naganova0c91332016-09-19 10:01:12 -070021#include <media/audiohal/EffectHalInterface.h>
Mikhail Naganov4a3d5c22016-08-15 13:47:42 -070022
23namespace android {
24
25class EffectHalLocal : public EffectHalInterface
26{
27 public:
Mikhail Naganov4a3d5c22016-08-15 13:47:42 -070028 // Effect process function. Takes input samples as specified
29 // in input buffer descriptor and output processed samples as specified
30 // in output buffer descriptor.
31 virtual status_t process(audio_buffer_t *inBuffer, audio_buffer_t *outBuffer);
32
33 // Process reverse stream function. This function is used to pass
34 // a reference stream to the effect engine.
35 virtual status_t processReverse(audio_buffer_t *inBuffer, audio_buffer_t *outBuffer);
36
37 // Send a command and receive a response to/from effect engine.
38 virtual status_t command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData,
39 uint32_t *replySize, void *pReplyData);
40
41 // Returns the effect descriptor.
42 virtual status_t getDescriptor(effect_descriptor_t *pDescriptor);
43
Mikhail Naganov4a3d5c22016-08-15 13:47:42 -070044 effect_handle_t handle() const { return mHandle; }
45
46 private:
47 effect_handle_t mHandle;
48
49 friend class EffectsFactoryHalLocal;
50
51 // Can not be constructed directly by clients.
52 explicit EffectHalLocal(effect_handle_t handle);
Mikhail Naganov1dc98672016-08-18 17:50:29 -070053
54 // The destructor automatically releases the effect.
55 virtual ~EffectHalLocal();
Mikhail Naganov4a3d5c22016-08-15 13:47:42 -070056};
57
58} // namespace android
59
60#endif // ANDROID_HARDWARE_EFFECT_HAL_LOCAL_H