From 3476de62fb10e76412452ef4c6bd71936c9f7db1 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Sun, 15 Apr 2012 17:15:07 -0700 Subject: Add support for scaling mode parameter Support VISUALIZER_PARAM__SCALING_MODE parameter. Modify process() function to use new volume scaling parameter, used to set whether captured values are maximized by current headroom in the buffer (default existing behaviora) or left as is and thus affected by volume. Modify AudioEffect to allow subclasses to override the following events: control status changed, enable status changed, command executed. In Visualizer class (a subclass of AudioEffect), reset the scaling mode and capture size on the actual effect as cached when control is regained. This will allow the effect to be properly configured whenever Visualizers with different scaling modes or capture sizes are released (e.g. from java release() method). Change-Id: I05cb9f925a296dceca91bafa9fe294ef2b2c2bd5 --- include/media/AudioEffect.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'include/media/AudioEffect.h') diff --git a/include/media/AudioEffect.h b/include/media/AudioEffect.h index 02dfc1b..05d834d 100644 --- a/include/media/AudioEffect.h +++ b/include/media/AudioEffect.h @@ -402,6 +402,15 @@ protected: int32_t mId; // system wide unique effect engine instance ID Mutex mLock; // Mutex for mEnabled access + // IEffectClient + virtual void controlStatusChanged(bool controlGranted); + virtual void enableStatusChanged(bool enabled); + virtual void commandExecuted(uint32_t cmdCode, + uint32_t cmdSize, + void *pCmdData, + uint32_t replySize, + void *pReplyData); + private: // Implements the IEffectClient interface @@ -433,20 +442,8 @@ private: AudioEffect *mEffect; }; - - friend class EffectClient; - - // IEffectClient - void controlStatusChanged(bool controlGranted); - void enableStatusChanged(bool enabled); - void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData); void binderDied(); - sp mIEffect; // IEffect binder interface sp mIEffectClient; // IEffectClient implementation sp mCblkMemory; // shared memory for deferred parameter setting -- cgit v1.1