MediaCodec.QueueRequest.SetHardwareBuffer(HardwareBuffer) Method

Definition

Set a hardware graphic buffer to this queue request.

[Android.Runtime.Register("setHardwareBuffer", "(Landroid/hardware/HardwareBuffer;)Landroid/media/MediaCodec$QueueRequest;", "", ApiSince=30)]
public Android.Media.MediaCodec.QueueRequest SetHardwareBuffer(Android.Hardware.HardwareBuffer buffer);
[<Android.Runtime.Register("setHardwareBuffer", "(Landroid/hardware/HardwareBuffer;)Landroid/media/MediaCodec$QueueRequest;", "", ApiSince=30)>]
member this.SetHardwareBuffer : Android.Hardware.HardwareBuffer -> Android.Media.MediaCodec.QueueRequest

Parameters

buffer
HardwareBuffer

The hardware graphic buffer object. This value cannot be null.

Returns

this object. This value cannot be null.

Attributes

Remarks

Set a hardware graphic buffer to this queue request. Exactly one buffer must be set for a queue request before calling queue(). Ownership of the hardware buffer is not transferred to this queue request, nor will it be transferred to the codec once queue() is called. Note: buffers should have format HardwareBuffer.YCBCR_420_888, a single layer, and an appropriate usage ( HardwareBuffer.USAGE_CPU_READ_OFTEN for software codecs and HardwareBuffer.USAGE_VIDEO_ENCODE for hardware) for codecs to recognize. Format ImageFormat.PRIVATE together with usage HardwareBuffer.USAGE_VIDEO_ENCODE will also work for hardware codecs. Codecs may throw exception if the buffer is not recognizable.

Android reference for android.media.MediaCodec.QueueRequest.setHardwareBuffer.

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