summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-05-13 10:38:42 -0700
committerGlenn Kasten <gkasten@google.com>2014-06-02 11:30:29 -0700
commit6dbb5e3336cfff1ad51d429fcb847307c06efd61 (patch)
tree1918b6cde40e188641e729b6bbde39cce81085bd /services/audioflinger/Threads.h
parent4ea00a25cf85877b48ebd1e15a657cfaab29af58 (diff)
downloadframeworks_av-6dbb5e3336cfff1ad51d429fcb847307c06efd61.zip
frameworks_av-6dbb5e3336cfff1ad51d429fcb847307c06efd61.tar.gz
frameworks_av-6dbb5e3336cfff1ad51d429fcb847307c06efd61.tar.bz2
Use of fast capture by normal capture
Will only configure fast capture path if the input buffer size is less than 10 ms and the input sample rate is same as the primary output sample rate. Change-Id: I4a7cdc6069d750845412c626d27e83f72a1ab397
Diffstat (limited to 'services/audioflinger/Threads.h')
-rw-r--r--services/audioflinger/Threads.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index 8c9943c..07887fb 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -1064,6 +1064,8 @@ public:
virtual sp<MemoryDealer> readOnlyHeap() const { return mReadOnlyHeap; }
+ virtual sp<IMemory> pipeMemory() const { return mPipeMemory; }
+
sp<AudioFlinger::RecordThread::RecordTrack> createRecordTrack_l(
const sp<AudioFlinger::Client>& client,
uint32_t sampleRate,
@@ -1115,7 +1117,7 @@ public:
static void syncStartEventCallback(const wp<SyncEvent>& event);
virtual size_t frameCount() const { return mFrameCount; }
- bool hasFastCapture() const { return false; }
+ bool hasFastCapture() const { return mFastCapture != 0; }
private:
// Enter standby if not already in standby, and set mStandby flag
@@ -1145,4 +1147,40 @@ private:
const sp<NBAIO_Sink> mTeeSink;
const sp<MemoryDealer> mReadOnlyHeap;
+
+ // one-time initialization, no locks required
+ sp<FastCapture> mFastCapture; // non-0 if there is also a fast capture
+ // FIXME audio watchdog thread
+
+ // contents are not guaranteed to be consistent, no locks required
+ FastCaptureDumpState mFastCaptureDumpState;
+#ifdef STATE_QUEUE_DUMP
+ // FIXME StateQueue observer and mutator dump fields
+#endif
+ // FIXME audio watchdog dump
+
+ // accessible only within the threadLoop(), no locks required
+ // mFastCapture->sq() // for mutating and pushing state
+ int32_t mFastCaptureFutex; // for cold idle
+
+ // The HAL input source is treated as non-blocking,
+ // but current implementation is blocking
+ sp<NBAIO_Source> mInputSource;
+ // The source for the normal capture thread to read from: mInputSource or mPipeSource
+ sp<NBAIO_Source> mNormalSource;
+ // If a fast capture is present, the non-blocking pipe sink written to by fast capture,
+ // otherwise clear
+ sp<NBAIO_Sink> mPipeSink;
+ // If a fast capture is present, the non-blocking pipe source read by normal thread,
+ // otherwise clear
+ sp<NBAIO_Source> mPipeSource;
+ // Depth of pipe from fast capture to normal thread and fast clients, always power of 2
+ size_t mPipeFramesP2;
+ // If a fast capture is present, the Pipe as IMemory, otherwise clear
+ sp<IMemory> mPipeMemory;
+
+ static const size_t kFastCaptureLogSize = 4 * 1024;
+ sp<NBLog::Writer> mFastCaptureNBLogWriter;
+
+ bool mFastTrackAvail; // true if fast track available
};