diff options
author | Glenn Kasten <gkasten@google.com> | 2014-03-13 15:07:51 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2014-03-31 12:22:09 -0700 |
commit | 3a6c90aa0617666d9abc94c02b752d9eb3d64772 (patch) | |
tree | 150424841e6732f1d3a1c6df6139f8f307db0d2f /services/audioflinger | |
parent | 5e184b0d12f1ec436246a391da8d9355cc21ee08 (diff) | |
download | frameworks_av-3a6c90aa0617666d9abc94c02b752d9eb3d64772.zip frameworks_av-3a6c90aa0617666d9abc94c02b752d9eb3d64772.tar.gz frameworks_av-3a6c90aa0617666d9abc94c02b752d9eb3d64772.tar.bz2 |
Add FIXMEs to createRecord for fast capture
Change-Id: I759be200fae32969212c52a409f46f2e704081e3
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/Threads.cpp | 20 | ||||
-rw-r--r-- | services/audioflinger/Threads.h | 2 |
2 files changed, 13 insertions, 9 deletions
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::RecordTrack> 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::RecordTrack> 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<SyncEvent>& 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 |