summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-07-18 17:04:21 -0700
committerGlenn Kasten <gkasten@google.com>2013-07-24 12:20:52 -0700
commit33c437df39029b70d4ffafac2ca31bd71eafd0c6 (patch)
tree3bded6e4b41d9173fdcf541828da1876fc3c4268 /media
parentd5af238199b5c9f73d87fd57b7485a3a972629a7 (diff)
downloadframeworks_base-33c437df39029b70d4ffafac2ca31bd71eafd0c6.zip
frameworks_base-33c437df39029b70d4ffafac2ca31bd71eafd0c6.tar.gz
frameworks_base-33c437df39029b70d4ffafac2ca31bd71eafd0c6.tar.bz2
Rename mChannels to mChannelMask to avoid ambiguity
This clarifies that it's a channel mask, as opposed to a count. Also no need to initialize the field in the declaration, as it's initialized in the constructor. Include channel mask in error logs. Change-Id: Ifc02668cf922dc8826a9fb042b3ca52fad377ba6
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioRecord.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java
index 21d5884..be7c3b8 100644
--- a/media/java/android/media/AudioRecord.java
+++ b/media/java/android/media/AudioRecord.java
@@ -132,7 +132,7 @@ public class AudioRecord
/**
* The audio channel mask
*/
- private int mChannels = AudioFormat.CHANNEL_IN_MONO;
+ private int mChannelMask;
/**
* The encoding of the audio samples.
* @see AudioFormat#ENCODING_PCM_8BIT
@@ -228,7 +228,7 @@ public class AudioRecord
//TODO: update native initialization when information about hardware init failure
// due to capture device already open is available.
int initResult = native_setup( new WeakReference<AudioRecord>(this),
- mRecordSource, mSampleRate, mChannels, mAudioFormat, mNativeBufferSizeInBytes,
+ mRecordSource, mSampleRate, mChannelMask, mAudioFormat, mNativeBufferSizeInBytes,
session);
if (initResult != SUCCESS) {
loge("Error code "+initResult+" when initializing native AudioRecord object.");
@@ -246,7 +246,7 @@ public class AudioRecord
// postconditions:
// mRecordSource is valid
// mChannelCount is valid
- // mChannels is valid
+ // mChannelMask is valid
// mAudioFormat is valid
// mSampleRate is valid
private void audioParamCheck(int audioSource, int sampleRateInHz,
@@ -277,20 +277,20 @@ public class AudioRecord
case AudioFormat.CHANNEL_IN_MONO:
case AudioFormat.CHANNEL_CONFIGURATION_MONO:
mChannelCount = 1;
- mChannels = AudioFormat.CHANNEL_IN_MONO;
+ mChannelMask = AudioFormat.CHANNEL_IN_MONO;
break;
case AudioFormat.CHANNEL_IN_STEREO:
case AudioFormat.CHANNEL_CONFIGURATION_STEREO:
mChannelCount = 2;
- mChannels = AudioFormat.CHANNEL_IN_STEREO;
+ mChannelMask = AudioFormat.CHANNEL_IN_STEREO;
break;
case (AudioFormat.CHANNEL_IN_FRONT | AudioFormat.CHANNEL_IN_BACK):
mChannelCount = 2;
- mChannels = channelConfig;
+ mChannelMask = channelConfig;
break;
default:
mChannelCount = 0;
- mChannels = AudioFormat.CHANNEL_INVALID;
+ mChannelMask = AudioFormat.CHANNEL_INVALID;
throw (new IllegalArgumentException("Unsupported channel configuration."));
}
@@ -386,7 +386,7 @@ public class AudioRecord
* and {@link AudioFormat#CHANNEL_IN_STEREO}.
*/
public int getChannelConfiguration() {
- return mChannels;
+ return mChannelMask;
}
/**