diff options
author | Glenn Kasten <gkasten@google.com> | 2013-08-01 07:24:34 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-08-02 16:22:42 -0700 |
commit | 3151427b6b0adf99929433715bab6f1e505100c1 (patch) | |
tree | 09d18bfd32a448d153d1529487f52a3bc7761eed | |
parent | 73493688f4190f790ee15d9ca54831cd64f4e195 (diff) | |
download | frameworks_av-3151427b6b0adf99929433715bab6f1e505100c1.zip frameworks_av-3151427b6b0adf99929433715bab6f1e505100c1.tar.gz frameworks_av-3151427b6b0adf99929433715bab6f1e505100c1.tar.bz2 |
AudioRecord::openRecord_l use flags
Use the flags to determine input parameters for IAudioFlinger::openRecord.
Change-Id: I98d2726503af75c8830ce80ceaf3b94a755b342f
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index dfaac4c..0c798ae 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -449,10 +449,22 @@ status_t AudioRecord::openRecord_l( return NO_INIT; } + IAudioFlinger::track_flags_t trackFlags = IAudioFlinger::TRACK_DEFAULT; pid_t tid = -1; - // FIXME see similar logic at AudioTrack for tid - IAudioFlinger::track_flags_t trackFlags = IAudioFlinger::TRACK_DEFAULT; + // Client can only express a preference for FAST. Server will perform additional tests. + // The only supported use case for FAST is callback transfer mode. + if (flags & AUDIO_INPUT_FLAG_FAST) { + if ((mTransfer != TRANSFER_CALLBACK) || (mAudioRecordThread == 0)) { + ALOGW("AUDIO_INPUT_FLAG_FAST denied by client"); + // once denied, do not request again if IAudioRecord is re-created + mFlags = (audio_input_flags_t) (flags & ~AUDIO_INPUT_FLAG_FAST); + } else { + trackFlags |= IAudioFlinger::TRACK_FAST; + tid = mAudioRecordThread->getTid(); + } + } + int originalSessionId = mSessionId; sp<IAudioRecord> record = audioFlinger->openRecord(input, sampleRate, format, |