- uint8_t *buf = lockBufferParams->bufferDataPtr;
- int off = inSurf->height * lockBufferParams->pitch;
-
- if (frame->format == AV_PIX_FMT_YUV420P) {
- av_image_copy_plane(buf, lockBufferParams->pitch,
- frame->data[0], frame->linesize[0],
- avctx->width, avctx->height);
-
- buf += off;
-
- av_image_copy_plane(buf, lockBufferParams->pitch >> 1,
- frame->data[2], frame->linesize[2],
- avctx->width >> 1, avctx->height >> 1);
-
- buf += off >> 2;
-
- av_image_copy_plane(buf, lockBufferParams->pitch >> 1,
- frame->data[1], frame->linesize[1],
- avctx->width >> 1, avctx->height >> 1);
- } else if (frame->format == AV_PIX_FMT_NV12) {
- av_image_copy_plane(buf, lockBufferParams->pitch,
- frame->data[0], frame->linesize[0],
- avctx->width, avctx->height);
-
- buf += off;
-
- av_image_copy_plane(buf, lockBufferParams->pitch,
- frame->data[1], frame->linesize[1],
- avctx->width, avctx->height >> 1);
- } else if (frame->format == AV_PIX_FMT_P010) {
- av_image_copy_plane(buf, lockBufferParams->pitch,
- frame->data[0], frame->linesize[0],
- avctx->width << 1, avctx->height);
-
- buf += off;
-
- av_image_copy_plane(buf, lockBufferParams->pitch,
- frame->data[1], frame->linesize[1],
- avctx->width << 1, avctx->height >> 1);
- } else if (frame->format == AV_PIX_FMT_YUV444P) {
- av_image_copy_plane(buf, lockBufferParams->pitch,
- frame->data[0], frame->linesize[0],
- avctx->width, avctx->height);
-
- buf += off;
-
- av_image_copy_plane(buf, lockBufferParams->pitch,
- frame->data[1], frame->linesize[1],
- avctx->width, avctx->height);
-
- buf += off;
-
- av_image_copy_plane(buf, lockBufferParams->pitch,
- frame->data[2], frame->linesize[2],
- avctx->width, avctx->height);
- } else if (frame->format == AV_PIX_FMT_YUV444P16) {
- av_image_copy_plane(buf, lockBufferParams->pitch,
- frame->data[0], frame->linesize[0],
- avctx->width << 1, avctx->height);