diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2013-09-09 15:20:16 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-12-11 13:02:02 +0400 |
commit | cc3c2ac29152b07ce58c8c7b34a8a8e8f321335a (patch) | |
tree | be210abaefc0d3f6bd88be30d69c53f4ae9001ec /drivers/staging/media/omap4iss/iss_video.c | |
parent | a1d4eab06d6777c8bbd46f83e8a495722bb37a84 (diff) | |
download | linux-cc3c2ac29152b07ce58c8c7b34a8a8e8f321335a.tar.xz |
[media] v4l: omap4iss: Make __iss_video_get_format() return a v4l2_mbus_framefmt
The function will be used by a caller that needs the media bus format
instead of the pixel format currently returned. Move the media bus
format to pixel format conversion to the existing caller.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/staging/media/omap4iss/iss_video.c')
-rw-r--r-- | drivers/staging/media/omap4iss/iss_video.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c index b4ffde87a415..5dbd774aaa0a 100644 --- a/drivers/staging/media/omap4iss/iss_video.c +++ b/drivers/staging/media/omap4iss/iss_video.c @@ -232,7 +232,8 @@ iss_video_far_end(struct iss_video *video) } static int -__iss_video_get_format(struct iss_video *video, struct v4l2_format *format) +__iss_video_get_format(struct iss_video *video, + struct v4l2_mbus_framefmt *format) { struct v4l2_subdev_format fmt; struct v4l2_subdev *subdev; @@ -243,6 +244,7 @@ __iss_video_get_format(struct iss_video *video, struct v4l2_format *format) if (subdev == NULL) return -EINVAL; + memset(&fmt, 0, sizeof(fmt)); fmt.pad = pad; fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; @@ -253,26 +255,29 @@ __iss_video_get_format(struct iss_video *video, struct v4l2_format *format) if (ret) return ret; - format->type = video->type; - return iss_video_mbus_to_pix(video, &fmt.format, &format->fmt.pix); + *format = fmt.format; + return 0; } static int iss_video_check_format(struct iss_video *video, struct iss_video_fh *vfh) { - struct v4l2_format format; + struct v4l2_mbus_framefmt format; + struct v4l2_pix_format pixfmt; int ret; - memcpy(&format, &vfh->format, sizeof(format)); ret = __iss_video_get_format(video, &format); if (ret < 0) return ret; - if (vfh->format.fmt.pix.pixelformat != format.fmt.pix.pixelformat || - vfh->format.fmt.pix.height != format.fmt.pix.height || - vfh->format.fmt.pix.width != format.fmt.pix.width || - vfh->format.fmt.pix.bytesperline != format.fmt.pix.bytesperline || - vfh->format.fmt.pix.sizeimage != format.fmt.pix.sizeimage) + pixfmt.bytesperline = 0; + ret = iss_video_mbus_to_pix(video, &format, &pixfmt); + + if (vfh->format.fmt.pix.pixelformat != pixfmt.pixelformat || + vfh->format.fmt.pix.height != pixfmt.height || + vfh->format.fmt.pix.width != pixfmt.width || + vfh->format.fmt.pix.bytesperline != pixfmt.bytesperline || + vfh->format.fmt.pix.sizeimage != pixfmt.sizeimage) return -EINVAL; return ret; |