Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 323d2a56 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

AmrInputStream is not a public API

and nobody should be using it. Add some warnings to that effect.

Change-Id: I8029ccd665fd147b4708a68f61c6aa055004a5c1
parent f4ec2ab7
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -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) {