summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2015-03-24 21:48:03 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-24 21:48:04 +0000
commit1147314379fccebdb072cd0c1a246b505839a2b0 (patch)
tree2c91d537bfc2ade4684afec9d45f27197b639538
parent957af4cef721c1eec1606850e77ad2ef1fd0eb0a (diff)
parentb7fbf7ecc6b034243ec64f79f3113675b5e3c941 (diff)
downloadframeworks_av-1147314379fccebdb072cd0c1a246b505839a2b0.zip
frameworks_av-1147314379fccebdb072cd0c1a246b505839a2b0.tar.gz
frameworks_av-1147314379fccebdb072cd0c1a246b505839a2b0.tar.bz2
Merge "AudioRecord TRANSFER_OBTAIN can be used with FAST flag"
-rw-r--r--media/libmedia/AudioRecord.cpp9
-rw-r--r--services/audioflinger/Threads.cpp5
2 files changed, 9 insertions, 5 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 43554e6..100a914 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -438,9 +438,12 @@ status_t AudioRecord::openRecord_l(size_t epoch)
}
// Client can only express a preference for FAST. Server will perform additional tests.
- if ((mFlags & AUDIO_INPUT_FLAG_FAST) && !(
- // use case: callback transfer mode
- (mTransfer == TRANSFER_CALLBACK) &&
+ if ((mFlags & AUDIO_INPUT_FLAG_FAST) && !((
+ // either of these use cases:
+ // use case 1: callback transfer mode
+ (mTransfer == TRANSFER_CALLBACK) ||
+ // use case 2: obtain/release mode
+ (mTransfer == TRANSFER_OBTAIN)) &&
// matching sample rate
(mSampleRate == afSampleRate))) {
ALOGW("AUDIO_INPUT_FLAG_FAST denied by client; transfer %d, track %u Hz, primary %u Hz",
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index d0b825c..48bb21f 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -5867,8 +5867,9 @@ sp<AudioFlinger::RecordThread::RecordTrack> AudioFlinger::RecordThread::createRe
// client expresses a preference for FAST, but we get the final say
if (*flags & IAudioFlinger::TRACK_FAST) {
if (
- // use case: callback handler
- (tid != -1) &&
+ // we formerly checked for a callback handler (non-0 tid),
+ // but that is no longer required for TRANSFER_OBTAIN mode
+ //
// frame count is not specified, or is exactly the pipe depth
((frameCount == 0) || (frameCount == mPipeFramesP2)) &&
// PCM data