I420Copy

open fun I420Copy(srcY: ByteBuffer, srcStrideY: Int, srcU: ByteBuffer, srcStrideU: Int, srcV: ByteBuffer, srcStrideV: Int, dst: ByteBuffer, dstWidth: Int, dstHeight: Int, dstStrideY: Int, dstSliceHeightY: Int, dstStrideU: Int, dstSliceHeightU: Int)

Copy I420 Buffer to a contiguously allocated buffer.

In Android, MediaCodec can request a buffer of a specific layout with the stride and slice-height (or plane height), and this function is used in this case.

For more information, see https://cs.android.com/android/platform/superproject/+/64fea7e5726daebc40f46890100837c01091100d:frameworks/base/media/java/android/media/MediaFormat.java;l=568

Parameters

dstStrideY

the stride of output buffers' Y plane.

dstSliceHeightY

the slice-height of output buffer's Y plane.

dstStrideU

the stride of output buffers' U (and V) plane.

dstSliceHeightU

the slice-height of output buffer's U (and V) plane


open fun I420Copy(srcY: ByteBuffer, srcStrideY: Int, srcU: ByteBuffer, srcStrideU: Int, srcV: ByteBuffer, srcStrideV: Int, dst: ByteBuffer, dstWidth: Int, dstHeight: Int)

Helper method for copying I420 to tightly packed destination buffer.


open fun I420Copy(srcY: ByteBuffer, srcStrideY: Int, srcU: ByteBuffer, srcStrideU: Int, srcV: ByteBuffer, srcStrideV: Int, dst: ByteBuffer, dstWidth: Int, dstHeight: Int, dstStride: Int, dstSliceHeight: Int)

Helper method for copying I420 to buffer with the given stride and slice height.


open fun I420Copy(srcY: ByteBuffer, srcStrideY: Int, srcU: ByteBuffer, srcStrideU: Int, srcV: ByteBuffer, srcStrideV: Int, dstY: ByteBuffer, dstStrideY: Int, dstU: ByteBuffer, dstStrideU: Int, dstV: ByteBuffer, dstStrideV: Int, width: Int, height: Int)

Copies I420 to the I420 dst buffer.

Unlike `libyuv::I420Copy`, this function checks if the height <= 0, so flipping is not supported.