summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/FastMixer.cpp
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-05-12 16:51:41 -0700
committerAndy Hung <hunga@google.com>2014-05-23 22:11:16 -0700
commitef7c7fbd0e3fb36af14cd7d39f64c949031516a5 (patch)
tree94f9ef7ecba0cfdbfae659013923d261ccf19e40 /services/audioflinger/FastMixer.cpp
parente8a1ced4da17dc6c07803dc2af8060f62a8389c1 (diff)
downloadframeworks_av-ef7c7fbd0e3fb36af14cd7d39f64c949031516a5.zip
frameworks_av-ef7c7fbd0e3fb36af14cd7d39f64c949031516a5.tar.gz
frameworks_av-ef7c7fbd0e3fb36af14cd7d39f64c949031516a5.tar.bz2
Add multiple format capability to AudioMixer
Change-Id: I04ac1cafd90b6ed652f8d51888ad07576678f0bc Signed-off-by: Andy Hung <hunga@google.com>
Diffstat (limited to 'services/audioflinger/FastMixer.cpp')
-rw-r--r--services/audioflinger/FastMixer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp
index 9e9f20d..f7cc8aa 100644
--- a/services/audioflinger/FastMixer.cpp
+++ b/services/audioflinger/FastMixer.cpp
@@ -232,6 +232,8 @@ void FastMixer::onStateChange()
mixer->setParameter(name, AudioMixer::TRACK, AudioMixer::MAIN_BUFFER,
(void *) mixBuffer);
// newly allocated track names default to full scale volume
+ mixer->setParameter(name, AudioMixer::TRACK, AudioMixer::FORMAT,
+ (void *)(uintptr_t)fastTrack->mFormat);
mixer->enable(name);
}
generations[i] = fastTrack->mGeneration;
@@ -260,6 +262,8 @@ void FastMixer::onStateChange()
}
mixer->setParameter(name, AudioMixer::RESAMPLE,
AudioMixer::REMOVE, NULL);
+ mixer->setParameter(name, AudioMixer::TRACK, AudioMixer::FORMAT,
+ (void *)(uintptr_t)fastTrack->mFormat);
mixer->setParameter(name, AudioMixer::TRACK, AudioMixer::CHANNEL_MASK,
(void *)(uintptr_t) fastTrack->mChannelMask);
// already enabled
@@ -282,7 +286,7 @@ void FastMixer::onWork()
const size_t frameCount = current->mFrameCount;
if ((command & FastMixerState::MIX) && (mixer != NULL) && isWarm) {
- ALOG_ASSERT(mixBuffer != NULL);
+ ALOG_ASSERT(mMixerBuffer != NULL);
// for each track, update volume and check for underrun
unsigned currentTrackMask = current->mTrackMask;
while (currentTrackMask != 0) {