Android.Media.MediaCodec.SetCallback Method
Sets an asynchronous callback for actionable MediaCodec events.

Syntax

[Android.Runtime.Register("setCallback", "(Landroid/media/MediaCodec$Callback;)V", "")]
public void SetCallback (MediaCodec.Callback cb)

Parameters

cb
The callback that will run.

Remarks

Sets an asynchronous callback for actionable MediaCodec events. If the client intends to use the component in asynchronous mode, a valid callback should be provided before MediaCodec.Configure(MediaFormat, Android.Views.Surface, Android.Views.Surface, Android.Views.Surface) is called. When asynchronous callback is enabled, the client should not call MediaCodec.GetInputBuffers, MediaCodec.GetOutputBuffers, MediaCodec.DequeueInputBuffer(long) or MediaCodec.DequeueOutputBuffer(.BufferInfo, System.Int64).

Also, MediaCodec.Flush behaves differently in asynchronous mode. After calling flush, you must call MediaCodec.Start to "resume" receiving input buffers, even if an input surface was created.

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 16