Clean up frame size in AudioTrack and AudioFlinger
TrackBase::mFrameSize, mChannelMask, and mChannelCount are now const.
Use TrackBase::mFrameSize instead of re-calculating frame size.
AudioFlinger only sees 16-bit PCM format, conversion from 8-bit is
now entirely on the client side. Previously a small part of the
responsibility was on server side also.
size_t is unsigned, so use %u in logs.
Fix theoretical bug where TrackBase constructor was over-allocating space
for non-linear AudioTrack or 8-bit PCM AudioRecord (probably benign).
Change-Id: I7cbbba0bf4dba29ea751d8af341ab8e5cbbdc206
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 8816929..9ddfe28 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -473,14 +473,13 @@
const uint32_t mSampleRate; // initial sample rate only; for tracks which
// support dynamic rates, the current value is in control block
const audio_format_t mFormat;
- size_t mFrameSize; // AudioFlinger's view of frame size in shared memory,
+ const audio_channel_mask_t mChannelMask;
+ const uint8_t mChannelCount;
+ const size_t mFrameSize; // AudioFlinger's view of frame size in shared memory,
// where for AudioTrack (but not AudioRecord),
// 8-bit PCM samples are stored as 16-bit
- // FIXME should be const
bool mStepServerFailed;
const int mSessionId;
- uint8_t mChannelCount;
- audio_channel_mask_t mChannelMask;
Vector < sp<SyncEvent> >mSyncEvents;
};