From 3a6c90aa0617666d9abc94c02b752d9eb3d64772 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Thu, 13 Mar 2014 15:07:51 -0700 Subject: Add FIXMEs to createRecord for fast capture Change-Id: I759be200fae32969212c52a409f46f2e704081e3 --- services/audioflinger/Threads.cpp | 20 ++++++++++++-------- services/audioflinger/Threads.h | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'services/audioflinger') diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 7700780..65e9eec 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -5086,21 +5086,24 @@ sp AudioFlinger::RecordThread::createRe ( (tid != -1) && ((frameCount == 0) || + // FIXME not necessarily true, should be native frame count for native SR! (frameCount >= mFrameCount)) ) && - // FIXME when record supports non-PCM data, also check for audio_is_linear_pcm(format) + // PCM data + audio_is_linear_pcm(format) && // mono or stereo ( (channelMask == AUDIO_CHANNEL_OUT_MONO) || (channelMask == AUDIO_CHANNEL_OUT_STEREO) ) && // hardware sample rate + // FIXME actually the native hardware sample rate (sampleRate == mSampleRate) && - // record thread has an associated fast recorder - hasFastRecorder() - // FIXME test that RecordThread for this fast track has a capable output HAL - // FIXME add a permission test also? + // record thread has an associated fast capture + hasFastCapture() + // fast capture does not require slots ) { - // if frameCount not specified, then it defaults to fast recorder (HAL) frame count + // if frameCount not specified, then it defaults to fast capture (HAL) frame count if (frameCount == 0) { + // FIXME wrong mFrameCount frameCount = mFrameCount * kFastTrackMultiplier; } ALOGV("AUDIO_INPUT_FLAG_FAST accepted: frameCount=%d mFrameCount=%d", @@ -5108,11 +5111,12 @@ sp AudioFlinger::RecordThread::createRe } else { ALOGV("AUDIO_INPUT_FLAG_FAST denied: frameCount=%d " "mFrameCount=%d format=%d isLinear=%d channelMask=%#x sampleRate=%u mSampleRate=%u " - "hasFastRecorder=%d tid=%d", + "hasFastCapture=%d tid=%d", frameCount, mFrameCount, format, audio_is_linear_pcm(format), - channelMask, sampleRate, mSampleRate, hasFastRecorder(), tid); + channelMask, sampleRate, mSampleRate, hasFastCapture(), tid); *flags &= ~IAudioFlinger::TRACK_FAST; + // FIXME It's not clear that we need to enforce this any more, since we have a pipe. // For compatibility with AudioRecord calculation, buffer depth is forced // to be at least 2 x the record thread frame count and cover audio hardware latency. // This is probably too conservative, but legacy application code may depend on it. diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h index 59d5c66..5617c0c 100644 --- a/services/audioflinger/Threads.h +++ b/services/audioflinger/Threads.h @@ -993,7 +993,7 @@ public: static void syncStartEventCallback(const wp& event); virtual size_t frameCount() const { return mFrameCount; } - bool hasFastRecorder() const { return false; } + bool hasFastCapture() const { return false; } private: // Enter standby if not already in standby, and set mStandby flag -- cgit v1.1