summaryrefslogtreecommitdiffstats
path: root/media/java/android
diff options
context:
space:
mode:
authorPaul McLean <pmclean@google.com>2015-06-16 21:41:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-16 21:41:23 +0000
commit8ff232c7be5e075b6b0e10b8f40b556c97b79651 (patch)
tree07acfc89cd4bcff171247a2b922e07d6008243c3 /media/java/android
parentb259a9036bab78222ea72f45b909d76361da4783 (diff)
parentf29e5f34b39a5688925ca4654be0eab11277b1cc (diff)
downloadframeworks_base-8ff232c7be5e075b6b0e10b8f40b556c97b79651.zip
frameworks_base-8ff232c7be5e075b6b0e10b8f40b556c97b79651.tar.gz
frameworks_base-8ff232c7be5e075b6b0e10b8f40b556c97b79651.tar.bz2
Merge "Implement channel index masks in AudioDeviceInfo." into mnc-dev
Diffstat (limited to 'media/java/android')
-rw-r--r--media/java/android/media/AudioDeviceInfo.java3
-rw-r--r--media/java/android/media/AudioDevicePort.java4
-rw-r--r--media/java/android/media/AudioMixPort.java5
-rw-r--r--media/java/android/media/AudioPort.java13
4 files changed, 18 insertions, 7 deletions
diff --git a/media/java/android/media/AudioDeviceInfo.java b/media/java/android/media/AudioDeviceInfo.java
index 431d37e..173d349 100644
--- a/media/java/android/media/AudioDeviceInfo.java
+++ b/media/java/android/media/AudioDeviceInfo.java
@@ -173,8 +173,7 @@ public final class AudioDeviceInfo {
* @see AudioFormat
*/
public @NonNull int[] getChannelIndexMasks() {
- // TODO: implement
- return new int[0];
+ return mPort.channelIndexMasks();
}
/**
diff --git a/media/java/android/media/AudioDevicePort.java b/media/java/android/media/AudioDevicePort.java
index c078260..aea39a3 100644
--- a/media/java/android/media/AudioDevicePort.java
+++ b/media/java/android/media/AudioDevicePort.java
@@ -37,12 +37,12 @@ public class AudioDevicePort extends AudioPort {
private final String mAddress;
AudioDevicePort(AudioHandle handle, String deviceName,
- int[] samplingRates, int[] channelMasks,
+ int[] samplingRates, int[] channelMasks, int[] channelIndexMasks,
int[] formats, AudioGain[] gains, int type, String address) {
super(handle,
(AudioManager.isInputDevice(type) == true) ?
AudioPort.ROLE_SOURCE : AudioPort.ROLE_SINK,
- deviceName, samplingRates, channelMasks, formats, gains);
+ deviceName, samplingRates, channelMasks, channelIndexMasks, formats, gains);
mType = type;
mAddress = address;
}
diff --git a/media/java/android/media/AudioMixPort.java b/media/java/android/media/AudioMixPort.java
index ab55c8d..ba144bf 100644
--- a/media/java/android/media/AudioMixPort.java
+++ b/media/java/android/media/AudioMixPort.java
@@ -31,9 +31,10 @@ public class AudioMixPort extends AudioPort {
private final int mIoHandle;
AudioMixPort(AudioHandle handle, int ioHandle, int role, String deviceName,
- int[] samplingRates, int[] channelMasks,
+ int[] samplingRates, int[] channelMasks, int[] channelIndexMasks,
int[] formats, AudioGain[] gains) {
- super(handle, role, deviceName, samplingRates, channelMasks, formats, gains);
+ super(handle, role, deviceName, samplingRates, channelMasks, channelIndexMasks,
+ formats, gains);
mIoHandle = ioHandle;
}
diff --git a/media/java/android/media/AudioPort.java b/media/java/android/media/AudioPort.java
index 7328d7a..19bf51d 100644
--- a/media/java/android/media/AudioPort.java
+++ b/media/java/android/media/AudioPort.java
@@ -71,12 +71,13 @@ public class AudioPort {
private final String mName;
private final int[] mSamplingRates;
private final int[] mChannelMasks;
+ private final int[] mChannelIndexMasks;
private final int[] mFormats;
private final AudioGain[] mGains;
private AudioPortConfig mActiveConfig;
AudioPort(AudioHandle handle, int role, String name,
- int[] samplingRates, int[] channelMasks,
+ int[] samplingRates, int[] channelMasks, int[] channelIndexMasks,
int[] formats, AudioGain[] gains) {
mHandle = handle;
@@ -84,6 +85,7 @@ public class AudioPort {
mName = name;
mSamplingRates = samplingRates;
mChannelMasks = channelMasks;
+ mChannelIndexMasks = channelIndexMasks;
mFormats = formats;
mGains = gains;
}
@@ -133,6 +135,15 @@ public class AudioPort {
}
/**
+ * Get the list of supported channel index mask configurations
+ * (e.g 0x0003 means 2 channel, 0x000F means 4 channel....)
+ * Empty array if channel index mask is not relevant for this audio port
+ */
+ public int[] channelIndexMasks() {
+ return mChannelIndexMasks;
+ }
+
+ /**
* Get the list of supported audio format configurations
* (e.g AudioFormat.ENCODING_PCM_16BIT)
* Empty array if format is not relevant for this audio port