summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioMixer.cpp
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-08-04 20:43:10 -0700
committerAndy Hung <hunga@google.com>2014-08-04 20:43:10 -0700
commit5241b8cacee86e17223695190959f4752910680f (patch)
tree7294f55179540aaf0c3050839d5193bb98c0cb3c /services/audioflinger/AudioMixer.cpp
parent63c0ce7ab7bd99d51414dcb4f765bc6faabf367d (diff)
downloadframeworks_av-5241b8cacee86e17223695190959f4752910680f.zip
frameworks_av-5241b8cacee86e17223695190959f4752910680f.tar.gz
frameworks_av-5241b8cacee86e17223695190959f4752910680f.tar.bz2
Remove unused TwoTrack process mode from AudioMixer
Legacy code that has not been hooked up. Change-Id: Ic01a4eddfa1020089d5bc42f58b6a4697698c27a
Diffstat (limited to 'services/audioflinger/AudioMixer.cpp')
-rw-r--r--services/audioflinger/AudioMixer.cpp103
1 files changed, 0 insertions, 103 deletions
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 6edca1b..7ac2c0c 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -1797,109 +1797,6 @@ void AudioMixer::process__OneTrack16BitsStereoNoResampling(state_t* state,
}
}
-#if 0
-// 2 tracks is also a common case
-// NEVER used in current implementation of process__validate()
-// only use if the 2 tracks have the same output buffer
-void AudioMixer::process__TwoTracks16BitsStereoNoResampling(state_t* state,
- int64_t pts)
-{
- int i;
- uint32_t en = state->enabledTracks;
-
- i = 31 - __builtin_clz(en);
- const track_t& t0 = state->tracks[i];
- AudioBufferProvider::Buffer& b0(t0.buffer);
-
- en &= ~(1<<i);
- i = 31 - __builtin_clz(en);
- const track_t& t1 = state->tracks[i];
- AudioBufferProvider::Buffer& b1(t1.buffer);
-
- const int16_t *in0;
- const int16_t vl0 = t0.volume[0];
- const int16_t vr0 = t0.volume[1];
- size_t frameCount0 = 0;
-
- const int16_t *in1;
- const int16_t vl1 = t1.volume[0];
- const int16_t vr1 = t1.volume[1];
- size_t frameCount1 = 0;
-
- //FIXME: only works if two tracks use same buffer
- int32_t* out = t0.mainBuffer;
- size_t numFrames = state->frameCount;
- const int16_t *buff = NULL;
-
-
- while (numFrames) {
-
- if (frameCount0 == 0) {
- b0.frameCount = numFrames;
- int64_t outputPTS = calculateOutputPTS(t0, pts,
- out - t0.mainBuffer);
- t0.bufferProvider->getNextBuffer(&b0, outputPTS);
- if (b0.i16 == NULL) {
- if (buff == NULL) {
- buff = new int16_t[MAX_NUM_CHANNELS * state->frameCount];
- }
- in0 = buff;
- b0.frameCount = numFrames;
- } else {
- in0 = b0.i16;
- }
- frameCount0 = b0.frameCount;
- }
- if (frameCount1 == 0) {
- b1.frameCount = numFrames;
- int64_t outputPTS = calculateOutputPTS(t1, pts,
- out - t0.mainBuffer);
- t1.bufferProvider->getNextBuffer(&b1, outputPTS);
- if (b1.i16 == NULL) {
- if (buff == NULL) {
- buff = new int16_t[MAX_NUM_CHANNELS * state->frameCount];
- }
- in1 = buff;
- b1.frameCount = numFrames;
- } else {
- in1 = b1.i16;
- }
- frameCount1 = b1.frameCount;
- }
-
- size_t outFrames = frameCount0 < frameCount1?frameCount0:frameCount1;
-
- numFrames -= outFrames;
- frameCount0 -= outFrames;
- frameCount1 -= outFrames;
-
- do {
- int32_t l0 = *in0++;
- int32_t r0 = *in0++;
- l0 = mul(l0, vl0);
- r0 = mul(r0, vr0);
- int32_t l = *in1++;
- int32_t r = *in1++;
- l = mulAdd(l, vl1, l0) >> 12;
- r = mulAdd(r, vr1, r0) >> 12;
- // clamping...
- l = clamp16(l);
- r = clamp16(r);
- *out++ = (r<<16) | (l & 0xFFFF);
- } while (--outFrames);
-
- if (frameCount0 == 0) {
- t0.bufferProvider->releaseBuffer(&b0);
- }
- if (frameCount1 == 0) {
- t1.bufferProvider->releaseBuffer(&b1);
- }
- }
-
- delete [] buff;
-}
-#endif
-
int64_t AudioMixer::calculateOutputPTS(const track_t& t, int64_t basePTS,
int outputFrameIndex)
{