Share via


MediaCodec.QueueInputBuffers(Int32, ArrayDeque) Method

Definition

Submit multiple access units to the codec along with multiple MediaCodec.BufferInfo describing the contents of the buffer.

[Android.Runtime.Register("queueInputBuffers", "(ILjava/util/ArrayDeque;)V", "", ApiSince=35)]
public void QueueInputBuffers (int index, Java.Util.ArrayDeque bufferInfos);
[<Android.Runtime.Register("queueInputBuffers", "(ILjava/util/ArrayDeque;)V", "", ApiSince=35)>]
member this.QueueInputBuffers : int * Java.Util.ArrayDeque -> unit

Parameters

index
Int32

The index of a client-owned input buffer previously returned in a call to #dequeueInputBuffer.

bufferInfos
ArrayDeque

ArrayDeque of MediaCodec.BufferInfo that describes the contents in the buffer. The ArrayDeque and the BufferInfo objects provided can be recycled by the caller for re-use.

Attributes

Remarks

Submit multiple access units to the codec along with multiple MediaCodec.BufferInfo describing the contents of the buffer. This method is supported only in asynchronous mode. While this method can be used for all codecs, it is meant for buffer batching, which is only supported by codecs that advertise FEATURE_MultipleFrames. Other codecs will not output large output buffers via onOutputBuffersAvailable, and instead will output single-access-unit output via onOutputBufferAvailable.

Output buffer size can be configured using the following MediaFormat keys. MediaFormat#KEY_BUFFER_BATCH_MAX_OUTPUT_SIZE and MediaFormat#KEY_BUFFER_BATCH_THRESHOLD_OUTPUT_SIZE. Details for each access unit present in the buffer should be described using MediaCodec.BufferInfo. Access units must be laid out contiguously (without any gaps) and in order. Multiple access units in the output if present, will be available in Callback#onOutputBuffersAvailable or Callback#onOutputBufferAvailable in case of single-access-unit output or when output does not contain any buffers, such as flags.

All other details for populating MediaCodec.BufferInfo is the same as described in #queueInputBuffer.

Java documentation for android.media.MediaCodec.queueInputBuffers(int, java.util.ArrayDeque<android.media.MediaCodec.BufferInfo>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to