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
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 @@
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<String16>& args);
@@ -144,6 +148,7 @@
// 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 @@
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<String16>& args);