Merge "AmrInputStream is not a public API"

This commit is contained in:
Treehugger Robot
2017-09-29 19:50:37 +00:00
committed by Gerrit Code Review

View File

@@ -25,7 +25,7 @@ import android.util.Log;
/**
* AmrInputStream
* DO NOT USE
* @hide
*/
public final class AmrInputStream extends InputStream {
@@ -51,10 +51,10 @@ public final class AmrInputStream extends InputStream {
private byte[] mOneByte = new byte[1];
/**
* Create a new AmrInputStream, which converts 16 bit PCM to AMR
* @param inputStream InputStream containing 16 bit PCM.
* DO NOT USE - use MediaCodec instead
*/
public AmrInputStream(InputStream inputStream) {
Log.w(TAG, "@@@@ AmrInputStream is not a public API @@@@");
mInputStream = inputStream;
MediaFormat format = new MediaFormat();
@@ -83,17 +83,26 @@ public final class AmrInputStream extends InputStream {
mInfo = new BufferInfo();
}
/**
* DO NOT USE
*/
@Override
public int read() throws IOException {
int rtn = read(mOneByte, 0, 1);
return rtn == 1 ? (0xff & mOneByte[0]) : -1;
}
/**
* DO NOT USE
*/
@Override
public int read(byte[] b) throws IOException {
return read(b, 0, b.length);
}
/**
* DO NOT USE
*/
@Override
public int read(byte[] b, int offset, int length) throws IOException {
if (mCodec == null) {