Android.Media.MediaCodec.QueueInputBuffer Method
After filling a range of the input buffer at the specified index submit it to the component.

Syntax

[Android.Runtime.Register("queueInputBuffer", "(IIIJI)V", "")]
public void QueueInputBuffer (int index, int offset, int size, long presentationTimeUs, [Android.Runtime.GeneratedEnum] MediaCodecBufferFlags flags)

Parameters

index
The index of a client-owned input buffer previously returned in a call to MediaCodec.DequeueInputBuffer(long).
offset
The byte offset into the input buffer at which the data starts.
size
The number of bytes of valid input data.
presentationTimeUs
The presentation timestamp in microseconds for this buffer. This is normally the media time at which this buffer should be presented (rendered).
flags
A bitmask of flags MediaCodec.BufferFlagCodecConfig and MediaCodec.BufferFlagEndOfStream. While not prohibited, most codecs do not use the MediaCodec.BufferFlagKeyFrame flag for input buffers.

Exceptions

TypeReason
Java.Lang.IllegalStateExceptionif not in the Executing state.
!:NoType:android/media/MediaCodec$CodecException;Href=../../../reference/android/media/MediaCodec.CodecException.htmlupon codec error.
!:NoType:android/media/MediaCodec$CryptoException;Href=../../../reference/android/media/MediaCodec.CryptoException.htmlif a crypto object has been specified in MediaCodec.Configure(MediaFormat, Android.Views.Surface, Android.Views.Surface, Android.Views.Surface)

Remarks

After filling a range of the input buffer at the specified index submit it to the component. Once an input buffer is queued to the codec, it MUST NOT be used until it is later retrieved by MediaCodec.GetInputBuffer(int) in response to a MediaCodec.DequeueInputBuffer(long) return value or a NoType:android/media/MediaCodec$Callback;Href=../../../reference/android/media/MediaCodec.Callback.html#onInputBufferAvailable(android.media.MediaCodec, int) callback.

Many decoders require the actual compressed data stream to be preceded by "codec specific data", i.e. setup data used to initialize the codec such as PPS/SPS in the case of AVC video or code tables in the case of vorbis audio. The class Android.Media.MediaExtractor provides codec specific data as part of the returned track format in entries named "csd-0", "csd-1" ...

These buffers can be submitted directly after MediaCodec.Start or MediaCodec.Flush by specifying the flag MediaCodec.BufferFlagCodecConfig. However, if you configure the codec with a Android.Media.MediaFormat containing these keys, they will be automatically submitted by MediaCodec directly after start. Therefore, the use of MediaCodec.BufferFlagCodecConfig flag is discouraged and is recommended only for advanced users.

To indicate that this is the final piece of input data (or rather that no more input data follows unless the decoder is subsequently flushed) specify the flag MediaCodec.BufferFlagEndOfStream.

[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