Rename mSinkFormat to mMixerFormat for AudioMixer::track_t
AudioMixer::SINK_FORMAT also changes to AudioMixer::MIXER_FORMAT
Change-Id: Ic3f8be77d2c75c082c4fd140bc907e30c304d285
Signed-off-by: Andy Hung <hunga@google.com>
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index bfa0f38..3ac5da9 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -193,7 +193,7 @@
t->mainBuffer = NULL;
t->auxBuffer = NULL;
t->downmixerBufferProvider = NULL;
- t->mSinkFormat = AUDIO_FORMAT_PCM_16_BIT;
+ t->mMixerFormat = AUDIO_FORMAT_PCM_16_BIT;
status_t status = initTrackDownmix(&mState.tracks[n], n, channelMask);
if (status == OK) {
@@ -441,11 +441,11 @@
// for a specific track? or per mixer?
/* case DOWNMIX_TYPE:
break */
- case SINK_FORMAT: {
+ case MIXER_FORMAT: {
audio_format_t format = static_cast<audio_format_t>(valueInt);
- if (track.mSinkFormat != format) {
- track.mSinkFormat = format;
- ALOGV("setParameter(TRACK, SINK_FORMAT, %#x)", format);
+ if (track.mMixerFormat != format) {
+ track.mMixerFormat = format;
+ ALOGV("setParameter(TRACK, MIXER_FORMAT, %#x)", format);
}
} break;
default:
@@ -1071,7 +1071,7 @@
e0 &= ~(e1);
memset(t1.mainBuffer, 0, sampleCount
- * audio_bytes_per_sample(t1.mSinkFormat));
+ * audio_bytes_per_sample(t1.mMixerFormat));
}
while (e1) {
@@ -1179,7 +1179,7 @@
}
}
}
- switch (t1.mSinkFormat) {
+ switch (t1.mMixerFormat) {
case AUDIO_FORMAT_PCM_FLOAT:
memcpy_to_float_from_q19_12(reinterpret_cast<float *>(out), outTemp, BLOCKSIZE * 2);
out += BLOCKSIZE * 2; // output is 2 floats/frame.
@@ -1189,7 +1189,7 @@
out += BLOCKSIZE; // output is 1 int32_t (2 int16_t samples)/frame
break;
default:
- LOG_ALWAYS_FATAL("bad sink format: %d", t1.mSinkFormat);
+ LOG_ALWAYS_FATAL("bad mixer format: %d", t1.mMixerFormat);
}
numFrames += BLOCKSIZE;
} while (numFrames < state->frameCount);
@@ -1272,7 +1272,7 @@
}
}
}
- switch (t1.mSinkFormat) {
+ switch (t1.mMixerFormat) {
case AUDIO_FORMAT_PCM_FLOAT:
memcpy_to_float_from_q19_12(reinterpret_cast<float*>(out), outTemp, numFrames*2);
break;
@@ -1280,7 +1280,7 @@
ditherAndClamp(out, outTemp, numFrames);
break;
default:
- LOG_ALWAYS_FATAL("bad sink format: %d", t1.mSinkFormat);
+ LOG_ALWAYS_FATAL("bad mixer format: %d", t1.mMixerFormat);
}
}
}
@@ -1322,7 +1322,7 @@
}
size_t outFrames = b.frameCount;
- switch (t.mSinkFormat) {
+ switch (t.mMixerFormat) {
case AUDIO_FORMAT_PCM_FLOAT: {
float *fout = reinterpret_cast<float*>(out);
do {
@@ -1361,7 +1361,7 @@
}
break;
default:
- LOG_ALWAYS_FATAL("bad sink format: %d", t.mSinkFormat);
+ LOG_ALWAYS_FATAL("bad mixer format: %d", t.mMixerFormat);
}
numFrames -= b.frameCount;
t.bufferProvider->releaseBuffer(&b);
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index 3355db4..e5e120c 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -77,7 +77,7 @@
MAIN_BUFFER = 0x4002,
AUX_BUFFER = 0x4003,
DOWNMIX_TYPE = 0X4004,
- SINK_FORMAT = 0x4005, // AUDIO_FORMAT_PCM_(FLOAT|16_BIT)
+ MIXER_FORMAT = 0x4005, // AUDIO_FORMAT_PCM_(FLOAT|16_BIT)
// for target RESAMPLE
SAMPLE_RATE = 0x4100, // Configure sample rate conversion on this track name;
// parameter 'value' is the new sample rate in Hz.
@@ -194,7 +194,7 @@
int32_t sessionId;
- audio_format_t mSinkFormat; // at this time: AUDIO_FORMAT_PCM_(FLOAT|16_BIT)
+ audio_format_t mMixerFormat; // at this time: AUDIO_FORMAT_PCM_(FLOAT|16_BIT)
int32_t padding[1];
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index b3d1dbe..357ea22 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -3293,7 +3293,7 @@
mAudioMixer->setParameter(
name,
AudioMixer::TRACK,
- AudioMixer::SINK_FORMAT, (void *)mMixerBufferFormat);
+ AudioMixer::MIXER_FORMAT, (void *)mMixerBufferFormat);
mAudioMixer->setParameter(
name,
AudioMixer::TRACK,
@@ -3304,7 +3304,7 @@
mAudioMixer->setParameter(
name,
AudioMixer::TRACK,
- AudioMixer::SINK_FORMAT, (void *)AUDIO_FORMAT_PCM_16_BIT);
+ AudioMixer::MIXER_FORMAT, (void *)AUDIO_FORMAT_PCM_16_BIT);
mAudioMixer->setParameter(
name,
AudioMixer::TRACK,