Lines Matching refs:mask

24  * Return the default OpenSL ES output channel mask (as used in SLDataFormat_PCM.channelMask)
32 // FIXME channel mask is not yet implemented by Stagefright, so use a reasonable default
39 // see explanation in data.c re: default channel mask for mono
63 * Return the default OpenSL ES input channel mask (as used in SLDataFormat_PCM.channelMask)
88 * Get the number of active channels in an OpenSL ES channel mask.
93 SLuint32 sles_channel_count_from_mask(SLuint32 mask) {
95 = sles_to_audio_channel_mask_representation(mask);
98 mask &= SL_ANDROID_INDEXED_SPEAKER_MASK_ALL;
99 return popcount(mask);
101 mask &= SL_ANDROID_POSITIONAL_SPEAKER_MASK_ALL;
102 return popcount(mask);
109 * Helper to determine whether a channel mask is indexed or not.
113 audio_channel_representation_t sles_to_audio_channel_mask_representation(SLuint32 mask) {
114 if (mask & SL_ANDROID_SPEAKER_NON_POSITIONAL) {
162 // Core channel mask mapper; implementation common to both input and output
164 SLuint32 mask,
167 if (!sles_is_channel_mask_valid(mask)) {
168 SL_LOGW("Channel mask %#x is invalid because it uses bits that are undefined.", mask);
172 // determine whether this mask uses positional or indexed representation
173 audio_channel_representation_t rep = sles_to_audio_channel_mask_representation(mask);
176 uint32_t bitsIn = mask;
199 // At this point mask has already been stripped of the
206 SL_LOGW("Conversion from OpenSL ES %s channel mask %#x to Android mask %#x %s channels",
208 mask,
217 * Return an android output channel mask, as used in the AudioTrack constructor.
219 audio_channel_mask_t sles_to_audio_output_channel_mask(SLuint32 mask) {
220 return sles_to_android_mask_helper(mask, output_map, nOutputChannelMappings);
224 * Return an android input channel mask, as used in the AudioRecord constructor.
226 audio_channel_mask_t sles_to_audio_input_channel_mask(SLuint32 mask) {
227 return sles_to_android_mask_helper(mask, input_map, nInputChannelMappings);
231 * Check the mask for undefined bits (that is, set bits that don't correspond to a channel).
235 SLboolean sles_is_channel_mask_valid(SLuint32 mask) {
237 if (sles_to_audio_channel_mask_representation(mask) == AUDIO_CHANNEL_REPRESENTATION_POSITION) {
243 return (mask & undefinedMask) ? SL_BOOLEAN_FALSE : SL_BOOLEAN_TRUE;