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