diff options
author | Andy Hung <hunga@google.com> | 2014-03-04 14:46:50 -0800 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2014-03-10 11:48:49 -0700 |
commit | 98ef978df4e928f486d244c4d7f7ad9f13111e98 (patch) | |
tree | 3ea9f5800c87d0b52ae07fdb6be2b231d827558a /services/audioflinger/Threads.h | |
parent | 07c34a59fee02ab0732e84a2e2ff3b928de50ebc (diff) | |
download | frameworks_av-98ef978df4e928f486d244c4d7f7ad9f13111e98.zip frameworks_av-98ef978df4e928f486d244c4d7f7ad9f13111e98.tar.gz frameworks_av-98ef978df4e928f486d244c4d7f7ad9f13111e98.tar.bz2 |
Add mEffectBuffer to AudioFlinger
Change-Id: Icf97c50040bc127723d56eb4d2fb6e790a7253d9
Signed-off-by: Andy Hung <hunga@google.com>
Diffstat (limited to 'services/audioflinger/Threads.h')
-rw-r--r-- | services/audioflinger/Threads.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h index 96642ff..3af4874 100644 --- a/services/audioflinger/Threads.h +++ b/services/audioflinger/Threads.h @@ -484,6 +484,15 @@ protected: int16_t* mSinkBuffer; // frame size aligned sink buffer + // TODO: + // Rearrange the buffer info into a struct/class with + // clear, copy, construction, destruction methods. + // + // mSinkBuffer also has associated with it: + // + // mSinkBufferSize: Sink Buffer Size + // mFormat: Sink Buffer Format + // Mixer Buffer (mMixerBuffer*) // // In the case of floating point or multichannel data, which is not in the @@ -507,6 +516,32 @@ protected: // when mMixerBuffer contains valid data after mixing. bool mMixerBufferValid; + // Effects Buffer (mEffectsBuffer*) + // + // In the case of effects data, which is not in the sink format, + // it is required to accumulate in a different buffer before data conversion + // to the sink buffer. + + // Set to "true" to enable the Effects Buffer otherwise effects output goes to sink buffer. + bool mEffectBufferEnabled; + + // Storage, 32 byte aligned (may make this alignment a requirement later). + // Due to constraints on mNormalFrameCount, the buffer size is a multiple of 16 frames. + void* mEffectBuffer; + + // Size of mEffectsBuffer in bytes: mNormalFrameCount * #channels * sampsize. + size_t mEffectBufferSize; + + // The audio format of mEffectsBuffer. Set to AUDIO_FORMAT_PCM_16_BIT only. + audio_format_t mEffectBufferFormat; + + // An internal flag set to true by MixerThread::prepareTracks_l() + // when mEffectsBuffer contains valid data after mixing. + // + // When this is set, all mixer data is routed into the effects buffer + // for any processing (including output processing). + bool mEffectBufferValid; + // suspend count, > 0 means suspended. While suspended, the thread continues to pull from // tracks and mix, but doesn't write to HAL. A2DP and SCO HAL implementations can't handle // concurrent use of both of them, so Audio Policy Service suspends one of the threads to |