AudioEffect.h revision 57dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfc
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> 2457dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent#include <media/IAudioPolicyService.h> 25801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <media/IEffect.h> 26801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <media/IEffectClient.h> 27e1315cf0b63b4c14a77046519e6b01f6f60d74b0Eric Laurent#include <hardware/audio_effect.h> 28801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <media/AudioSystem.h> 29801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 30801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <utils/RefBase.h> 31801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <utils/Errors.h> 32801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#include <binder/IInterface.h> 33801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 34801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 35801a1186eb1d2ce195b15222701865932e08f3dcEric Laurentnamespace android { 36801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 37801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent// ---------------------------------------------------------------------------- 38801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 39801a1186eb1d2ce195b15222701865932e08f3dcEric Laurentclass effect_param_cblk_t; 40801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 41801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent// ---------------------------------------------------------------------------- 42801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 43801a1186eb1d2ce195b15222701865932e08f3dcEric Laurentclass AudioEffect : public RefBase 44801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent{ 45801a1186eb1d2ce195b15222701865932e08f3dcEric Laurentpublic: 46801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 47801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* 48801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Static methods for effects enumeration. 49801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 50801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 51801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* 52801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returns the number of effects available. This method together 53ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent * with queryEffect() is used to enumerate all effects: 54801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * The enumeration sequence is: 55ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent * queryNumberEffects(&num_effects); 56ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent * for (i = 0; i < num_effects; i++) 57ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent * queryEffect(i,...); 58801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 59801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Parameters: 60ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent * numEffects: address where the number of effects should be returned. 61801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 62801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned status (from utils/Errors.h) can be: 63801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * NO_ERROR successful operation. 64801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * PERMISSION_DENIED could not get AudioFlinger interface 65801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * NO_INIT effect library failed to initialize 66801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * BAD_VALUE invalid numEffects pointer 67801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 68801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned value 69801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * *numEffects: updated with number of effects available 70801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 71801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent static status_t queryNumberEffects(uint32_t *numEffects); 72801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 73801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* 74ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent * Returns an effect descriptor during effect 75801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * enumeration. 76801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 77801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Parameters: 78ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent * index: index of the queried effect. 79ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent * descriptor: address where the effect descriptor should be returned. 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 84801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * NO_INIT effect library failed to initialize 85ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent * BAD_VALUE invalid descriptor pointer or index 86801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * INVALID_OPERATION effect list has changed since last execution of queryNumberEffects() 87801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 88801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned value 89801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * *descriptor: updated with effect descriptor 90801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 91ffe9c25ce85e1af55d58ec025adc6367d70db7e8Eric Laurent static status_t queryEffect(uint32_t index, effect_descriptor_t *descriptor); 92801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 93801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 94801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* 95801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returns the descriptor for the specified effect uuid. 96801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 97801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Parameters: 98801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * uuid: pointer to effect uuid. 99801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * descriptor: address where the effect descriptor should be returned. 100801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 101801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned status (from utils/Errors.h) can be: 102801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * NO_ERROR successful operation. 103801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * PERMISSION_DENIED could not get AudioFlinger interface 104801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * NO_INIT effect library failed to initialize 105801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * BAD_VALUE invalid uuid or descriptor pointers 106801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * NAME_NOT_FOUND no effect with this uuid found 107801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 108801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned value 109801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * *descriptor updated with effect descriptor 110801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 111801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent static status_t getEffectDescriptor(effect_uuid_t *uuid, effect_descriptor_t *descriptor); 112801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 113801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 114801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* 11557dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * Returns a list of descriptors corresponding to the pre processings enabled by default 11657dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * on an AudioRecord with the supplied audio session ID. 11757dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * 11857dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * Parameters: 11957dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * audioSession: audio session ID. 12057dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * descriptors: address where the effect descriptors should be returned. 12157dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * count: as input, the maximum number of descriptor than should be returned 12257dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * as output, the number of descriptor returned if status is NO_ERROR or the actual 12357dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * number of enabled pre processings if status is NO_MEMORY 12457dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * 12557dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * Returned status (from utils/Errors.h) can be: 12657dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * NO_ERROR successful operation. 12757dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * NO_MEMORY the number of descriptor to return is more than the maximum number 12857dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * indicated by count. 12957dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * PERMISSION_DENIED could not get AudioFlinger interface 13057dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * NO_INIT effect library failed to initialize 13157dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * BAD_VALUE invalid audio session or descriptor pointers 13257dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * 13357dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * Returned value 13457dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * *descriptor updated with descriptors of pre processings enabled by default 13557dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * *count number of descriptors returned if returned status is N_ERROR. 13657dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * total number of pre processing enabled by default if returned status is 13757dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * NO_MEMORY. This happens if the count passed as input is less than the number 13857dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent * of descriptors to return 13957dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent */ 14057dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent static status_t queryDefaultPreProcessing(int audioSession, 14157dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent effect_descriptor_t *descriptors, 14257dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent uint32_t *count); 14357dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent 14457dae99c9fcd6becd2b5ed0c53f277ba4d7dbcfcEric Laurent /* 145801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Events used by callback function (effect_callback_t). 146801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 147801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent enum event_type { 148801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent EVENT_CONTROL_STATUS_CHANGED = 0, 149801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent EVENT_ENABLE_STATUS_CHANGED = 1, 150801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent EVENT_PARAMETER_CHANGED = 2, 151801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent EVENT_ERROR = 3 152801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent }; 153801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 154801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Callback function notifying client application of a change in effect engine state or 155801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * configuration. 156801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * An effect engine can be shared by several applications but only one has the control 157801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * of the engine activity and configuration at a time. 158801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * The EVENT_CONTROL_STATUS_CHANGED event is received when an application loses or 159801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * retrieves the control of the effect engine. Loss of control happens 160801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * if another application requests the use of the engine by creating an AudioEffect for 161801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * the same effect type but with a higher priority. Control is returned when the 162801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * application having the control deletes its AudioEffect object. 163801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * The EVENT_ENABLE_STATUS_CHANGED event is received by all applications not having the 164801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * control of the effect engine when the effect is enabled or disabled. 165801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * The EVENT_PARAMETER_CHANGED event is received by all applications not having the 166801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * control of the effect engine when an effect parameter is changed. 167801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * The EVENT_ERROR event is received when the media server process dies. 168801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 169801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Parameters: 170801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 171801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * event: type of event notified (see enum AudioEffect::event_type). 172801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * user: Pointer to context for use by the callback receiver. 173801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * info: Pointer to optional parameter according to event type: 174801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - EVENT_CONTROL_STATUS_CHANGED: boolean indicating if control is granted (true) 175801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * or stolen (false). 176801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - EVENT_ENABLE_STATUS_CHANGED: boolean indicating if effect is now enabled (true) 177801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * or disabled (false). 178801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - EVENT_PARAMETER_CHANGED: pointer to a effect_param_t structure. 179801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - EVENT_ERROR: status_t indicating the error (DEAD_OBJECT when media server dies). 180801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 181801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 182801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent typedef void (*effect_callback_t)(int32_t event, void* user, void *info); 183801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 184801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 185801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Constructor. 186801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * AudioEffect is the base class for creating and controlling an effect engine from 187801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * the application process. Creating an AudioEffect object will create the effect engine 188801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * in the AudioFlinger if no engine of the specified type exists. If one exists, this engine 189801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * will be used. The application creating the AudioEffect object (or a derived class like 190801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Reverb for instance) will either receive control of the effect engine or not, depending 191801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * on the priority parameter. If priority is higher than the priority used by the current 192801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * effect engine owner, the control will be transfered to the new application. Otherwise 193801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * control will remain to the previous application. In this case, the new application will be 194801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * notified of changes in effect engine state or control ownership by the effect callback. 195801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * After creating the AudioEffect, the application must call the initCheck() method and 196801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * check the creation status before trying to control the effect engine (see initCheck()). 197801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * If the effect is to be applied to an AudioTrack or MediaPlayer only the application 198801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * must specify the audio session ID corresponding to this player. 199801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 200801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 201801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Simple Constructor. 202801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 203801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent AudioEffect(); 204801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 205801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 206801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Constructor. 207801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 208801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Parameters: 209801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 210801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * type: type of effect created: can be null if uuid is specified. This corresponds to 211801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * the OpenSL ES interface implemented by this effect. 212801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * uuid: Uuid of effect created: can be null if type is specified. This uuid corresponds to 213801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * a particular implementation of an effect type. 214801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * priority: requested priority for effect control: the priority level corresponds to the 215801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * value of priority parameter: negative values indicate lower priorities, positive values 216801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * higher priorities, 0 being the normal priority. 217801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * cbf: optional callback function (see effect_callback_t) 218801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * user: pointer to context for use by the callback receiver. 219801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * sessionID: audio session this effect is associated to. If 0, the effect will be global to 220801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * the output mix. If not 0, the effect will be applied to all players 221801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * (AudioTrack or MediaPLayer) within the same audio session. 2227c7f10bd4fda9a084e5e7f0eb3a040dfcbf01745Eric Laurent * io: HAL audio output or input stream to which this effect must be attached. Leave at 0 for 223801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * automatic output selection by AudioFlinger. 224801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 225801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 226801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent AudioEffect(const effect_uuid_t *type, 227801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent const effect_uuid_t *uuid = NULL, 228801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent int32_t priority = 0, 229801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent effect_callback_t cbf = 0, 230801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent void* user = 0, 231801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent int sessionId = 0, 2327c7f10bd4fda9a084e5e7f0eb3a040dfcbf01745Eric Laurent audio_io_handle_t io = 0 233801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent ); 234801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 235801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Constructor. 236801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Same as above but with type and uuid specified by character strings 237801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 238801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent AudioEffect(const char *typeStr, 239801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent const char *uuidStr = NULL, 240801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent int32_t priority = 0, 241801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent effect_callback_t cbf = 0, 242801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent void* user = 0, 243801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent int sessionId = 0, 2447c7f10bd4fda9a084e5e7f0eb3a040dfcbf01745Eric Laurent audio_io_handle_t io = 0 245801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent ); 246801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 247801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Terminates the AudioEffect and unregisters it from AudioFlinger. 248801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * The effect engine is also destroyed if this AudioEffect was the last controlling 249801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * the engine. 250801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 251801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent ~AudioEffect(); 252801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 253801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Initialize an uninitialized AudioEffect. 254801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned status (from utils/Errors.h) can be: 255801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - NO_ERROR or ALREADY_EXISTS: successful initialization 256801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - INVALID_OPERATION: AudioEffect is already initialized 257801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - BAD_VALUE: invalid parameter 258801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - NO_INIT: audio flinger or audio hardware not initialized 259801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * */ 260801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent status_t set(const effect_uuid_t *type, 261801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent const effect_uuid_t *uuid = NULL, 262801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent int32_t priority = 0, 263801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent effect_callback_t cbf = 0, 264801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent void* user = 0, 265801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent int sessionId = 0, 2667c7f10bd4fda9a084e5e7f0eb3a040dfcbf01745Eric Laurent audio_io_handle_t io = 0 267801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent ); 268801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 269801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Result of constructing the AudioEffect. This must be checked 270801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * before using any AudioEffect API. 271801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * initCheck() can return: 272801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - NO_ERROR: the effect engine is successfully created and the application has control. 273801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - ALREADY_EXISTS: the effect engine is successfully created but the application does not 274801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * have control. 275801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - NO_INIT: the effect creation failed. 276801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 277801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 278801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent status_t initCheck() const; 279801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 280801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 281801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Returns the unique effect Id for the controlled effect engine. This ID is unique 282801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * system wide and is used for instance in the case of auxiliary effects to attach 283801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * the effect to an AudioTrack or MediaPlayer. 284801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 285801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 286801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent int32_t id() const { return mId; } 287801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 288e1315cf0b63b4c14a77046519e6b01f6f60d74b0Eric Laurent /* Returns a descriptor for the effect (see effect_descriptor_t in audio_effect.h). 289801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 290801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent effect_descriptor_t descriptor() const; 291801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 292801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Returns effect control priority of this AudioEffect object. 293801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 294801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent int32_t priority() const { return mPriority; } 295801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 296801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 297da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent /* Enables or disables the effect engine. 298801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 299801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Parameters: 300da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent * enabled: requested enable state. 301801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 302801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned status (from utils/Errors.h) can be: 303801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - NO_ERROR: successful operation 304da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent * - INVALID_OPERATION: the application does not have control of the effect engine or the 305da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent * effect is already in the requested state. 306801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 307da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent virtual status_t setEnabled(bool enabled); 308da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent bool getEnabled() const; 309801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 310801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Sets a parameter value. 311801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 312801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Parameters: 313801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * param: pointer to effect_param_t structure containing the parameter 314e1315cf0b63b4c14a77046519e6b01f6f60d74b0Eric Laurent * and its value (See audio_effect.h). 315801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned status (from utils/Errors.h) can be: 316801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - NO_ERROR: successful operation. 317801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - INVALID_OPERATION: the application does not have control of the effect engine. 318801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - BAD_VALUE: invalid parameter identifier or value. 319801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - DEAD_OBJECT: the effect engine has been deleted. 320801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 321da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent virtual status_t setParameter(effect_param_t *param); 322801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 323801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Prepare a new parameter value that will be set by next call to 324801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * setParameterCommit(). This method can be used to set multiple parameters 325801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * in a synchronous manner or to avoid multiple binder calls for each 326801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * parameter. 327801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 328801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Parameters: 329801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * param: pointer to effect_param_t structure containing the parameter 330e1315cf0b63b4c14a77046519e6b01f6f60d74b0Eric Laurent * and its value (See audio_effect.h). 331801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 332801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned status (from utils/Errors.h) can be: 333801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - NO_ERROR: successful operation. 334801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - INVALID_OPERATION: the application does not have control of the effect engine. 335801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - NO_MEMORY: no more space available in shared memory used for deferred parameter 336801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * setting. 337801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 338da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent virtual status_t setParameterDeferred(effect_param_t *param); 339801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 340801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Commit all parameter values previously prepared by setParameterDeferred(). 341801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 342801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Parameters: 343801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * none 344801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 345801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned status (from utils/Errors.h) can be: 346801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - NO_ERROR: successful operation. 347801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - INVALID_OPERATION: No new parameter values ready for commit. 348801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - BAD_VALUE: invalid parameter identifier or value: there is no indication 349801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * as to which of the parameters caused this error. 350801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - DEAD_OBJECT: the effect engine has been deleted. 351801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 352da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent virtual status_t setParameterCommit(); 353801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 354801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Gets a parameter value. 355801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 356801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Parameters: 357801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * param: pointer to effect_param_t structure containing the parameter 358e1315cf0b63b4c14a77046519e6b01f6f60d74b0Eric Laurent * and the returned value (See audio_effect.h). 359801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * 360801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Returned status (from utils/Errors.h) can be: 361801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - NO_ERROR: successful operation. 362801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - INVALID_OPERATION: the AudioEffect was not successfully initialized. 363801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - BAD_VALUE: invalid parameter identifier. 364801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * - DEAD_OBJECT: the effect engine has been deleted. 365801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 366da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent virtual status_t getParameter(effect_param_t *param); 367801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 368801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Sends a command and receives a response to/from effect engine. 369e1315cf0b63b4c14a77046519e6b01f6f60d74b0Eric Laurent * See audio_effect.h for details on effect command() function, valid command codes 370801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * and formats. 371801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 37225f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent virtual status_t command(uint32_t cmdCode, 37325f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent uint32_t cmdSize, 374da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent void *cmdData, 37525f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent uint32_t *replySize, 376da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent void *replyData); 377801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 378801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 379801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* 380801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * Utility functions. 381801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 382801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 383801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Converts the string passed as first argument to the effect_uuid_t 384801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * pointed to by second argument 385801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 386801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent static status_t stringToGuid(const char *str, effect_uuid_t *guid); 387801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent /* Converts the effect_uuid_t pointed to by first argument to the 388801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent * string passed as second argument 389801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent */ 390801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent static status_t guidToString(const effect_uuid_t *guid, char *str, size_t maxLen); 391801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 392da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurentprotected: 393f5aafb209d01ba2ab6cb55d1a12cfc653e2b4be0Eric Laurent bool mEnabled; // enable state 394da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent int32_t mSessionId; // audio session ID 395da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent int32_t mPriority; // priority for effect control 396da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent status_t mStatus; // effect status 397da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent effect_callback_t mCbf; // callback function for status, control and 398da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent // parameter changes notifications 399da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent void* mUserData; // client context for callback function 400da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent effect_descriptor_t mDescriptor; // effect descriptor 401da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent int32_t mId; // system wide unique effect engine instance ID 402f5aafb209d01ba2ab6cb55d1a12cfc653e2b4be0Eric Laurent Mutex mLock; // Mutex for mEnabled access 403da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent 404801a1186eb1d2ce195b15222701865932e08f3dcEric Laurentprivate: 405801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 406801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent // Implements the IEffectClient interface 407801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent class EffectClient : public android::BnEffectClient, public android::IBinder::DeathRecipient 408801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent { 409801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent public: 410801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 411801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent EffectClient(AudioEffect *effect) : mEffect(effect){} 412801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 413801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent // IEffectClient 414da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent virtual void controlStatusChanged(bool controlGranted) { 415da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent mEffect->controlStatusChanged(controlGranted); 416da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent } 417da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent virtual void enableStatusChanged(bool enabled) { 418da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent mEffect->enableStatusChanged(enabled); 419da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent } 42025f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent virtual void commandExecuted(uint32_t cmdCode, 42125f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent uint32_t cmdSize, 422da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent void *pCmdData, 42325f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent uint32_t replySize, 424da7581b7b61b84f15e8d671c86fd117c322b009eEric Laurent void *pReplyData) { 425801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent mEffect->commandExecuted(cmdCode, cmdSize, pCmdData, replySize, pReplyData); 426801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent } 427801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 428801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent // IBinder::DeathRecipient 429801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent virtual void binderDied(const wp<IBinder>& who) {mEffect->binderDied();} 430801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 431801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent private: 432801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent AudioEffect *mEffect; 433801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent }; 434801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 435801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 436801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent friend class EffectClient; 437801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 438801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent // IEffectClient 439801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent void controlStatusChanged(bool controlGranted); 440801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent void enableStatusChanged(bool enabled); 44125f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent void commandExecuted(uint32_t cmdCode, 44225f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent uint32_t cmdSize, 44325f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent void *pCmdData, 44425f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent uint32_t replySize, 44525f4395b932fa9859a6e91ba77c5d20d009da64aEric Laurent void *pReplyData); 446801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent void binderDied(); 447801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 448801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 449801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent sp<IEffect> mIEffect; // IEffect binder interface 450801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent sp<EffectClient> mIEffectClient; // IEffectClient implementation 451801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent sp<IMemory> mCblkMemory; // shared memory for deferred parameter setting 452801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent effect_param_cblk_t* mCblk; // control block for deferred parameter setting 453801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent}; 454801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 455801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 456801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent}; // namespace android 457801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent 458801a1186eb1d2ce195b15222701865932e08f3dcEric Laurent#endif // ANDROID_AUDIOEFFECT_H 459