Loading services/audioflinger/FastMixer.cpp +4 −23 Original line number Diff line number Diff line Loading @@ -236,7 +236,6 @@ bool FastMixer::threadLoop() sampleRate = Format_sampleRate(format); ALOG_ASSERT(Format_channelCount(format) == FCC_2); } dumpState->mSampleRate = sampleRate; } if ((format != previousFormat) || (frameCount != previous->mFrameCount)) { Loading Loading @@ -321,10 +320,6 @@ bool FastMixer::threadLoop() mixer->setParameter(name, AudioMixer::TRACK, AudioMixer::MAIN_BUFFER, (void *) mixBuffer); // newly allocated track names default to full scale volume if (fastTrack->mSampleRate != 0 && fastTrack->mSampleRate != sampleRate) { mixer->setParameter(name, AudioMixer::RESAMPLE, AudioMixer::SAMPLE_RATE, (void*) fastTrack->mSampleRate); } mixer->setParameter(name, AudioMixer::TRACK, AudioMixer::CHANNEL_MASK, (void *) fastTrack->mChannelMask); mixer->enable(name); Loading Loading @@ -353,14 +348,8 @@ bool FastMixer::threadLoop() mixer->setParameter(name, AudioMixer::VOLUME, AudioMixer::VOLUME1, (void *)0x1000); } if (fastTrack->mSampleRate != 0 && fastTrack->mSampleRate != sampleRate) { mixer->setParameter(name, AudioMixer::RESAMPLE, AudioMixer::SAMPLE_RATE, (void*) fastTrack->mSampleRate); } else { mixer->setParameter(name, AudioMixer::RESAMPLE, AudioMixer::REMOVE, NULL); } mixer->setParameter(name, AudioMixer::TRACK, AudioMixer::CHANNEL_MASK, (void *) fastTrack->mChannelMask); // already enabled Loading Loading @@ -392,16 +381,8 @@ bool FastMixer::threadLoop() // Refresh the per-track timestamp if (timestampStatus == NO_ERROR) { uint32_t trackFramesWrittenButNotPresented; uint32_t trackSampleRate = fastTrack->mSampleRate; // There is currently no sample rate conversion for fast tracks currently if (trackSampleRate != 0 && trackSampleRate != sampleRate) { trackFramesWrittenButNotPresented = ((int64_t) nativeFramesWrittenButNotPresented * trackSampleRate) / sampleRate; } else { trackFramesWrittenButNotPresented = nativeFramesWrittenButNotPresented; } uint32_t trackFramesWrittenButNotPresented = nativeFramesWrittenButNotPresented; uint32_t trackFramesWritten = fastTrack->mBufferProvider->framesReleased(); // Can't provide an AudioTimestamp before first frame presented, // or during the brief 32-bit wraparound window Loading services/audioflinger/FastMixerState.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ namespace android { FastTrack::FastTrack() : mBufferProvider(NULL), mVolumeProvider(NULL), mSampleRate(0), mBufferProvider(NULL), mVolumeProvider(NULL), mChannelMask(AUDIO_CHANNEL_OUT_STEREO), mGeneration(0) { } Loading services/audioflinger/FastMixerState.h +0 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ struct FastTrack { ExtendedAudioBufferProvider* mBufferProvider; // must be NULL if inactive, or non-NULL if active VolumeProvider* mVolumeProvider; // optional; if NULL then full-scale unsigned mSampleRate; // optional; if zero then use mixer sample rate audio_channel_mask_t mChannelMask; // AUDIO_CHANNEL_OUT_MONO or AUDIO_CHANNEL_OUT_STEREO int mGeneration; // increment when any field is assigned }; Loading services/audioflinger/Threads.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -2971,7 +2971,6 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac VolumeProvider *vp = track; fastTrack->mBufferProvider = eabp; fastTrack->mVolumeProvider = vp; fastTrack->mSampleRate = track->mSampleRate; fastTrack->mChannelMask = track->mChannelMask; fastTrack->mGeneration++; state->mTrackMask |= 1 << j; Loading Loading
services/audioflinger/FastMixer.cpp +4 −23 Original line number Diff line number Diff line Loading @@ -236,7 +236,6 @@ bool FastMixer::threadLoop() sampleRate = Format_sampleRate(format); ALOG_ASSERT(Format_channelCount(format) == FCC_2); } dumpState->mSampleRate = sampleRate; } if ((format != previousFormat) || (frameCount != previous->mFrameCount)) { Loading Loading @@ -321,10 +320,6 @@ bool FastMixer::threadLoop() mixer->setParameter(name, AudioMixer::TRACK, AudioMixer::MAIN_BUFFER, (void *) mixBuffer); // newly allocated track names default to full scale volume if (fastTrack->mSampleRate != 0 && fastTrack->mSampleRate != sampleRate) { mixer->setParameter(name, AudioMixer::RESAMPLE, AudioMixer::SAMPLE_RATE, (void*) fastTrack->mSampleRate); } mixer->setParameter(name, AudioMixer::TRACK, AudioMixer::CHANNEL_MASK, (void *) fastTrack->mChannelMask); mixer->enable(name); Loading Loading @@ -353,14 +348,8 @@ bool FastMixer::threadLoop() mixer->setParameter(name, AudioMixer::VOLUME, AudioMixer::VOLUME1, (void *)0x1000); } if (fastTrack->mSampleRate != 0 && fastTrack->mSampleRate != sampleRate) { mixer->setParameter(name, AudioMixer::RESAMPLE, AudioMixer::SAMPLE_RATE, (void*) fastTrack->mSampleRate); } else { mixer->setParameter(name, AudioMixer::RESAMPLE, AudioMixer::REMOVE, NULL); } mixer->setParameter(name, AudioMixer::TRACK, AudioMixer::CHANNEL_MASK, (void *) fastTrack->mChannelMask); // already enabled Loading Loading @@ -392,16 +381,8 @@ bool FastMixer::threadLoop() // Refresh the per-track timestamp if (timestampStatus == NO_ERROR) { uint32_t trackFramesWrittenButNotPresented; uint32_t trackSampleRate = fastTrack->mSampleRate; // There is currently no sample rate conversion for fast tracks currently if (trackSampleRate != 0 && trackSampleRate != sampleRate) { trackFramesWrittenButNotPresented = ((int64_t) nativeFramesWrittenButNotPresented * trackSampleRate) / sampleRate; } else { trackFramesWrittenButNotPresented = nativeFramesWrittenButNotPresented; } uint32_t trackFramesWrittenButNotPresented = nativeFramesWrittenButNotPresented; uint32_t trackFramesWritten = fastTrack->mBufferProvider->framesReleased(); // Can't provide an AudioTimestamp before first frame presented, // or during the brief 32-bit wraparound window Loading
services/audioflinger/FastMixerState.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ namespace android { FastTrack::FastTrack() : mBufferProvider(NULL), mVolumeProvider(NULL), mSampleRate(0), mBufferProvider(NULL), mVolumeProvider(NULL), mChannelMask(AUDIO_CHANNEL_OUT_STEREO), mGeneration(0) { } Loading
services/audioflinger/FastMixerState.h +0 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ struct FastTrack { ExtendedAudioBufferProvider* mBufferProvider; // must be NULL if inactive, or non-NULL if active VolumeProvider* mVolumeProvider; // optional; if NULL then full-scale unsigned mSampleRate; // optional; if zero then use mixer sample rate audio_channel_mask_t mChannelMask; // AUDIO_CHANNEL_OUT_MONO or AUDIO_CHANNEL_OUT_STEREO int mGeneration; // increment when any field is assigned }; Loading
services/audioflinger/Threads.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -2971,7 +2971,6 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac VolumeProvider *vp = track; fastTrack->mBufferProvider = eabp; fastTrack->mVolumeProvider = vp; fastTrack->mSampleRate = track->mSampleRate; fastTrack->mChannelMask = track->mChannelMask; fastTrack->mGeneration++; state->mTrackMask |= 1 << j; Loading