Android APIs
public static abstract class

MediaCodec.Callback

extends Object
java.lang.Object
   ↳ android.media.MediaCodec.Callback

Class Overview

MediaCodec callback interface. Used to notify the user asynchronously of various MediaCodec events.

Summary

Public Constructors
MediaCodec.Callback()
Public Methods
abstract void onError(MediaCodec codec, MediaCodec.CodecException e)
Called when the MediaCodec encountered an error
abstract void onInputBufferAvailable(MediaCodec codec, int index)
Called when an input buffer becomes available.
abstract void onOutputBufferAvailable(MediaCodec codec, int index, MediaCodec.BufferInfo info)
Called when an output buffer becomes available.
abstract void onOutputFormatChanged(MediaCodec codec, MediaFormat format)
Called when the output format has changed
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MediaCodec.Callback ()

Added in API level 21

Public Methods

public abstract void onError (MediaCodec codec, MediaCodec.CodecException e)

Added in API level 21

Called when the MediaCodec encountered an error

Parameters
codec The MediaCodec object.
e The MediaCodec.CodecException object describing the error.

public abstract void onInputBufferAvailable (MediaCodec codec, int index)

Added in API level 21

Called when an input buffer becomes available.

Parameters
codec The MediaCodec object.
index The index of the available input buffer.

public abstract void onOutputBufferAvailable (MediaCodec codec, int index, MediaCodec.BufferInfo info)

Added in API level 21

Called when an output buffer becomes available.

Parameters
codec The MediaCodec object.
index The index of the available output buffer.
info Info regarding the available output buffer MediaCodec.BufferInfo.

public abstract void onOutputFormatChanged (MediaCodec codec, MediaFormat format)

Added in API level 21

Called when the output format has changed

Parameters
codec The MediaCodec object.
format The new output format.