All of lore.kernel.org
 help / color / mirror / Atom feed
From: Volokh Konstantin <volokh84@gmail.com>
To: hverkuil@xs4all.nl, linux-media@vger.kernel.org
Cc: Volokh Konstantin <volokh84@gmail.com>
Subject: [PATCH 1/7] hverkuil/go7007: staging: media: go7007: Add Framesizes
Date: Sun, 10 Mar 2013 18:04:40 +0400	[thread overview]
Message-ID: <1362924286-23995-1-git-send-email-volokh84@gmail.com> (raw)

Signed-off-by: Volokh Konstantin <volokh84@gmail.com>
---
 drivers/staging/media/go7007/go7007-v4l2.c |   76 ++++++++++++++++++++++++++++
 1 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index 66307ea..4ec9b84 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -612,6 +612,82 @@ static int vidioc_enum_framesizes(struct file *filp, void *priv,
 {
 	struct go7007 *go = video_drvdata(filp);
 
+	if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) {
+		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


             reply	other threads:[~2013-03-10 14:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-10 14:04 Volokh Konstantin [this message]
2013-03-10 14:04 ` [PATCH 2/7] hverkuil/go7007: staging: media: go7007: Add Frameintervals Volokh Konstantin
2013-03-10 14:04 ` [PATCH 3/7] hverkuil/go7007: staging: media: go7007: Restore b_frame control Volokh Konstantin
2013-03-10 14:04 ` [PATCH 4/7] hverkuil/go7007: staging: media: go7007: Add Modet controls Volokh Konstantin
2013-03-10 14:04 ` [PATCH 5/7] hverkuil/go7007: staging: media: go7007: Functionality for modet controls Volokh Konstantin
2013-03-10 14:04 ` [PATCH 6/7] hverkuil/go7007: staging: media: go7007: Cleanup Unused modet code Volokh Konstantin
2013-03-10 14:04 ` [PATCH 7/7] hverkuil/go7007: staging: media: go7007: Clean trivial Volokh Konstantin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362924286-23995-1-git-send-email-volokh84@gmail.com \
    --to=volokh84@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.