summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-08-19 12:09:05 -0700
committerGlenn Kasten <gkasten@google.com>2013-11-08 11:55:36 -0800
commit8594843c15b4722ced39436fe9e64f3e57e7ace4 (patch)
tree9d8e4dcf8cf31ee119abe0872223a416e6418ec0 /services/audioflinger/Threads.h
parentd8a1de6204829b0379bbd13042f1450bdb203f2b (diff)
downloadframeworks_av-8594843c15b4722ced39436fe9e64f3e57e7ace4.zip
frameworks_av-8594843c15b4722ced39436fe9e64f3e57e7ace4.tar.gz
frameworks_av-8594843c15b4722ced39436fe9e64f3e57e7ace4.tar.bz2
Pull HAL reads out of RecordThread resample
Previously, the resample was indirectly calling HAL read from within the BufferProvider's getNextBuffer. Now the HAL read is done ahead of time into a circular buffer, and the getNextBuffer just reads out of that memory. This change will permit some future planned features. Also removed the mono to mono resampling optimization, as that optimization will no longer be valid in the future. Change-Id: I59f5016a2df91078d697c37a7dec2d9d9f44542e
Diffstat (limited to 'services/audioflinger/Threads.h')
-rw-r--r--services/audioflinger/Threads.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index cbc3827..43e335d 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -947,10 +947,22 @@ private:
AudioResampler *mResampler;
// interleaved stereo pairs of fixed-point signed Q19.12
int32_t *mRsmpOutBuffer;
- int16_t *mRsmpInBuffer; // [mFrameCount * mChannelCount]
- size_t mRsmpInIndex;
+
+ // resampler converts input at HAL Hz to output at AudioRecord client Hz
+ int16_t *mRsmpInBuffer; // see new[] for details on the size
+ size_t mRsmpInFrames; // size of resampler input in frames
+ size_t mRsmpInFramesP2;// size rounded up to a power-of-2
+ size_t mRsmpInUnrel; // unreleased frames remaining from
+ // most recent getNextBuffer
+ // these are rolling counters that are never cleared
+ int32_t mRsmpInFront; // next available frame
+ int32_t mRsmpInRear; // last filled frame + 1
+ size_t mRsmpInIndex; // FIXME legacy
+
+ // client's requested configuration, which may differ from the HAL configuration
const uint32_t mReqChannelCount;
const uint32_t mReqSampleRate;
+
ssize_t mBytesRead;
// sync event triggering actual audio capture. Frames read before this event will
// be dropped and therefore not read by the application.