All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libv4l1: move VIDIOCGFREQ and VIDIOCSFREQ to libv4l1
@ 2010-06-04  7:23 huzaifas
  2010-06-07  7:41 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: huzaifas @ 2010-06-04  7:23 UTC (permalink / raw)
  To: linux-media; +Cc: hdegoede, Huzaifa Sidhpurwala

From: Huzaifa Sidhpurwala <huzaifas@redhat.com>

move VIDIOCGFREQ and VIDIOCSFREQ to libv4l1

Signed-of-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
---
 lib/libv4l1/libv4l1.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c
index 081ed0a..579f13b 100644
--- a/lib/libv4l1/libv4l1.c
+++ b/lib/libv4l1/libv4l1.c
@@ -939,6 +939,34 @@ int v4l1_ioctl(int fd, unsigned long int request, ...)
 		break;
 	}
 
+	case VIDIOCSFREQ: {
+		unsigned long *freq = arg;
+		struct v4l2_frequency freq2 = { 0, };
+
+		result = v4l2_ioctl(fd, VIDIOC_G_FREQUENCY, &freq2);
+		if (result < 0)
+			break;
+
+		freq2.frequency = *freq;
+
+		result = v4l2_ioctl(fd, VIDIOC_S_FREQUENCY, &freq2);
+
+		break;
+	}
+
+	case VIDIOCGFREQ: {
+		unsigned long *freq = arg;
+		struct v4l2_frequency freq2 = { 0, };
+
+		freq2.tuner = 0;
+		result = v4l2_ioctl(fd, VIDIOC_G_FREQUENCY, &freq2);
+		if (result < 0)
+			break;
+		if (0 == result)
+			*freq = freq2.frequency;
+
+		break;
+	}
 	default:
 		/* Pass through libv4l2 for applications which are using v4l2 through
 		   libv4l1 (this can happen with the v4l1compat.so wrapper preloaded */
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-07  7:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-04  7:23 [PATCH] libv4l1: move VIDIOCGFREQ and VIDIOCSFREQ to libv4l1 huzaifas
2010-06-07  7:41 ` Hans de Goede

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.