summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-07-16 11:37:48 -0700
committerGlenn Kasten <gkasten@google.com>2013-07-29 16:36:09 -0700
commit9b58f63e45ef2fdfb839b9b9bb3411d81eb96128 (patch)
tree064801660f69f98c8ed48db753902ac141d6bc32 /services/audioflinger/Threads.h
parent2314e90eb8de63a7058297817125b94c1eac8019 (diff)
downloadframeworks_av-9b58f63e45ef2fdfb839b9b9bb3411d81eb96128.zip
frameworks_av-9b58f63e45ef2fdfb839b9b9bb3411d81eb96128.tar.gz
frameworks_av-9b58f63e45ef2fdfb839b9b9bb3411d81eb96128.tar.bz2
Move members from ThreadBase to PlaybackThread
Move mNormalFrameCount and frameCountHAL(), since they're not used by record threads. Also comment which fields are updated by readParameters(). Change-Id: I5fc0a8a89cc637976f22d49271a5a3e136dab4e1
Diffstat (limited to 'services/audioflinger/Threads.h')
-rw-r--r--services/audioflinger/Threads.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index a17c279..b1b33b0 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -126,10 +126,8 @@ public:
audio_channel_mask_t channelMask() const { return mChannelMask; }
audio_format_t format() const { return mFormat; }
// Called by AudioFlinger::frameCount(audio_io_handle_t output) and effects,
- // and returns the normal mix buffer's frame count.
- size_t frameCount() const { return mNormalFrameCount; }
- // Return's the HAL's frame count i.e. fast mixer buffer size.
- size_t frameCountHAL() const { return mFrameCount; }
+ // and returns the [normal mix] buffer's frame count.
+ virtual size_t frameCount() const = 0;
size_t frameSize() const { return mFrameSize; }
// Should be "virtual status_t requestExitAndWait()" and override same
@@ -263,9 +261,11 @@ protected:
Condition mWaitWorkCV;
const sp<AudioFlinger> mAudioFlinger;
+
+ // updated by PlaybackThread::readOutputParameters() or
+ // RecordThread::readInputParameters()
uint32_t mSampleRate;
size_t mFrameCount; // output HAL, direct output, record
- size_t mNormalFrameCount; // normal mixer and effects
audio_channel_mask_t mChannelMask;
uint32_t mChannelCount;
size_t mFrameSize;
@@ -461,8 +461,15 @@ public:
// called with AudioFlinger lock held
void invalidateTracks(audio_stream_type_t streamType);
+ virtual size_t frameCount() const { return mNormalFrameCount; }
+
+ // Return's the HAL's frame count i.e. fast mixer buffer size.
+ size_t frameCountHAL() const { return mFrameCount; }
protected:
+ // updated by readOutputParameters()
+ size_t mNormalFrameCount; // normal mixer and effects
+
int16_t* mMixBuffer; // frame size aligned mix buffer
int8_t* mAllocMixBuffer; // mixer buffer allocation address
@@ -871,6 +878,8 @@ public:
static void syncStartEventCallback(const wp<SyncEvent>& event);
void handleSyncStartEvent(const sp<SyncEvent>& event);
+ virtual size_t frameCount() const { return mFrameCount; }
+
private:
void clearSyncStartEvent();
@@ -886,6 +895,8 @@ private:
// is used together with mStartStopCond to indicate start()/stop() progress
sp<RecordTrack> mActiveTrack;
Condition mStartStopCond;
+
+ // updated by RecordThread::readInputParameters()
AudioResampler *mResampler;
int32_t *mRsmpOutBuffer;
int16_t *mRsmpInBuffer;