summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Phil Burk <philburk@google.com> 2016-01-17 17:27:30 -0800
committer Phil Burk <philburk@google.com> 2016-01-27 23:24:20 +0000
commitdc5f02778314ac9bcd45bbf356c48c04c96597ec (patch)
tree55348c54bd28ac78ca20efde8c8f9dcde3c2df8d
parent8b0b0e3b92d227817f7f64691d092dddbbb72d60 (diff)
AudioTrack: make low latency APIs public
Allow apps to lower their Java audio latency. Bug: 21019153 Change-Id: I1be9a083c46e9fcf7db2635e813cab13dbad810a Signed-off-by: Phil Burk <philburk@google.com>
-rw-r--r--api/current.txt4
-rw-r--r--api/system-current.txt4
-rw-r--r--api/test-current.txt4
-rw-r--r--media/java/android/media/AudioAttributes.java1
-rw-r--r--media/java/android/media/AudioTrack.java3
5 files changed, 12 insertions, 4 deletions
diff --git a/api/current.txt b/api/current.txt
index bfbb17e94cea..c1cd9207ba7a 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -19209,6 +19209,7 @@ package android.media {
field public static final android.os.Parcelable.Creator<android.media.AudioAttributes> CREATOR;
field public static final int FLAG_AUDIBILITY_ENFORCED = 1; // 0x1
field public static final int FLAG_HW_AV_SYNC = 16; // 0x10
+ field public static final int FLAG_LOW_LATENCY = 256; // 0x100
field public static final int USAGE_ALARM = 4; // 0x4
field public static final int USAGE_ASSISTANCE_ACCESSIBILITY = 11; // 0xb
field public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE = 12; // 0xc
@@ -19606,6 +19607,7 @@ package android.media {
method public void flush();
method public int getAudioFormat();
method public int getAudioSessionId();
+ method public int getBufferCapacityInFrames();
method public int getBufferSizeInFrames();
method public int getChannelConfiguration();
method public int getChannelCount();
@@ -19627,6 +19629,7 @@ package android.media {
method public int getState();
method public int getStreamType();
method public boolean getTimestamp(android.media.AudioTimestamp);
+ method public int getUnderrunCount();
method public void pause() throws java.lang.IllegalStateException;
method public void play() throws java.lang.IllegalStateException;
method public void release();
@@ -19634,6 +19637,7 @@ package android.media {
method public deprecated void removeOnRoutingChangedListener(android.media.AudioTrack.OnRoutingChangedListener);
method public void removeOnRoutingListener(android.media.AudioRouting.OnRoutingChangedListener);
method public int setAuxEffectSendLevel(float);
+ method public int setBufferSizeInFrames(int);
method public int setLoopPoints(int, int, int);
method public int setNotificationMarkerPosition(int);
method public int setPlaybackHeadPosition(int);
diff --git a/api/system-current.txt b/api/system-current.txt
index c10954c2da4c..8a413499e938 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -20534,6 +20534,7 @@ package android.media {
field public static final int FLAG_BYPASS_MUTE = 128; // 0x80
field public static final int FLAG_HW_AV_SYNC = 16; // 0x10
field public static final int FLAG_HW_HOTWORD = 32; // 0x20
+ field public static final int FLAG_LOW_LATENCY = 256; // 0x100
field public static final int USAGE_ALARM = 4; // 0x4
field public static final int USAGE_ASSISTANCE_ACCESSIBILITY = 11; // 0xb
field public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE = 12; // 0xc
@@ -20957,6 +20958,7 @@ package android.media {
method public void flush();
method public int getAudioFormat();
method public int getAudioSessionId();
+ method public int getBufferCapacityInFrames();
method public int getBufferSizeInFrames();
method public int getChannelConfiguration();
method public int getChannelCount();
@@ -20978,6 +20980,7 @@ package android.media {
method public int getState();
method public int getStreamType();
method public boolean getTimestamp(android.media.AudioTimestamp);
+ method public int getUnderrunCount();
method public void pause() throws java.lang.IllegalStateException;
method public void play() throws java.lang.IllegalStateException;
method public void release();
@@ -20985,6 +20988,7 @@ package android.media {
method public deprecated void removeOnRoutingChangedListener(android.media.AudioTrack.OnRoutingChangedListener);
method public void removeOnRoutingListener(android.media.AudioRouting.OnRoutingChangedListener);
method public int setAuxEffectSendLevel(float);
+ method public int setBufferSizeInFrames(int);
method public int setLoopPoints(int, int, int);
method public int setNotificationMarkerPosition(int);
method public int setPlaybackHeadPosition(int);
diff --git a/api/test-current.txt b/api/test-current.txt
index c076ad6e20e7..169bb613846a 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -19217,6 +19217,7 @@ package android.media {
field public static final android.os.Parcelable.Creator<android.media.AudioAttributes> CREATOR;
field public static final int FLAG_AUDIBILITY_ENFORCED = 1; // 0x1
field public static final int FLAG_HW_AV_SYNC = 16; // 0x10
+ field public static final int FLAG_LOW_LATENCY = 256; // 0x100
field public static final int USAGE_ALARM = 4; // 0x4
field public static final int USAGE_ASSISTANCE_ACCESSIBILITY = 11; // 0xb
field public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE = 12; // 0xc
@@ -19614,6 +19615,7 @@ package android.media {
method public void flush();
method public int getAudioFormat();
method public int getAudioSessionId();
+ method public int getBufferCapacityInFrames();
method public int getBufferSizeInFrames();
method public int getChannelConfiguration();
method public int getChannelCount();
@@ -19635,6 +19637,7 @@ package android.media {
method public int getState();
method public int getStreamType();
method public boolean getTimestamp(android.media.AudioTimestamp);
+ method public int getUnderrunCount();
method public void pause() throws java.lang.IllegalStateException;
method public void play() throws java.lang.IllegalStateException;
method public void release();
@@ -19642,6 +19645,7 @@ package android.media {
method public deprecated void removeOnRoutingChangedListener(android.media.AudioTrack.OnRoutingChangedListener);
method public void removeOnRoutingListener(android.media.AudioRouting.OnRoutingChangedListener);
method public int setAuxEffectSendLevel(float);
+ method public int setBufferSizeInFrames(int);
method public int setLoopPoints(int, int, int);
method public int setNotificationMarkerPosition(int);
method public int setPlaybackHeadPosition(int);
diff --git a/media/java/android/media/AudioAttributes.java b/media/java/android/media/AudioAttributes.java
index efae628f9e53..c194711f7fa0 100644
--- a/media/java/android/media/AudioAttributes.java
+++ b/media/java/android/media/AudioAttributes.java
@@ -224,7 +224,6 @@ public final class AudioAttributes implements Parcelable {
public final static int FLAG_BYPASS_MUTE = 0x1 << 7;
/**
- * @hide
* Flag requesting a low latency path.
* When using this flag, the sample rate must match the native sample rate
* of the device. Effects processing is also unavailable.
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java
index 431984081405..3007d86afebc 100644
--- a/media/java/android/media/AudioTrack.java
+++ b/media/java/android/media/AudioTrack.java
@@ -1100,7 +1100,6 @@ public class AudioTrack implements AudioRouting
* @return error code or success, see {@link #SUCCESS}, {@link #ERROR_BAD_VALUE},
* {@link #ERROR_INVALID_OPERATION}
* @throws IllegalStateException
- * @hide
*/
public int setBufferSizeInFrames(int bufferSizeInFrames) {
if (mDataLoadMode == MODE_STATIC || mState == STATE_UNINITIALIZED) {
@@ -1130,7 +1129,6 @@ public class AudioTrack implements AudioRouting
* {@link AudioManager#PROPERTY_OUTPUT_FRAMES_PER_BUFFER}.
* @return maximum size in frames of the <code>AudioTrack</code> buffer.
* @throws IllegalStateException
- * @hide
*/
public int getBufferCapacityInFrames() {
return native_get_buffer_capacity_frames();
@@ -1204,7 +1202,6 @@ public class AudioTrack implements AudioRouting
* This is a continuously advancing counter. It can wrap around to zero
* if there are too many underruns. If there were, for example, 68 underruns per
* second then the counter would wrap in 2 years.
- * @hide
*/
public int getUnderrunCount() {
return native_get_underrun_count();