diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-12-12 00:51:25 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-01-06 14:02:54 +0100 |
commit | 38591700b3a570861c4fc4223cd7bc05d4cf7e21 (patch) | |
tree | 20c1f305af416bca30ebbcc86a7dd4bdac0422a6 /videoout.c | |
parent | 0bf93fa12e7a1a022bd71fea607061b8d6669751 (diff) |
videoout: Take pixel format as a parameter to vo_init()
Pass a struct v4l2_pix_format * instead of width and height.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'videoout.c')
-rw-r--r-- | videoout.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -54,7 +54,7 @@ struct videoout struct videoout *vo_init(const char *devname, const struct video_out_operations *ops, unsigned int buffers, - unsigned int width, unsigned int height) + struct v4l2_pix_format *format) { struct v4l2_pix_format pixfmt; struct v4l2_format fmt; @@ -76,9 +76,9 @@ struct videoout *vo_init(const char *devname, goto error; } - pixfmt.pixelformat = V4L2_PIX_FMT_YUYV; - pixfmt.width = width; - pixfmt.height = height; + pixfmt.pixelformat = format->pixelformat; + pixfmt.width = format->width; + pixfmt.height = format->height; pixfmt.field = V4L2_FIELD_ANY; ret = v4l2_set_format(vo->dev, &pixfmt); @@ -90,8 +90,8 @@ struct videoout *vo_init(const char *devname, fmt.type = V4L2_BUF_TYPE_VIDEO_OVERLAY; fmt.fmt.win.w.left = 0; fmt.fmt.win.w.top = 0; - fmt.fmt.win.w.width = width; - fmt.fmt.win.w.height = height; + fmt.fmt.win.w.width = format->width; + fmt.fmt.win.w.height = format->height; ret = ioctl(vo->dev->fd, VIDIOC_S_FMT, &fmt); if (ret < 0) { perror("VIDIOC_S_FMT(overlay)\n"); |