diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/AudioRecord.h | 3 | ||||
-rw-r--r-- | include/media/AudioTrack.h | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index bfb5d3a..2672db1 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -185,7 +185,7 @@ public: audio_format_t format() const; int channelCount() const; uint32_t frameCount() const; - size_t frameSize() const; + size_t frameSize() const { return mFrameSize; } audio_source_t inputSource() const; @@ -378,6 +378,7 @@ private: uint32_t mFrameCount; audio_format_t mFormat; uint8_t mChannelCount; + size_t mFrameSize; // app-level frame size == AudioFlinger frame size audio_source_t mInputSource; status_t mStatus; uint32_t mLatency; 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; |