Added in API level 21
Callback
abstract class Callback
| kotlin.Any | |
| ↳ | android.media.MediaCodec.Callback |
MediaCodec callback interface. Used to notify the user asynchronously of various MediaCodec events.
Summary
Public constructors |
|
|---|---|
<init>() |
|
Public methods |
|
|---|---|
| abstract Unit |
onError(codec: MediaCodec, e: MediaCodec.CodecException)Called when the MediaCodec encountered an error |
| abstract Unit |
onInputBufferAvailable(codec: MediaCodec, index: Int)Called when an input buffer becomes available. |
| abstract Unit |
onOutputBufferAvailable(codec: MediaCodec, index: Int, info: MediaCodec.BufferInfo)Called when an output buffer becomes available. |
| abstract Unit |
onOutputFormatChanged(codec: MediaCodec, format: MediaFormat)Called when the output format has changed |
Public constructors
<init>
Callback()
Public methods
onError
Added in API level 21
abstract fun onError(
codec: MediaCodec,
e: MediaCodec.CodecException
): Unit
Called when the MediaCodec encountered an error
| Parameters | |
|---|---|
codec |
MediaCodec: The MediaCodec object. This value cannot be null. |
e |
MediaCodec.CodecException: The MediaCodec.CodecException object describing the error. This value cannot be null. |
onInputBufferAvailable
Added in API level 21
abstract fun onInputBufferAvailable(
codec: MediaCodec,
index: Int
): Unit
Called when an input buffer becomes available.
| Parameters | |
|---|---|
codec |
MediaCodec: The MediaCodec object. This value cannot be null. |
index |
Int: The index of the available input buffer. |
onOutputBufferAvailable
Added in API level 21
abstract fun onOutputBufferAvailable(
codec: MediaCodec,
index: Int,
info: MediaCodec.BufferInfo
): Unit
Called when an output buffer becomes available.
| Parameters | |
|---|---|
codec |
MediaCodec: The MediaCodec object. This value cannot be null. |
index |
Int: The index of the available output buffer. |
info |
MediaCodec.BufferInfo: Info regarding the available output buffer MediaCodec.BufferInfo. This value cannot be null. |
onOutputFormatChanged
Added in API level 21
abstract fun onOutputFormatChanged(
codec: MediaCodec,
format: MediaFormat
): Unit
Called when the output format has changed
| Parameters | |
|---|---|
codec |
MediaCodec: The MediaCodec object. This value cannot be null. |
format |
MediaFormat: The new output format. This value cannot be null. |