lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4f92b043.xYYL+7fcNMQk08OJ%my84@bk.ru>
Date:	Sat, 21 Apr 2012 17:04:03 +0400
From:	my84@...ru
To:	my84@...ru
Cc:	linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
	linux-media@...r.kernel.org, justinmattock@...il.com,
	dhowells@...hat.com, gregkh@...uxfoundation.org,
	mchehab@...radead.org
Subject: [PATCH] [Trivial] staging: go7007: Framesizes features


Correct framesizes

Signed-off-by Volokh Konstantin <my84@...ru>
---
 drivers/staging/media/go7007/go7007-v4l2.c |   79 +++++++++++++++++++++++++++-
 1 files changed, 77 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index 3ef4cd8..4759441 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -1065,10 +1065,85 @@ static int vidioc_enum_framesizes(struct file *filp, void *priv,
 	struct go7007 *go = ((struct go7007_file *) priv)->go;
 
 	/* Return -EINVAL, if it is a TV board */
-	if ((go->board_info->flags & GO7007_BOARD_HAS_TUNER) ||
-	    (go->board_info->sensor_flags & GO7007_SENSOR_TV))
+	if (go->board_info->flags & GO7007_BOARD_HAS_TUNER)
 		return -EINVAL;
 
+	if (go->board_info->sensor_flags & GO7007_SENSOR_TV) {
+		switch (go->standard) {
+		case GO7007_STD_NTSC:
+			switch (fsize->pixel_format) {
+			case V4L2_PIX_FMT_MJPEG:
+			case V4L2_PIX_FMT_MPEG:
+			case V4L2_PIX_FMT_H263:
+				switch (fsize->index) {
+				case 0:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 720;
+					fsize->discrete.height = 480;
+					break;
+				case 1:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 640;
+					fsize->discrete.height = 480;
+					break;
+				case 2:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 352;
+					fsize->discrete.height = 240;
+					break;
+				case 3:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 320;
+					fsize->discrete.height = 240;
+					break;
+				case 4:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 176;
+					fsize->discrete.height = 112;
+					break;
+				default:
+					return -EINVAL;
+				}
+				break;
+			default:
+				return -EINVAL;
+			}
+			break;
+		case GO7007_STD_PAL:
+			switch (fsize->pixel_format) {
+			case V4L2_PIX_FMT_MJPEG:
+			case V4L2_PIX_FMT_MPEG:
+			case V4L2_PIX_FMT_H263:
+				switch (fsize->index) {
+				case 0:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 720;
+					fsize->discrete.height = 576;
+					break;
+				case 1:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 352;
+					fsize->discrete.height = 288;
+					break;
+				case 2:
+					fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+					fsize->discrete.width = 176;
+					fsize->discrete.height = 144;
+					break;
+				default:
+					return -EINVAL;
+				}
+				break;
+			default:
+				return -EINVAL;
+			}
+			break;
+		default:
+			return -EINVAL;
+		}
+		return 0;
+	}
+
 	if (fsize->index > 0)
 		return -EINVAL;
 
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ