linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: huzaifas@redhat.com
To: linux-media@vger.kernel.org
Cc: hdegoede@redhat.com, Huzaifa Sidhpurwala <huzaifas@redhat.com>
Subject: [PATCH] move v4l1 ioctls from kernel to libv4l1: VIDIOCSCHAN move VIDIOCSCHAN to libv4l1 Signed-off-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
Date: Thu, 27 May 2010 12:36:33 +0530	[thread overview]
Message-ID: <1274943993-28246-1-git-send-email-huzaifas@redhat.com> (raw)

From: Huzaifa Sidhpurwala <huzaifas@redhat.com>

---
 lib/libv4l1/libv4l1.c |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c
index f64025a..4a65222 100644
--- a/lib/libv4l1/libv4l1.c
+++ b/lib/libv4l1/libv4l1.c
@@ -702,7 +702,35 @@ int v4l1_ioctl(int fd, unsigned long int request, ...)
 		struct video_channel *chan = arg;
 		if ((devices[index].flags & V4L1_SUPPORTS_ENUMINPUT) &&
 				(devices[index].flags & V4L1_SUPPORTS_ENUMSTD)) {
-			result = SYS_IOCTL(fd, request, arg);
+
+			v4l2_std_id sid = 0;
+			struct v4l2_input input2;
+
+			result = SYS_IOCTL(fd, VIDIOC_ENUMINPUT, &input2);
+			if (result < 0)
+				break;
+
+			switch (chan->norm) {
+			case VIDEO_MODE_PAL:
+				sid = V4L2_STD_PAL;
+				break;
+			case VIDEO_MODE_NTSC:
+				sid = V4L2_STD_NTSC;
+				break;
+			case VIDEO_MODE_SECAM:
+				sid = V4L2_STD_SECAM;
+				break;
+			case VIDEO_MODE_AUTO:
+				sid = V4L2_STD_ALL;
+				break;
+			}
+			
+			if (0 != sid) {
+				result = SYS_IOCTLdrv(fd, VIDIOC_S_STD, &sid);
+				if (result < 0)
+					break;
+			}
+			
 			break;
 		}
 		/* In case of no ENUMSTD support, ignore the norm member of the
-- 
1.6.6.1


                 reply	other threads:[~2010-05-27  7:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1274943993-28246-1-git-send-email-huzaifas@redhat.com \
    --to=huzaifas@redhat.com \
    --cc=hdegoede@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).