Example usage for android.media MediaCodec getOutputBuffer

List of usage examples for android.media MediaCodec getOutputBuffer

Introduction

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

Prototype

@Nullable
public ByteBuffer getOutputBuffer(int index) 

Source Link

Document

Returns a read-only ByteBuffer for a dequeued output buffer index.

Usage

From source file:Main.java

public static ByteBuffer getOutputBuffer(MediaCodec codec, int index) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        return codec.getOutputBuffer(index);
    } else {/*ww  w  .ja v a 2  s.  c  o m*/
        return codec.getOutputBuffers()[index];
    }
}