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
diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h
index 53847ed..681ecab 100644
--- a/media/libmediaplayerservice/MediaPlayerService.h
+++ b/media/libmediaplayerservice/MediaPlayerService.h
@@ -85,7 +85,7 @@
virtual int getSessionId();
virtual status_t open(
- uint32_t sampleRate, int channelCount,
+ uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask,
audio_format_t format, int bufferCount,
AudioCallback cb, void *cookie);
@@ -145,8 +145,8 @@
virtual int getSessionId();
virtual status_t open(
- uint32_t sampleRate, int channelCount, audio_format_t format,
- int bufferCount = 1,
+ uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask,
+ audio_format_t format, int bufferCount = 1,
AudioCallback cb = NULL, void *cookie = NULL);
virtual void start();