blob: 92b21537f75e12383e64bab529a2ea3cabd639ac [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
20#include "EffectHalInterface.h"
21
22namespace android {
23
24class EffectHalLocal : public EffectHalInterface
25{
26 public:
27 // The destructor automatically releases the effect.
28 virtual ~EffectHalLocal();
29
30 // Effect process function. Takes input samples as specified
31 // in input buffer descriptor and output processed samples as specified
32 // in output buffer descriptor.
33 virtual status_t process(audio_buffer_t *inBuffer, audio_buffer_t *outBuffer);
34
35 // Process reverse stream function. This function is used to pass
36 // a reference stream to the effect engine.
37 virtual status_t processReverse(audio_buffer_t *inBuffer, audio_buffer_t *outBuffer);
38
39 // Send a command and receive a response to/from effect engine.
40 virtual status_t command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData,
41 uint32_t *replySize, void *pReplyData);
42
43 // Returns the effect descriptor.
44 virtual status_t getDescriptor(effect_descriptor_t *pDescriptor);
45
46 // FIXME: Remove after converting the main audio HAL
47 effect_handle_t handle() const { return mHandle; }
48
49 private:
50 effect_handle_t mHandle;
51
52 friend class EffectsFactoryHalLocal;
53
54 // Can not be constructed directly by clients.
55 explicit EffectHalLocal(effect_handle_t handle);
56};
57
58} // namespace android
59
60#endif // ANDROID_HARDWARE_EFFECT_HAL_LOCAL_H