imx6 optimization: crop framebuffer dimension to screen dimension.

This commit is contained in:
tezcatli
2017-03-03 21:23:50 +00:00
committed by Iwan Timmer
parent e7912ddc8b
commit 44937321c6

View File

@@ -87,11 +87,18 @@ static void decoder_renderer_setup(int videoFormat, int width, int height, int r
exit(EXIT_FAILURE);
}
struct v4l2_rect icrop = {0};
icrop.left = 0;
icrop.top = 0;
icrop.width = width;
icrop.height = height;
struct v4l2_format fmt = {0};
fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
fmt.fmt.pix.width = picWidth;
fmt.fmt.pix.height = picHeight;
fmt.fmt.pix.bytesperline = picWidth;
fmt.fmt.pix.priv = (unsigned long)&icrop;
fmt.fmt.pix.field = V4L2_FIELD_ANY;
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420;
if (ioctl(fd, VIDIOC_S_FMT, &fmt) < 0) {