From d06e132358d44f02c22527b4f463df1f58da9216 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Wed, 12 Sep 2012 15:47:07 -0700 Subject: 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: I836873eebd6711f1048fce81cd2eb29b94f0ad0c --- services/audioflinger/AudioMixer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'services/audioflinger/AudioMixer.cpp') diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp index 183c1f3..1f13625 100644 --- a/services/audioflinger/AudioMixer.cpp +++ b/services/audioflinger/AudioMixer.cpp @@ -163,7 +163,7 @@ AudioMixer::~AudioMixer() delete [] mState.resampleTemp; } -int AudioMixer::getTrackName(audio_channel_mask_t channelMask) +int AudioMixer::getTrackName(audio_channel_mask_t channelMask, int sessionId) { uint32_t names = (~mTrackNames) & mConfiguredNames; if (names != 0) { @@ -189,6 +189,7 @@ int AudioMixer::getTrackName(audio_channel_mask_t channelMask) t->enabled = false; t->format = 16; t->channelMask = AUDIO_CHANNEL_OUT_STEREO; + t->sessionId = sessionId; // setBufferProvider(name, AudioBufferProvider *) is required before enable(name) t->bufferProvider = NULL; t->buffer.raw = NULL; @@ -269,7 +270,7 @@ status_t AudioMixer::prepareTrackForDownmix(track_t* pTrack, int trackName) } if (EffectCreate(&dwnmFxDesc.uuid, - -2 /*sessionId*/, -2 /*ioId*/,// both not relevant here, using random value + pTrack->sessionId /*sessionId*/, -2 /*ioId not relevant here, using random value*/, &pDbp->mDownmixHandle/*pHandle*/) != 0) { ALOGE("prepareTrackForDownmix(%d) fails: error creating downmixer effect", trackName); goto noDownmixForActiveTrack; -- cgit v1.1