summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt3
-rw-r--r--media/java/android/media/AudioFormat.java27
2 files changed, 27 insertions, 3 deletions
diff --git a/api/current.txt b/api/current.txt
index c5027ae..dd846fc 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -14095,6 +14095,9 @@ package android.media {
}
public class AudioFormat {
+ method public int getChannelMask();
+ method public int getEncoding();
+ method public int getSampleRate();
field public static final deprecated int CHANNEL_CONFIGURATION_DEFAULT = 1; // 0x1
field public static final deprecated int CHANNEL_CONFIGURATION_INVALID = 0; // 0x0
field public static final deprecated int CHANNEL_CONFIGURATION_MONO = 2; // 0x2
diff --git a/media/java/android/media/AudioFormat.java b/media/java/android/media/AudioFormat.java
index 2a612e8..8d99d6a 100644
--- a/media/java/android/media/AudioFormat.java
+++ b/media/java/android/media/AudioFormat.java
@@ -263,18 +263,39 @@ public class AudioFormat {
private int mChannelMask;
private int mPropertySetMask;
- /** @hide */
+ /**
+ * Return the encoding.
+ * @return one of the values that can be set in {@link Builder#setEncoding(int)} or
+ * {@link AudioFormat#ENCODING_INVALID} if not set.
+ */
public int getEncoding() {
+ if ((mPropertySetMask & AUDIO_FORMAT_HAS_PROPERTY_ENCODING) == 0) {
+ return ENCODING_INVALID;
+ }
return mEncoding;
}
- /** @hide */
+ /**
+ * Return the sample rate.
+ * @return one of the values that can be set in {@link Builder#setSampleRate(int)} or
+ * 0 if not set.
+ */
public int getSampleRate() {
+ if ((mPropertySetMask & AUDIO_FORMAT_HAS_PROPERTY_SAMPLE_RATE) == 0) {
+ return 0;
+ }
return mSampleRate;
}
- /** @hide */
+ /**
+ * Return the channel mask.
+ * @return one of the values that can be set in {@link Builder#setChannelMask(int)} or
+ * {@link AudioFormat#CHANNEL_INVALID} if not set.
+ */
public int getChannelMask() {
+ if ((mPropertySetMask & AUDIO_FORMAT_HAS_PROPERTY_CHANNEL_MASK) == 0) {
+ return CHANNEL_INVALID;
+ }
return mChannelMask;
}