This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-utils.git tree:

Subject: libv4l1: move VIDIOCGTUNER and VIDIOCSTUNER to libv4l1
Author:  Huzaifa Sidhpurwala <[email protected]>
Date:    Fri Jun 4 12:19:40 2010 +0530

move VIDIOCGTUNER and VIDIOCSTUNER to libv4l1

Signed-of-by: Huzaifa Sidhpurwala <[email protected]>

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

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=a62f92c6e08125b137e7f1ac55c158475b285529

diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c
index 75b823c..081ed0a 100644
--- a/lib/libv4l1/libv4l1.c
+++ b/lib/libv4l1/libv4l1.c
@@ -881,6 +881,64 @@ int v4l1_ioctl(int fd, unsigned long int request, ...)
                break;
        }
 
+       case VIDIOCSTUNER: {
+               struct video_tuner *tun = arg;
+               struct v4l2_tuner t = { 0, };
+
+               t.index = tun->tuner;
+               result = v4l2_ioctl(fd, VIDIOC_S_TUNER, &t);
+
+               break;
+       }
+
+       case VIDIOCGTUNER: {
+               int i;
+               struct video_tuner *tun = arg;
+               struct v4l2_tuner tun2 = { 0, };
+               struct v4l2_standard std2 = { 0, };
+               v4l2_std_id sid;
+
+               result = v4l2_ioctl(fd, VIDIOC_G_TUNER, &tun2);
+               if (result < 0)
+                       break;
+
+               memcpy(tun->name, tun2.name,
+                       min(sizeof(tun->name), sizeof(tun2.name)));
+               tun->name[sizeof(tun->name) - 1] = 0;
+               tun->rangelow = tun2.rangelow;
+               tun->rangehigh = tun2.rangehigh;
+               tun->flags = 0;
+               tun->mode = VIDEO_MODE_AUTO;
+
+               for (i = 0; i < 64; i++) {
+                       std2.index = i;
+                       if (0 != v4l2_ioctl(fd, VIDIOC_ENUMSTD, &std2))
+                               break;
+                       if (std2.id & V4L2_STD_PAL)
+                               tun->flags |= VIDEO_TUNER_PAL;
+                       if (std2.id & V4L2_STD_NTSC)
+                               tun->flags |= VIDEO_TUNER_NTSC;
+                       if (std2.id & V4L2_STD_SECAM)
+                               tun->flags |= VIDEO_TUNER_SECAM;
+               }
+
+               if (v4l2_ioctl(fd, VIDIOC_G_STD, &sid) == 0) {
+                       if (sid & V4L2_STD_PAL)
+                               tun->mode = VIDEO_MODE_PAL;
+                       if (sid & V4L2_STD_NTSC)
+                               tun->mode = VIDEO_MODE_NTSC;
+                       if (sid & V4L2_STD_SECAM)
+                               tun->mode = VIDEO_MODE_SECAM;
+               }
+               if (tun2.capability & V4L2_TUNER_CAP_LOW)
+                       tun->flags |= VIDEO_TUNER_LOW;
+               if (tun2.rxsubchans & V4L2_TUNER_SUB_STEREO)
+                       tun->flags |= VIDEO_TUNER_STEREO_ON;
+               tun->signal = tun2.signal;
+
+               break;
+       }
+
        default:
                /* Pass through libv4l2 for applications which are using v4l2 
through
                   libv4l1 (this can happen with the v4l1compat.so wrapper 
preloaded */

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to