summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.h
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-02-25 17:24:40 -0800
committerAndy Hung <hunga@google.com>2014-02-27 18:45:57 -0800
commit69aed5f0f4a3be3996d1e78a0473e1a72c1547da (patch)
treefd8fcfcc236538dd9ef08f515e628b263933ee66 /services/audioflinger/Threads.h
parent25c2dac12114699e90deb1c579cadebce7b91a97 (diff)
downloadframeworks_av-69aed5f0f4a3be3996d1e78a0473e1a72c1547da.zip
frameworks_av-69aed5f0f4a3be3996d1e78a0473e1a72c1547da.tar.gz
frameworks_av-69aed5f0f4a3be3996d1e78a0473e1a72c1547da.tar.bz2
Add MixerBuffer for accumulation of float audio
Path into and out of MixerBuffer is set up, but not currently enabled. Change-Id: I9d50752607d22dd2a3d9cc7e053babf8dfb22958 Signed-off-by: Andy Hung <hunga@google.com>
Diffstat (limited to 'services/audioflinger/Threads.h')
-rw-r--r--services/audioflinger/Threads.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index b276ab2..96642ff 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -484,6 +484,29 @@ protected:
int16_t* mSinkBuffer; // frame size aligned sink buffer
+ // Mixer Buffer (mMixerBuffer*)
+ //
+ // In the case of floating point or multichannel data, which is not in the
+ // sink format, it is required to accumulate in a higher precision or greater channel count
+ // buffer before downmixing or data conversion to the sink buffer.
+
+ // Set to "true" to enable the Mixer Buffer otherwise mixer output goes to sink buffer.
+ bool mMixerBufferEnabled;
+
+ // 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* mMixerBuffer;
+
+ // Size of mMixerBuffer in bytes: mNormalFrameCount * #channels * sampsize.
+ size_t mMixerBufferSize;
+
+ // The audio format of mMixerBuffer. Set to AUDIO_FORMAT_PCM_(FLOAT|16_BIT) only.
+ audio_format_t mMixerBufferFormat;
+
+ // An internal flag set to true by MixerThread::prepareTracks_l()
+ // when mMixerBuffer contains valid data after mixing.
+ bool mMixerBufferValid;
+
// 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