aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/cx231xx/cx231xx-video.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-11-30 10:03:30 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-12-18 13:29:49 -0200
commite25cb2001307c1c4b7d79da0fcd2a7598cf8e647 (patch)
tree4543006a8f63c33ba171a66999b59b0ccdc1cb8f /drivers/media/usb/cx231xx/cx231xx-video.c
parent[media] cx23885: fix format/crop handling (diff)
downloadlinux-dev-e25cb2001307c1c4b7d79da0fcd2a7598cf8e647.tar.xz
linux-dev-e25cb2001307c1c4b7d79da0fcd2a7598cf8e647.zip
[media] cx231xx: fix NTSC cropcap, add missing cropcap for 417
The pixelaspect ratio was set incorrectly for 60Hz formats. And since cropcap wasn't implemented at all for the -417 (compressed video) the pixelaspect was unknown for compressed video. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/cx231xx/cx231xx-video.c')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-video.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index 246fb2bff114..a70850fe6235 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -1444,6 +1444,7 @@ static int vidioc_cropcap(struct file *file, void *priv,
{
struct cx231xx_fh *fh = priv;
struct cx231xx *dev = fh->dev;
+ bool is_50hz = dev->norm & V4L2_STD_625_50;
if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
@@ -1453,8 +1454,8 @@ static int vidioc_cropcap(struct file *file, void *priv,
cc->bounds.width = dev->width;
cc->bounds.height = dev->height;
cc->defrect = cc->bounds;
- cc->pixelaspect.numerator = 54; /* 4:3 FIXME: remove magic numbers */
- cc->pixelaspect.denominator = 59;
+ cc->pixelaspect.numerator = is_50hz ? 54 : 11;
+ cc->pixelaspect.denominator = is_50hz ? 59 : 10;
return 0;
}