diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2014-07-16 12:25:27 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2014-07-18 08:01:07 -0700 |
commit | 2e7dd4bfc2460b99c37568a223a18e74b9cb8086 (patch) | |
tree | fd2fc91654744063efc037d9373a18535b0f0346 /media | |
parent | e7d1f16fa9dca6761b9366648120603181c08c86 (diff) | |
download | frameworks_base-2e7dd4bfc2460b99c37568a223a18e74b9cb8086.zip frameworks_base-2e7dd4bfc2460b99c37568a223a18e74b9cb8086.tar.gz frameworks_base-2e7dd4bfc2460b99c37568a223a18e74b9cb8086.tar.bz2 |
Unhide audio virtualizer capability query methods
Unhide the new method to query the Virtualizer effect implementation
about its capabilities in terms of input, device support, and
virtual speaker angles.
Change-Id: I4478f7837efe8c9d52978244a3402c7f8590e585
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/AudioDevice.java | 87 | ||||
-rw-r--r-- | media/java/android/media/audiofx/Virtualizer.java | 6 |
2 files changed, 85 insertions, 8 deletions
diff --git a/media/java/android/media/AudioDevice.java b/media/java/android/media/AudioDevice.java index 96d6196..e078354 100644 --- a/media/java/android/media/AudioDevice.java +++ b/media/java/android/media/AudioDevice.java @@ -19,30 +19,91 @@ package android.media; import android.util.SparseIntArray; /** - * @hide - * CANDIDATE FOR PUBLIC API + * Class to provide information about the audio devices. */ public class AudioDevice { + /** + * A device type associated with an unknown or uninitialized device. + */ public static final int DEVICE_TYPE_UNKNOWN = 0; + /** + * A device type describing the attached earphone speaker. + */ public static final int DEVICE_TYPE_BUILTIN_EARPIECE = 1; + /** + * A device type describing the speaker system (i.e. a mono speaker or stereo speakers) built + * in a device. + */ public static final int DEVICE_TYPE_BUILTIN_SPEAKER = 2; + /** + * A device type describing a headset, which is the combination of a headphones and microphone. + */ public static final int DEVICE_TYPE_WIRED_HEADSET = 3; + /** + * A device type describing a pair of wired headphones . + */ public static final int DEVICE_TYPE_WIRED_HEADPHONES = 4; + /** + * A device type describing an analog line-level connection. + */ public static final int DEVICE_TYPE_LINE_ANALOG = 5; + /** + * A device type describing a digital line connection (e.g. SPDIF). + */ public static final int DEVICE_TYPE_LINE_DIGITAL = 6; + /** + * A device type describing a Bluetooth device typically used for telephony . + */ public static final int DEVICE_TYPE_BLUETOOTH_SCO = 7; + /** + * A device type describing a Bluetooth device supporting the A2DP profile. + */ public static final int DEVICE_TYPE_BLUETOOTH_A2DP = 8; + /** + * A device type describing an HDMI connection . + */ public static final int DEVICE_TYPE_HDMI = 9; + /** + * A device type describing the Audio Return Channel of an HDMI connection. + */ public static final int DEVICE_TYPE_HDMI_ARC = 10; + /** + * A device type describing a USB audio device. + */ public static final int DEVICE_TYPE_USB_DEVICE = 11; + /** + * A device type describing a USB audio device in accessory mode. + */ public static final int DEVICE_TYPE_USB_ACCESSORY = 12; + /** + * A device type describing the audio device associated with a dock. + */ public static final int DEVICE_TYPE_DOCK = 13; + /** + * A device type associated with the transmission of audio signals over FM. + */ public static final int DEVICE_TYPE_FM = 14; + /** + * A device type describing the microphone(s) built in a device. + */ public static final int DEVICE_TYPE_BUILTIN_MIC = 15; + /** + * A device type for accessing the audio content transmitted over FM. + */ public static final int DEVICE_TYPE_FM_TUNER = 16; + /** + * A device type for accessing the audio content transmitted over the TV tuner system. + */ public static final int DEVICE_TYPE_TV_TUNER = 17; + /** + * A device type describing the transmission of audio signals over the telephony network. + */ public static final int DEVICE_TYPE_TELEPHONY = 18; + /** + * A device type describing the auxiliary line-level connectors. + */ + public static final int DEVICE_TYPE_AUX_LINE = 19; AudioDevicePortConfig mConfig; @@ -50,18 +111,38 @@ public class AudioDevice { mConfig = new AudioDevicePortConfig(config); } + /** + * @hide + * CANDIDATE FOR PUBLIC API + * @return + */ public boolean isInputDevice() { return (mConfig.port().role() == AudioPort.ROLE_SOURCE); } + /** + * @hide + * CANDIDATE FOR PUBLIC API + * @return + */ public boolean isOutputDevice() { return (mConfig.port().role() == AudioPort.ROLE_SINK); } + /** + * @hide + * CANDIDATE FOR PUBLIC API + * @return + */ public int getDeviceType() { return INT_TO_EXT_DEVICE_MAPPING.get(mConfig.port().type(), DEVICE_TYPE_UNKNOWN); } + /** + * @hide + * CANDIDATE FOR PUBLIC API + * @return + */ public String getAddress() { return mConfig.port().address(); } @@ -102,6 +183,7 @@ public class AudioDevice { INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_HDMI_ARC, DEVICE_TYPE_HDMI_ARC); INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_SPDIF, DEVICE_TYPE_LINE_DIGITAL); INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_FM, DEVICE_TYPE_FM); + INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_OUT_AUX_LINE, DEVICE_TYPE_AUX_LINE); INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BUILTIN_MIC, DEVICE_TYPE_BUILTIN_MIC); INT_TO_EXT_DEVICE_MAPPING.put(AudioSystem.DEVICE_IN_BLUETOOTH_SCO_HEADSET, DEVICE_TYPE_BLUETOOTH_SCO); @@ -143,6 +225,7 @@ public class AudioDevice { EXT_TO_INT_DEVICE_MAPPING.put(DEVICE_TYPE_FM_TUNER, AudioSystem.DEVICE_IN_FM_TUNER); EXT_TO_INT_DEVICE_MAPPING.put(DEVICE_TYPE_TV_TUNER, AudioSystem.DEVICE_IN_TV_TUNER); EXT_TO_INT_DEVICE_MAPPING.put(DEVICE_TYPE_TELEPHONY, AudioSystem.DEVICE_OUT_TELEPHONY_TX); + EXT_TO_INT_DEVICE_MAPPING.put(DEVICE_TYPE_AUX_LINE, AudioSystem.DEVICE_OUT_AUX_LINE); } } diff --git a/media/java/android/media/audiofx/Virtualizer.java b/media/java/android/media/audiofx/Virtualizer.java index 136761b..78eeccb 100644 --- a/media/java/android/media/audiofx/Virtualizer.java +++ b/media/java/android/media/audiofx/Virtualizer.java @@ -248,8 +248,6 @@ public class Virtualizer extends AudioEffect { } /** - * @hide - * CANDIDATE FOR PUBLIC API * Checks if the combination of a channel mask and device type is supported by this virtualizer. * Some virtualizer implementations may only support binaural processing (i.e. only support * headphone output), some may support transaural processing (i.e. for speaker output) for the @@ -276,8 +274,6 @@ public class Virtualizer extends AudioEffect { } /** - * @hide - * CANDIDATE FOR PUBLIC API * Queries the virtual speaker angles (azimuth and elevation) for a combination of a channel * mask and device type. * If the virtualization configuration (mask and device) is supported (see @@ -318,8 +314,6 @@ public class Virtualizer extends AudioEffect { } /** - * @hide - * CANDIDATE FOR PUBLIC API * Forces the virtualizer effect to use the processing mode used for the given device type. * The effect must be enabled for the forced mode to be applied. * @param deviceType one of the device types defined in {@link AudioDevice}. |