AudioEffect.h revision da7581b7b61b84f15e8d671c86fd117c322b009e
1801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent/*
2801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Copyright (C) 2009 The Android Open Source Project
3801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent *
4801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Licensed under the Apache License, Version 2.0 (the "License");
5801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * you may not use this file except in compliance with the License.
6801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * You may obtain a copy of the License at
7801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent *
8801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent *      http://www.apache.org/licenses/LICENSE-2.0
9801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent *
10801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Unless required by applicable law or agreed to in writing, software
11801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * distributed under the License is distributed on an "AS IS" BASIS,
12801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * See the License for the specific language governing permissions and
14801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * limitations under the License.
15801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */
16801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
17801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#ifndef ANDROID_AUDIOEFFECT_H
18801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#define ANDROID_AUDIOEFFECT_H
19801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
20801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <stdint.h>
21801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <sys/types.h>
22801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
23801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <media/IAudioFlinger.h>
24801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <media/IEffect.h>
25801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <media/IEffectClient.h>
26801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <media/EffectApi.h>
27801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <media/AudioSystem.h>
28801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
29801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <utils/RefBase.h>
30801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <utils/Errors.h>
31801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <binder/IInterface.h>
32801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
33801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
34801a1186eb1d2ce195b15222701865932e08f3dcEric Laurentnamespace android {
35801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
36801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent// ----------------------------------------------------------------------------
37801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
38801a1186eb1d2ce195b15222701865932e08f3dcEric Laurentclass effect_param_cblk_t;
39801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
40801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent// ----------------------------------------------------------------------------
41801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
42801a1186eb1d2ce195b15222701865932e08f3dcEric Laurentclass AudioEffect : public RefBase
43801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent{
44801a1186eb1d2ce195b15222701865932e08f3dcEric Laurentpublic:
45801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
46801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /*
47801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  Static methods for effect libraries management.
48801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
49801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
50801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /*
51801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   Loads the effect library which path is given as first argument.
52801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   This must be the full path of a dynamic library (.so) implementing one or
53801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   more effect engines and exposing the effect library interface described in
54801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   EffectApi.h. The function returns a handle on the library for use by
55801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   further call to unloadEffectLibrary() to unload the library.
56801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
57801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   Parameters:
58801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          libPath:    full path of the dynamic library file in the file system.
59801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          handle:     address where to return the library handle
60801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
61801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   Returned status (from utils/Errors.h) can be:
62801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          NO_ERROR    successful operation.
63801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          PERMISSION_DENIED could not get AudioFlinger interface or
64801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *                      application does not have permission to configure audio
65801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          NO_INIT     effect factory not initialized or
66801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *                      library could not be loaded or
67801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *                      library does not implement required functions
68801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          BAD_VALUE   invalid libPath string or handle
69801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
70801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   Returned value:
71801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          *handle updated with library handle
72801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
73801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    static status_t loadEffectLibrary(const char *libPath, int *handle);
74801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
75801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /*
76801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   Unloads the effect library which handle is given as argument.
77801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
78801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   Parameters:
79801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          handle: library handle
80801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
81801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   Returned status (from utils/Errors.h) can be:
82801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          NO_ERROR    successful operation.
83801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          PERMISSION_DENIED could not get AudioFlinger interface or
84801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *                      application does not have permission to configure audio
85801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          NO_INIT     effect factory not initialized
86801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          BAD_VALUE   invalid handle
87801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
88801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    static status_t unloadEffectLibrary(int handle);
89801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
90801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /*
91801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  Static methods for effects enumeration.
92801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
93801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
94801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /*
95801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returns the number of effects available. This method together
96ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent     * with queryEffect() is used to enumerate all effects:
97801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * The enumeration sequence is:
98ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent     *      queryNumberEffects(&num_effects);
99ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent     *      for (i = 0; i < num_effects; i++)
100ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent     *          queryEffect(i,...);
101801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
102801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Parameters:
103ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent     *      numEffects:    address where the number of effects should be returned.
104801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
105801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returned status (from utils/Errors.h) can be:
106801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      NO_ERROR   successful operation.
107801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      PERMISSION_DENIED could not get AudioFlinger interface
108801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      NO_INIT    effect library failed to initialize
109801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      BAD_VALUE  invalid numEffects pointer
110801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
111801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returned value
112801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   *numEffects:     updated with number of effects available
113801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
114801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    static status_t queryNumberEffects(uint32_t *numEffects);
115801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
116801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /*
117ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent     * Returns an effect descriptor during effect
118801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * enumeration.
119801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
120801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Parameters:
121ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent     *      index:      index of the queried effect.
122ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent     *      descriptor: address where the effect descriptor should be returned.
123801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
124801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returned status (from utils/Errors.h) can be:
125801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      NO_ERROR        successful operation.
126801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      PERMISSION_DENIED could not get AudioFlinger interface
127801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      NO_INIT         effect library failed to initialize
128ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent     *      BAD_VALUE       invalid descriptor pointer or index
129801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      INVALID_OPERATION  effect list has changed since last execution of queryNumberEffects()
130801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
131801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returned value
132801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   *descriptor:     updated with effect descriptor
133801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
134ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent    static status_t queryEffect(uint32_t index, effect_descriptor_t *descriptor);
135801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
136801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
137801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /*
138801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returns the descriptor for the specified effect uuid.
139801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
140801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Parameters:
141801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      uuid:       pointer to effect uuid.
142801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      descriptor: address where the effect descriptor should be returned.
143801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
144801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returned status (from utils/Errors.h) can be:
145801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      NO_ERROR        successful operation.
146801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      PERMISSION_DENIED could not get AudioFlinger interface
147801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      NO_INIT         effect library failed to initialize
148801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      BAD_VALUE       invalid uuid or descriptor pointers
149801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      NAME_NOT_FOUND  no effect with this uuid found
150801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
151801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returned value
152801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *   *descriptor updated with effect descriptor
153801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
154801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    static status_t getEffectDescriptor(effect_uuid_t *uuid, effect_descriptor_t *descriptor);
155801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
156801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
157801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /*
158801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Events used by callback function (effect_callback_t).
159801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
160801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    enum event_type {
161801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent        EVENT_CONTROL_STATUS_CHANGED = 0,
162801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent        EVENT_ENABLE_STATUS_CHANGED = 1,
163801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent        EVENT_PARAMETER_CHANGED = 2,
164801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent        EVENT_ERROR = 3
165801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    };
166801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
167801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Callback function notifying client application of a change in effect engine state or
168801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * configuration.
169801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * An effect engine can be shared by several applications but only one has the control
170801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * of the engine activity and configuration at a time.
171801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * The EVENT_CONTROL_STATUS_CHANGED event is received when an application loses or
172801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * retrieves the control of the effect engine. Loss of control happens
173801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * if another application requests the use of the engine by creating an AudioEffect for
174801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * the same effect type but with a higher priority. Control is returned when the
175801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * application having the control deletes its AudioEffect object.
176801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * The EVENT_ENABLE_STATUS_CHANGED event is received by all applications not having the
177801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * control of the effect engine when the effect is enabled or disabled.
178801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * The EVENT_PARAMETER_CHANGED event is received by all applications not having the
179801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * control of the effect engine when an effect parameter is changed.
180801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * The EVENT_ERROR event is received when the media server process dies.
181801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
182801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Parameters:
183801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
184801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * event:   type of event notified (see enum AudioEffect::event_type).
185801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * user:    Pointer to context for use by the callback receiver.
186801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * info:    Pointer to optional parameter according to event type:
187801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - EVENT_CONTROL_STATUS_CHANGED:  boolean indicating if control is granted (true)
188801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  or stolen (false).
189801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - EVENT_ENABLE_STATUS_CHANGED: boolean indicating if effect is now enabled (true)
190801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  or disabled (false).
191801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - EVENT_PARAMETER_CHANGED: pointer to a effect_param_t structure.
192801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - EVENT_ERROR:  status_t indicating the error (DEAD_OBJECT when media server dies).
193801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
194801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
195801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    typedef void (*effect_callback_t)(int32_t event, void* user, void *info);
196801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
197801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
198801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Constructor.
199801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * AudioEffect is the base class for creating and controlling an effect engine from
200801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * the application process. Creating an AudioEffect object will create the effect engine
201801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * in the AudioFlinger if no engine of the specified type exists. If one exists, this engine
202801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * will be used. The application creating the AudioEffect object (or a derived class like
203801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Reverb for instance) will either receive control of the effect engine or not, depending
204801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * on the priority parameter. If priority is higher than the priority used by the current
205801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * effect engine owner, the control will be transfered to the new application. Otherwise
206801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * control will remain to the previous application. In this case, the new application will be
207801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * notified of changes in effect engine state or control ownership by the effect callback.
208801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * After creating the AudioEffect, the application must call the initCheck() method and
209801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * check the creation status before trying to control the effect engine (see initCheck()).
210801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * If the effect is to be applied to an AudioTrack or MediaPlayer only the application
211801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * must specify the audio session ID corresponding to this player.
212801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
213801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
214801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Simple Constructor.
215801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
216801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    AudioEffect();
217801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
218801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
219801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Constructor.
220801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
221801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Parameters:
222801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
223801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * type:  type of effect created: can be null if uuid is specified. This corresponds to
224801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *        the OpenSL ES interface implemented by this effect.
225801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * uuid:  Uuid of effect created: can be null if type is specified. This uuid corresponds to
226801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *        a particular implementation of an effect type.
227801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * priority:    requested priority for effect control: the priority level corresponds to the
228801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      value of priority parameter: negative values indicate lower priorities, positive values
229801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      higher priorities, 0 being the normal priority.
230801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * cbf:         optional callback function (see effect_callback_t)
231801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * user:        pointer to context for use by the callback receiver.
232801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * sessionID:   audio session this effect is associated to. If 0, the effect will be global to
233801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      the output mix. If not 0, the effect will be applied to all players
234801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      (AudioTrack or MediaPLayer) within the same audio session.
235801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * output:  HAL audio output stream to which this effect must be attached. Leave at 0 for
236801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      automatic output selection by AudioFlinger.
237801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
238801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
239801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    AudioEffect(const effect_uuid_t *type,
240801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                const effect_uuid_t *uuid = NULL,
241801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                  int32_t priority = 0,
242801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                  effect_callback_t cbf = 0,
243801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                  void* user = 0,
244801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                  int sessionId = 0,
245801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                  audio_io_handle_t output = 0
246801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                  );
247801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
248801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Constructor.
249801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      Same as above but with type and uuid specified by character strings
250801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
251801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    AudioEffect(const char *typeStr,
252801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                    const char *uuidStr = NULL,
253801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                    int32_t priority = 0,
254801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                    effect_callback_t cbf = 0,
255801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                    void* user = 0,
256801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                    int sessionId = 0,
257801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                    audio_io_handle_t output = 0
258801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                    );
259801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
260801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Terminates the AudioEffect and unregisters it from AudioFlinger.
261801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * The effect engine is also destroyed if this AudioEffect was the last controlling
262801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * the engine.
263801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
264801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                        ~AudioEffect();
265801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
266801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Initialize an uninitialized AudioEffect.
267801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    * Returned status (from utils/Errors.h) can be:
268801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    *  - NO_ERROR or ALREADY_EXISTS: successful initialization
269801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    *  - INVALID_OPERATION: AudioEffect is already initialized
270801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    *  - BAD_VALUE: invalid parameter
271801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    *  - NO_INIT: audio flinger or audio hardware not initialized
272801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    * */
273801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent            status_t    set(const effect_uuid_t *type,
274801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                            const effect_uuid_t *uuid = NULL,
275801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                            int32_t priority = 0,
276801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                            effect_callback_t cbf = 0,
277801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                            void* user = 0,
278801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                            int sessionId = 0,
279801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                            audio_io_handle_t output = 0
280801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent                            );
281801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
282801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Result of constructing the AudioEffect. This must be checked
283801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * before using any AudioEffect API.
284801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * initCheck() can return:
285801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - NO_ERROR:    the effect engine is successfully created and the application has control.
286801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - ALREADY_EXISTS: the effect engine is successfully created but the application does not
287801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *              have control.
288801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - NO_INIT:     the effect creation failed.
289801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
290801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
291801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent            status_t    initCheck() const;
292801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
293801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
294801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Returns the unique effect Id for the controlled effect engine. This ID is unique
295801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * system wide and is used for instance in the case of auxiliary effects to attach
296801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * the effect to an AudioTrack or MediaPlayer.
297801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
298801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
299801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent            int32_t     id() const { return mId; }
300801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
301801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Returns a descriptor for the effect (see effect_descriptor_t in EffectApi.h).
302801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
303801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent            effect_descriptor_t descriptor() const;
304801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
305801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Returns effect control priority of this AudioEffect object.
306801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
307801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent            int32_t     priority() const { return mPriority; }
308801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
309801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
310da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent    /* Enables or disables the effect engine.
311801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
312801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Parameters:
313da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     *  enabled: requested enable state.
314801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
315801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returned status (from utils/Errors.h) can be:
316801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - NO_ERROR: successful operation
317da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     *  - INVALID_OPERATION: the application does not have control of the effect engine or the
318da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     *  effect is already in the requested state.
319801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
320da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent    virtual status_t    setEnabled(bool enabled);
321da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent            bool        getEnabled() const;
322801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
323801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Sets a parameter value.
324801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
325801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Parameters:
326801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      param:  pointer to effect_param_t structure containing the parameter
327801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          and its value (See EffectApi.h).
328801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returned status (from utils/Errors.h) can be:
329801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - NO_ERROR: successful operation.
330801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - INVALID_OPERATION: the application does not have control of the effect engine.
331801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - BAD_VALUE: invalid parameter identifier or value.
332801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - DEAD_OBJECT: the effect engine has been deleted.
333801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
334da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     virtual status_t   setParameter(effect_param_t *param);
335801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
336801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Prepare a new parameter value that will be set by next call to
337801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * setParameterCommit(). This method can be used to set multiple parameters
338801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * in a synchronous manner or to avoid multiple binder calls for each
339801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * parameter.
340801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
341801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Parameters:
342801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      param:  pointer to effect_param_t structure containing the parameter
343801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          and its value (See EffectApi.h).
344801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
345801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returned status (from utils/Errors.h) can be:
346801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - NO_ERROR: successful operation.
347801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - INVALID_OPERATION: the application does not have control of the effect engine.
348801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - NO_MEMORY: no more space available in shared memory used for deferred parameter
349801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  setting.
350801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
351da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     virtual status_t   setParameterDeferred(effect_param_t *param);
352801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
353801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     /* Commit all parameter values previously prepared by setParameterDeferred().
354801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      *
355801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      * Parameters:
356801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      *     none
357801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      *
358801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      * Returned status (from utils/Errors.h) can be:
359801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      *  - NO_ERROR: successful operation.
360801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      *  - INVALID_OPERATION: No new parameter values ready for commit.
361801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      *  - BAD_VALUE: invalid parameter identifier or value: there is no indication
362801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      *     as to which of the parameters caused this error.
363801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      *  - DEAD_OBJECT: the effect engine has been deleted.
364801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      */
365da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     virtual status_t   setParameterCommit();
366801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
367801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    /* Gets a parameter value.
368801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
369801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Parameters:
370801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *      param:  pointer to effect_param_t structure containing the parameter
371801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *          and the returned value (See EffectApi.h).
372801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *
373801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     * Returned status (from utils/Errors.h) can be:
374801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - NO_ERROR: successful operation.
375801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - INVALID_OPERATION: the AudioEffect was not successfully initialized.
376801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - BAD_VALUE: invalid parameter identifier.
377801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     *  - DEAD_OBJECT: the effect engine has been deleted.
378801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     */
379da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     virtual status_t   getParameter(effect_param_t *param);
380801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
381801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     /* Sends a command and receives a response to/from effect engine.
382801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      *     See EffectApi.h for details on effect command() function, valid command codes
383801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      *     and formats.
384801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      */
385da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     virtual status_t command(int32_t cmdCode,
386da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent                              int32_t cmdSize,
387da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent                              void *cmdData,
388da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent                              int32_t *replySize,
389da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent                              void *replyData);
390801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
391801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
392801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     /*
393801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      * Utility functions.
394801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      */
395801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
396801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     /* Converts the string passed as first argument to the effect_uuid_t
397801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      * pointed to by second argument
398801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      */
399801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     static status_t stringToGuid(const char *str, effect_uuid_t *guid);
400801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     /* Converts the effect_uuid_t pointed to by first argument to the
401801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      * string passed as second argument
402801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent      */
403801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     static status_t guidToString(const effect_uuid_t *guid, char *str, size_t maxLen);
404801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
405da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurentprotected:
406da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     volatile int32_t        mEnabled;           // enable state
407da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     int32_t                 mSessionId;         // audio session ID
408da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     int32_t                 mPriority;          // priority for effect control
409da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     status_t                mStatus;            // effect status
410da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     effect_callback_t       mCbf;               // callback function for status, control and
411da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent                                                 // parameter changes notifications
412da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     void*                   mUserData;          // client context for callback function
413da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     effect_descriptor_t     mDescriptor;        // effect descriptor
414da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent     int32_t                 mId;                // system wide unique effect engine instance ID
415da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent
416801a1186eb1d2ce195b15222701865932e08f3dcEric Laurentprivate:
417801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
418801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent     // Implements the IEffectClient interface
419801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    class EffectClient : public android::BnEffectClient,  public android::IBinder::DeathRecipient
420801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    {
421801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    public:
422801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
423801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent        EffectClient(AudioEffect *effect) : mEffect(effect){}
424801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
425801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent        // IEffectClient
426da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent        virtual void controlStatusChanged(bool controlGranted) {
427da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent            mEffect->controlStatusChanged(controlGranted);
428da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent        }
429da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent        virtual void enableStatusChanged(bool enabled) {
430da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent            mEffect->enableStatusChanged(enabled);
431da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent        }
432da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent        virtual void commandExecuted(int cmdCode,
433da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent                                     int cmdSize,
434da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent                                     void *pCmdData,
435da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent                                     int replySize,
436da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent                                     void *pReplyData) {
437801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent            mEffect->commandExecuted(cmdCode, cmdSize, pCmdData, replySize, pReplyData);
438801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent        }
439801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
440801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent        // IBinder::DeathRecipient
441801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent        virtual void binderDied(const wp<IBinder>& who) {mEffect->binderDied();}
442801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
443801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    private:
444801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent        AudioEffect *mEffect;
445801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    };
446801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
447801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
448801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    friend class EffectClient;
449801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
450801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    // IEffectClient
451801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    void controlStatusChanged(bool controlGranted);
452801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    void enableStatusChanged(bool enabled);
453801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    void commandExecuted(int cmdCode, int cmdSize, void *pCmdData, int replySize, void *pReplyData);
454801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    void binderDied();
455801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
456801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
457801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    sp<IEffect>             mIEffect;           // IEffect binder interface
458801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    sp<EffectClient>        mIEffectClient;     // IEffectClient implementation
459801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    sp<IMemory>             mCblkMemory;        // shared memory for deferred parameter setting
460801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent    effect_param_cblk_t*    mCblk;              // control block for deferred parameter setting
461801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent};
462801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
463801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
464801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent}; // namespace android
465801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent
466801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#endif // ANDROID_AUDIOEFFECT_H
467