diff options
author | Glenn Kasten <gkasten@google.com> | 2012-11-08 12:13:58 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-11-08 12:18:59 -0800 |
commit | b929e417853694e37aba1ef4399f188987b709d9 (patch) | |
tree | 670f2da01fd3d33df6da2998c78273e0701300ad /include | |
parent | a47f3165f53c8e8fb8907a94de7417e2c3047eeb (diff) | |
download | frameworks_av-b929e417853694e37aba1ef4399f188987b709d9.zip frameworks_av-b929e417853694e37aba1ef4399f188987b709d9.tar.gz frameworks_av-b929e417853694e37aba1ef4399f188987b709d9.tar.bz2 |
Move buffers pointer out of the control block
This is part of a series to clean up the control block.
Change-Id: Ie474557db7cb360f2d9a0f11600a68f5a3d46f07
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioRecord.h | 1 | ||||
-rw-r--r-- | include/media/AudioTrack.h | 1 | ||||
-rw-r--r-- | include/private/media/AudioTrackShared.h | 9 |
3 files changed, 7 insertions, 4 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index 0ab26b8..bfb5d3a 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -389,6 +389,7 @@ private: sp<IAudioRecord> mAudioRecord; sp<IMemory> mCblkMemory; audio_track_cblk_t* mCblk; + void* mBuffers; // starting address of buffers in shared memory int mPreviousPriority; // before start() SchedPolicy mPreviousSchedulingGroup; diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 6e88032..639b567 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -510,6 +510,7 @@ protected: uint32_t mFrameCount; audio_track_cblk_t* mCblk; // re-load after mLock.unlock() + void* mBuffers; // starting address of buffers in shared memory audio_format_t mFormat; audio_stream_type_t mStreamType; uint8_t mChannelCount; diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h index 90301cd..8ef90c7 100644 --- a/include/private/media/AudioTrackShared.h +++ b/include/private/media/AudioTrackShared.h @@ -58,9 +58,7 @@ struct audio_track_cblk_t uint32_t userBase; uint32_t serverBase; - // if there is a shared buffer, "buffers" is the value of pointer() for the shared - // buffer, otherwise "buffers" points immediately after the control block - void* buffers; + int mPad1; // unused, but preserves cache line alignment uint32_t frameCount; // Cache line boundary @@ -111,7 +109,10 @@ public: bool stepServer(uint32_t frameCount, bool isOut); - void* buffer(uint32_t offset) const; + // if there is a shared buffer, "buffers" is the value of pointer() for the shared + // buffer, otherwise "buffers" points immediately after the control block + void* buffer(void *buffers, uint32_t offset) const; + uint32_t framesAvailableIn() { return framesAvailable(false); } uint32_t framesAvailableOut() { return framesAvailable(true); } uint32_t framesAvailableIn_l() { return framesAvailable_l(false); } |