diff options
Diffstat (limited to 'services/audioflinger/Effects.h')
-rw-r--r-- | services/audioflinger/Effects.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/services/audioflinger/Effects.h b/services/audioflinger/Effects.h index b717857..6f93f81 100644 --- a/services/audioflinger/Effects.h +++ b/services/audioflinger/Effects.h @@ -119,6 +119,7 @@ public: { return (mDescriptor.flags & EFFECT_FLAG_OFFLOAD_SUPPORTED) != 0; } status_t setOffloaded(bool offloaded, audio_io_handle_t io); bool isOffloaded() const; + void addEffectToHal_l(); void dump(int fd, const Vector<String16>& args); @@ -153,6 +154,7 @@ mutable Mutex mLock; // mutex for process, commands and handl 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 + wp<AudioFlinger> mAudioFlinger; }; // The EffectHandle class implements the IEffect interface. It provides resources @@ -169,6 +171,7 @@ public: const sp<IEffectClient>& effectClient, int32_t priority); virtual ~EffectHandle(); + virtual status_t initCheck(); // IEffect virtual status_t enable(); @@ -208,7 +211,7 @@ public: // destroyed_l() must be called with the associated EffectModule mLock held bool destroyed_l() const { return mDestroyed; } - void dump(char* buffer, size_t size); + void dumpToBuffer(char* buffer, size_t size); protected: friend class AudioFlinger; // for mEffect, mHasControl, mEnabled @@ -269,6 +272,7 @@ public: sp<EffectModule> getEffectFromDesc_l(effect_descriptor_t *descriptor); sp<EffectModule> getEffectFromId_l(int id); sp<EffectModule> getEffectFromType_l(const effect_uuid_t *type); + // FIXME use float to improve the dynamic range bool setVolume_l(uint32_t *left, uint32_t *right); void setDevice_l(audio_devices_t device); void setMode_l(audio_mode_t mode); @@ -315,6 +319,14 @@ public: // At least one non offloadable effect in the chain is enabled bool isNonOffloadableEnabled(); + // use release_cas because we don't care about the observed value, just want to make sure the + // new value is observable. + void forceVolume() { android_atomic_release_cas(false, true, &mForceVolume); } + // use acquire_cas because we are interested in the observed value and + // we are the only observers. + bool isVolumeForced() { return (android_atomic_acquire_cas(true, false, &mForceVolume) == 0); } + + void syncHalEffectsState(); void dump(int fd, const Vector<String16>& args); @@ -345,6 +357,8 @@ protected: void clearInputBuffer_l(sp<ThreadBase> thread); + void setThread(const sp<ThreadBase>& thread); + wp<ThreadBase> mThread; // parent mixer thread Mutex mLock; // mutex protecting effect list Vector< sp<EffectModule> > mEffects; // list of effect modules @@ -370,4 +384,5 @@ protected: // timeLow fields among effect type UUIDs. // Updated by updateSuspendedSessions_l() only. KeyedVector< int, sp<SuspendedEffectDesc> > mSuspendedEffects; + volatile int32_t mForceVolume; // force next volume command because a new effect was enabled }; |