summaryrefslogtreecommitdiffstats
path: root/include/media/AudioTrack.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-11-12 07:58:20 -0800
committerGlenn Kasten <gkasten@google.com>2012-11-12 15:13:34 -0800
commit5aab59a2bd0a2cd80240ffd66c1b963b5fe06d65 (patch)
tree5625489fba1f480481ecb9ea7ad3375985bd03b1 /include/media/AudioTrack.h
parent9c6c02eb5badf4ffcd44fc88f2587def2fd628b6 (diff)
downloadframeworks_av-5aab59a2bd0a2cd80240ffd66c1b963b5fe06d65.zip
frameworks_av-5aab59a2bd0a2cd80240ffd66c1b963b5fe06d65.tar.gz
frameworks_av-5aab59a2bd0a2cd80240ffd66c1b963b5fe06d65.tar.bz2
Move frame size out of the control block
This is part of a series to clean up the control block. Change-Id: Ifab1c42ac0f8be704e571b292713cd2250d12a3f
Diffstat (limited to 'include/media/AudioTrack.h')
-rw-r--r--include/media/AudioTrack.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 639b567..3504f1f 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -229,7 +229,7 @@ public:
/* Return channelCount * (bit depth per channel / 8).
* channelCount is determined from channelMask, and bit depth comes from format.
*/
- size_t frameSize() const;
+ size_t frameSize() const { return mFrameSize; }
sp<IMemory>& sharedBuffer();
@@ -517,6 +517,13 @@ protected:
uint8_t mMuted;
uint8_t mReserved;
audio_channel_mask_t mChannelMask;
+
+ // mFrameSize is equal to mFrameSizeAF for non-PCM or 16-bit PCM data.
+ // For 8-bit PCM data, mFrameSizeAF is
+ // twice as large because data is expanded to 16-bit before being stored in buffer.
+ size_t mFrameSize; // app-level frame size
+ size_t mFrameSizeAF; // AudioFlinger frame size
+
status_t mStatus;
uint32_t mLatency;