From 5baf2af52cd186633b7173196c1e4a4cd3435f22 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 12 Sep 2013 17:37:00 -0700 Subject: more support for audio effect offload Offloading of audio effects is now enabled for offloaded output threads. If an effect not supporting offload is enabled, the AudioTrack is invalidated so that it can be recreated in PCM mode. Fix some issues in effect proxy related to handling of effect commands to offloaded and non offloaded effects. Also fixed a bug on capture index in software Visualizer effect. Bug: 8174034. Change-Id: Ib23d3c2d5a652361b0aaec7faee09102f2b18fce --- services/audioflinger/Effects.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'services/audioflinger/Effects.h') diff --git a/services/audioflinger/Effects.h b/services/audioflinger/Effects.h index bac50f2..c35cff0 100644 --- a/services/audioflinger/Effects.h +++ b/services/audioflinger/Effects.h @@ -111,6 +111,10 @@ public: bool purgeHandles(); void lock() { mLock.lock(); } void unlock() { mLock.unlock(); } + bool isOffloadable() const + { return (mDescriptor.flags & EFFECT_FLAG_OFFLOAD_SUPPORTED) != 0; } + status_t setOffloaded(bool offloaded, audio_io_handle_t io); + bool isOffloaded() const; void dump(int fd, const Vector& args); @@ -144,6 +148,7 @@ mutable Mutex mLock; // mutex for process, commands and handl // sending disable command. uint32_t mDisableWaitCnt; // current process() calls count during disable period. bool mSuspended; // effect is suspended: temporarily disabled by framework + bool mOffloaded; // effect is currently offloaded to the audio DSP }; // The EffectHandle class implements the IEffect interface. It provides resources @@ -303,8 +308,8 @@ public: void clearInputBuffer(); - // At least one effect in the chain is enabled - bool isEnabled(); + // At least one non offloadable effect in the chain is enabled + bool isNonOffloadableEnabled(); void dump(int fd, const Vector& args); -- cgit v1.1