Communicate audio session ID to downmixer
The audio downmixer effect might need the audio session Id, pass it
from the track creation in AudioFlinger to the downmix effect
creation in AudioMixer.
Change-Id: I5e29540542ae89cf4a0cdb537b3e67f04442a20a
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index a5d4c6c..27e2ed2 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -3383,9 +3383,9 @@
}
// getTrackName_l() must be called with ThreadBase::mLock held
-int AudioFlinger::MixerThread::getTrackName_l(audio_channel_mask_t channelMask)
+int AudioFlinger::MixerThread::getTrackName_l(audio_channel_mask_t channelMask, int sessionId)
{
- return mAudioMixer->getTrackName(channelMask);
+ return mAudioMixer->getTrackName(channelMask, sessionId);
}
// deleteTrackName_l() must be called with ThreadBase::mLock held
@@ -3498,7 +3498,7 @@
readOutputParameters();
mAudioMixer = new AudioMixer(mNormalFrameCount, mSampleRate);
for (size_t i = 0; i < mTracks.size() ; i++) {
- int name = getTrackName_l(mTracks[i]->mChannelMask);
+ int name = getTrackName_l(mTracks[i]->mChannelMask, mTracks[i]->mSessionId);
if (name < 0) break;
mTracks[i]->mName = name;
// limit track sample rate to 2 x new output sample rate
@@ -3828,7 +3828,8 @@
}
// getTrackName_l() must be called with ThreadBase::mLock held
-int AudioFlinger::DirectOutputThread::getTrackName_l(audio_channel_mask_t channelMask)
+int AudioFlinger::DirectOutputThread::getTrackName_l(audio_channel_mask_t channelMask,
+ int sessionId)
{
return 0;
}
@@ -4293,7 +4294,7 @@
// 16 bit because data is converted to 16 bit before being stored in buffer by AudioTrack
mCblk->frameSize = audio_is_linear_pcm(format) ? mChannelCount * sizeof(int16_t) : sizeof(uint8_t);
// to avoid leaking a track name, do not allocate one unless there is an mCblk
- mName = thread->getTrackName_l(channelMask);
+ mName = thread->getTrackName_l(channelMask, sessionId);
mCblk->mName = mName;
if (mName < 0) {
ALOGE("no more track names available");