summaryrefslogtreecommitdiffstats
path: root/include/media/MediaPlayerInterface.h
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2012-03-02 14:54:07 -0800
committerJean-Michel Trivi <jmtrivi@google.com>2012-03-02 17:26:49 -0800
commit786618ffe881aceb64d65a6a2e2d76ede6e01ec0 (patch)
tree3e88f6c457f47529026207badf835dfa448ec8b8 /include/media/MediaPlayerInterface.h
parente7c795f3300814aa3f26ceb845f29695383c7edc (diff)
downloadframeworks_av-786618ffe881aceb64d65a6a2e2d76ede6e01ec0.zip
frameworks_av-786618ffe881aceb64d65a6a2e2d76ede6e01ec0.tar.gz
frameworks_av-786618ffe881aceb64d65a6a2e2d76ede6e01ec0.tar.bz2
Add channel mask in AudioSink
Add support for specifying a channel mask when opening an AudioSink. This parameter does not replace the channel count parameter in order to not have to duplicate the logic to derive a mask from the channel count everywhere an AudioSink is used without a known mask. A mask of 0 (CHANNEL_MASK_USE_CHANNEL_ORDER) means a mask will be automatically derived from the number of channels. Update existing AudioSink implementations to use the channel mask, and users of AudioSink to specify the mask if available, and CHANNEL_MASK_USE_CHANNEL_ORDER otherwise. Change-Id: Ifa9bd259874816dbc25ead2b03ea52e873cff474
Diffstat (limited to 'include/media/MediaPlayerInterface.h')
-rw-r--r--include/media/MediaPlayerInterface.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index f7491d8..8168dff 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -60,6 +60,8 @@ enum player_type {
#define DEFAULT_AUDIOSINK_BUFFERSIZE 1200
#define DEFAULT_AUDIOSINK_SAMPLERATE 44100
+// when the channel mask isn't known, use the channel count to derive a mask in AudioSink::open()
+#define CHANNEL_MASK_USE_CHANNEL_ORDER 0
// callback mechanism for passing messages to MediaPlayer object
typedef void (*notify_callback_f)(void* cookie,
@@ -91,7 +93,7 @@ public:
// If no callback is specified, use the "write" API below to submit
// audio data.
virtual status_t open(
- uint32_t sampleRate, int channelCount,
+ uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask,
audio_format_t format=AUDIO_FORMAT_PCM_16_BIT,
int bufferCount=DEFAULT_AUDIOSINK_BUFFERCOUNT,
AudioCallback cb = NULL,