Example usage for android.media MediaCodec getInputBuffer

List of usage examples for android.media MediaCodec getInputBuffer

Introduction

In this page you can find the example usage for android.media MediaCodec getInputBuffer.

Prototype

@Nullable
public ByteBuffer getInputBuffer(int index) 

Source Link

Document

Returns a java.nio.Buffer#clear cleared , writable ByteBuffer object for a dequeued input buffer index to contain the input data.

Usage

From source file:Main.java

public static ByteBuffer getInputBuffer(MediaCodec codec, int index) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        return codec.getInputBuffer(index);
    } else {/*from   w ww .jav a 2  s. c  om*/
        return codec.getInputBuffers()[index];
    }
}