summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-01-12 15:08:22 -0800
committerAndy Hung <hunga@google.com>2015-01-14 13:11:38 -0800
commitabdb990953ffe94a9dc544aea0bed17ef7d5f484 (patch)
treea5cba46c6820b02771d0759bdb1ef6b6d6292356 /include
parent2d85f097d653b21d1ff2c34f0b732c674d20ccc2 (diff)
downloadframeworks_av-abdb990953ffe94a9dc544aea0bed17ef7d5f484.zip
frameworks_av-abdb990953ffe94a9dc544aea0bed17ef7d5f484.tar.gz
frameworks_av-abdb990953ffe94a9dc544aea0bed17ef7d5f484.tar.bz2
Allow AUDIO_FORMAT_PCM_8_BIT AudioTrack buffers
Previously conversion to AUDIO_FORMAT_PCM_16_BIT was required. Client shared memory for static tracks and AudioFlinger track creation and buffer delivery now use native 8 bit PCM data. Change-Id: I485c07a4971fde9a25442bd43fed95019d39abcc
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioTrack.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index d602ee4..2e1ed6c 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -79,9 +79,7 @@ public:
size_t size; // input/output in bytes == frameCount * frameSize
// on input it is unused
// on output is the number of bytes actually filled
- // FIXME this is redundant with respect to frameCount,
- // and TRANSFER_OBTAIN mode is broken for 8-bit data
- // since we don't define the frame format
+ // FIXME this is redundant with respect to frameCount.
union {
void* raw;
@@ -154,9 +152,9 @@ public:
* streamType: Select the type of audio stream this track is attached to
* (e.g. AUDIO_STREAM_MUSIC).
* sampleRate: Data source sampling rate in Hz.
- * format: Audio format. For mixed tracks, any PCM format supported by server is OK
- * or AUDIO_FORMAT_PCM_8_BIT which is handled on client side. For direct
- * and offloaded tracks, the possible format(s) depends on the output sink.
+ * format: Audio format. For mixed tracks, any PCM format supported by server is OK.
+ * For direct and offloaded tracks, the possible format(s) depends on the
+ * output sink.
* channelMask: Channel mask, such that audio_is_output_channel(channelMask) is true.
* frameCount: Minimum size of track PCM buffer in frames. This defines the
* application's contribution to the
@@ -193,7 +191,6 @@ public:
/* Creates an audio track and registers it with AudioFlinger.
* With this constructor, the track is configured for static buffer mode.
- * The format must not be 8-bit linear PCM.
* Data to be rendered is passed in a shared memory buffer
* identified by the argument sharedBuffer, which must be non-0.
* The memory should be initialized to the desired data before calling start().
@@ -701,10 +698,7 @@ protected:
const audio_offload_info_t* mOffloadInfo;
audio_attributes_t mAttributes;
- // mFrameSize is equal to mFrameSizeAF for non-PCM or 16-bit PCM data. For 8-bit PCM data, it's
- // twice as large as mFrameSize because data is expanded to 16-bit before it's stored in buffer.
- size_t mFrameSize; // app-level frame size
- size_t mFrameSizeAF; // AudioFlinger frame size
+ size_t mFrameSize; // frame size in bytes
status_t mStatus;