rpms/v4l2ucp/devel v4l2ucp-1.3-default-dev.patch, NONE, 1.1 v4l2ucp-1.3-libv4l.patch, NONE, 1.1 v4l2ucp-1.3-v4l2ctrl-nextflag.patch, NONE, 1.1 v4l2ucp.spec, 1.3, 1.4

Hans de Goede jwrdegoede at fedoraproject.org
Mon May 25 20:27:31 UTC 2009


Author: jwrdegoede

Update of /cvs/extras/rpms/v4l2ucp/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32008

Modified Files:
	v4l2ucp.spec 
Added Files:
	v4l2ucp-1.3-default-dev.patch v4l2ucp-1.3-libv4l.patch 
	v4l2ucp-1.3-v4l2ctrl-nextflag.patch 
Log Message:
* Mon May 25 2009 Hans de Goede <hdegoede at redhat.com> 1.3-2
- Add libv4l support


v4l2ucp-1.3-default-dev.patch:

--- NEW FILE v4l2ucp-1.3-default-dev.patch ---
--- v4l2ucp-1.3.orig/v4l2ucp.cpp
+++ v4l2ucp-1.3/v4l2ucp.cpp
@@ -34,7 +34,7 @@
     cout << "filename is one or more device files for the ";
     cout << "V4L2 devices to control." << endl;
     cout << "If no filenames are given, the filename specified in the" << endl;
-    cout << "environment variable V4L2UCP_DEV, or /dev/video will be used.";
+    cout << "environment variable V4L2UCP_DEV, or /dev/video0 will be used.";
     cout << endl;
     cout << "Also accepts standard Qt arguments." << endl;
 }
@@ -66,7 +66,7 @@
                 windowOpened = true;
             }
         } else {
-            w = MainWindow::openFile("/dev/video");
+            w = MainWindow::openFile("/dev/video0");
             if(w) {
                 w->show();
                 windowOpened = true;
diff -up v4l2ucp-1.3/v4l2ctrl.c~ v4l2ucp-1.3/v4l2ctrl.c
--- v4l2ucp-1.3/v4l2ctrl.c~	2009-05-25 16:22:57.000000000 +0200
+++ v4l2ucp-1.3/v4l2ctrl.c	2009-05-25 16:23:57.000000000 +0200
@@ -172,7 +172,7 @@ int main(int argc, char **argv)
 {
     int i, fd, ret;
     int load = -1;
-    const char *device = "/dev/video";
+    const char *device = "/dev/video0";
     const char *filename, *mode;
     FILE *file;
     

v4l2ucp-1.3-libv4l.patch:

--- NEW FILE v4l2ucp-1.3-libv4l.patch ---
diff -up v4l2ucp-1.3/Makefile.am~ v4l2ucp-1.3/Makefile.am
--- v4l2ucp-1.3/Makefile.am~	2009-02-22 23:13:22.000000000 +0100
+++ v4l2ucp-1.3/Makefile.am	2009-05-25 15:53:34.000000000 +0200
@@ -10,7 +10,8 @@ v4l2ctrl_SOURCES = v4l2ctrl.c
 BUILT_SOURCES = mainWindow.moc.cc v4l2controls.moc.cc
 
 AM_CXXFLAGS = $(QT_CXXFLAGS) $(LINUX_INCLUDE)
-LDADD = $(QT_LIBS)
+v4l2ucp_LDADD = $(QT_LIBS) -lv4l2
+v4l2ctrl_LDADD = -lv4l2
 MOC = $(QT_MOC)
 
 CLEANFILES = *.moc.cc
diff -up v4l2ucp-1.3/Makefile.in~ v4l2ucp-1.3/Makefile.in
--- v4l2ucp-1.3/Makefile.in~	2009-05-25 15:56:17.000000000 +0200
+++ v4l2ucp-1.3/Makefile.in	2009-05-25 16:19:34.000000000 +0200
@@ -49,14 +49,14 @@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
 am_v4l2ctrl_OBJECTS = v4l2ctrl.$(OBJEXT)
 v4l2ctrl_OBJECTS = $(am_v4l2ctrl_OBJECTS)
-v4l2ctrl_LDADD = $(LDADD)
+v4l2ctrl_LDADD = -lv4l2
 am__DEPENDENCIES_1 =
 v4l2ctrl_DEPENDENCIES = $(am__DEPENDENCIES_1)
 am__objects_1 = mainWindow.moc.$(OBJEXT) v4l2controls.moc.$(OBJEXT)
 am_v4l2ucp_OBJECTS = mainWindow.$(OBJEXT) v4l2controls.$(OBJEXT) \
 	v4l2ucp.$(OBJEXT) $(am__objects_1)
 v4l2ucp_OBJECTS = $(am_v4l2ucp_OBJECTS)
-v4l2ucp_LDADD = $(LDADD)
+v4l2ucp_LDADD = $(QT_LIBS) -lv4l2
 v4l2ucp_DEPENDENCIES = $(am__DEPENDENCIES_1)
 DEFAULT_INCLUDES = -I. at am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/depcomp
diff -up v4l2ucp-1.3/mainWindow.cpp~ v4l2ucp-1.3/mainWindow.cpp
--- v4l2ucp-1.3/mainWindow.cpp~	2009-02-22 23:12:30.000000000 +0100
+++ v4l2ucp-1.3/mainWindow.cpp	2009-05-25 15:55:23.000000000 +0200
@@ -20,6 +20,7 @@
 #include <sys/ioctl.h>
 #include <cerrno>
 #include <cstring>
+#include <libv4l2.h>
 
 #include <qscrollview.h>
 #include <qfiledialog.h>
@@ -100,7 +101,7 @@ void MainWindow::fileOpen()
 
 MainWindow *MainWindow::openFile(const char *fileName)
 {
-    int fd = open(fileName, O_RDWR, 0);
+    int fd = v4l2_open(fileName, O_RDWR, 0);
     if(fd < 0) {
         QString msg;
 	msg.sprintf("Unable to open file %s\n%s", fileName, strerror(errno));
@@ -109,7 +110,7 @@ MainWindow *MainWindow::openFile(const c
     }
     
     struct v4l2_capability cap;
-    if(ioctl(fd, VIDIOC_QUERYCAP, &cap) == -1) {
+    if(v4l2_ioctl(fd, VIDIOC_QUERYCAP, &cap) == -1) {
         QString msg;
 	msg.sprintf("%s is not a V4L2 device", fileName);
 	QMessageBox::warning(NULL, "v4l2ucp: Not a V4L2 device", msg, "OK");
@@ -160,11 +161,11 @@ MainWindow *MainWindow::openFile(const c
 #ifdef V4L2_CTRL_FLAG_NEXT_CTRL
     /* Try the extended control API first */
     ctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
-    if(0 == ioctl (fd, VIDIOC_QUERYCTRL, &ctrl)) {
+    if(0 == v4l2_ioctl (fd, VIDIOC_QUERYCTRL, &ctrl)) {
 	do {
 		mw->add_control(ctrl, fd, grid);
 		ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
-	} while(0 == ioctl (fd, VIDIOC_QUERYCTRL, &ctrl));
+	} while(0 == v4l2_ioctl (fd, VIDIOC_QUERYCTRL, &ctrl));
     } else
 #endif
     {
@@ -172,7 +173,7 @@ MainWindow *MainWindow::openFile(const c
 	/* Check all the standard controls */
 	for(int i=V4L2_CID_BASE; i<V4L2_CID_LASTP1; i++) {
             ctrl.id = i;
-            if(ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == 0) {
+            if(v4l2_ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == 0) {
         	mw->add_control(ctrl, fd, grid);
             }
 	}
@@ -180,7 +181,7 @@ MainWindow *MainWindow::openFile(const c
 	/* Check any custom controls */
 	for(int i=V4L2_CID_PRIVATE_BASE; ; i++) {
             ctrl.id = i;
-            if(ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == 0) {
+            if(v4l2_ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == 0) {
         	mw->add_control(ctrl, fd, grid);
             } else {
         	break;
@@ -195,7 +196,7 @@ MainWindow *MainWindow::openFile(const c
 MainWindow::~MainWindow()
 {
     if(fd >= 0)
-        close(fd);
+        v4l2_close(fd);
 }
 
 void MainWindow::add_control(struct v4l2_queryctrl &ctrl, int fd, QGrid *parent)
diff -up v4l2ucp-1.3/v4l2controls.cpp~ v4l2ucp-1.3/v4l2controls.cpp
--- v4l2ucp-1.3/v4l2controls.cpp~	2006-03-05 07:06:06.000000000 +0100
+++ v4l2ucp-1.3/v4l2controls.cpp	2009-05-25 15:54:41.000000000 +0200
@@ -19,6 +19,7 @@
 #include <sys/ioctl.h>
 #include <cerrno>
 #include <cstring>
+#include <libv4l2.h>
 
 #include <qpushbutton.h>
 #include <qlabel.h>
@@ -41,7 +42,7 @@ void V4L2Control::updateHardware()
     struct v4l2_control c;
     c.id = cid;
     c.value = getValue();
-    if(ioctl(fd, VIDIOC_S_CTRL, &c) == -1) {
+    if(v4l2_ioctl(fd, VIDIOC_S_CTRL, &c) == -1) {
         QString msg;
 	msg.sprintf("Unable to set %s\n%s", name, strerror(errno));
 	QMessageBox::warning(this, "Unable to set control", msg, "OK");
@@ -53,7 +54,7 @@ void V4L2Control::updateStatus()
 {
     struct v4l2_control c;
     c.id = cid;
-    if(ioctl(fd, VIDIOC_G_CTRL, &c) == -1) {
+    if(v4l2_ioctl(fd, VIDIOC_G_CTRL, &c) == -1) {
         QString msg;
 	msg.sprintf("Unable to get %s\n%s", name,
 	            strerror(errno));
@@ -64,7 +65,7 @@ void V4L2Control::updateStatus()
     }
     struct v4l2_queryctrl ctrl;
     ctrl.id = cid;
-    if(ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == -1) {
+    if(v4l2_ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == -1) {
         QString msg;
 	msg.sprintf("Unable to get the status of %s\n%s", name,
 	            strerror(errno));
@@ -199,7 +200,7 @@ V4L2MenuControl::V4L2MenuControl
         struct v4l2_querymenu qm;
         qm.id = ctrl.id;
         qm.index = i;
-        if(ioctl(fd, VIDIOC_QUERYMENU, &qm) == 0) {
+        if(v4l2_ioctl(fd, VIDIOC_QUERYMENU, &qm) == 0) {
             cb->insertItem((const char *)qm.name, i);
         } else {
             QString msg;
@@ -246,7 +247,7 @@ void V4L2ButtonControl::updateStatus()
 {
     struct v4l2_queryctrl ctrl;
     ctrl.id = cid;
-    if(ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == -1) {
+    if(v4l2_ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == -1) {
         QString msg;
 	msg.sprintf("Unable to get the status of %s\n%s", name,
 	            strerror(errno));
diff -up v4l2ucp-1.3/v4l2ctrl.c~ v4l2ucp-1.3/v4l2ctrl.c
--- v4l2ucp-1.3/v4l2ctrl.c~	2009-02-22 23:13:22.000000000 +0100
+++ v4l2ucp-1.3/v4l2ctrl.c	2009-05-25 16:22:57.000000000 +0200
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <linux/types.h>
 #include <linux/videodev.h>
+#include <libv4l2.h>
 
 #define FORMATW "%u:%31s:%d\n"
 #define FORMATR "%u:%31c:%d\n"
@@ -51,7 +52,7 @@ int do_save(int fd, FILE *file)
 #ifdef V4L2_CTRL_FLAG_NEXT_CTRL
     /* Try the extended control API first */
     ctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
-    if(0 == ioctl (fd, VIDIOC_QUERYCTRL, &ctrl)) {
+    if(0 == v4l2_ioctl (fd, VIDIOC_QUERYCTRL, &ctrl)) {
 	do {
 	    c.id = ctrl.id;
             ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
@@ -63,17 +64,17 @@ int do_save(int fd, FILE *file)
                ctrl.type != V4L2_CTRL_TYPE_MENU) {
                 continue;
             }
-            if(ioctl(fd, VIDIOC_G_CTRL, &c) == 0) {
+            if(v4l2_ioctl(fd, VIDIOC_G_CTRL, &c) == 0) {
                 fprintf(file, FORMATW, i, ctrl.name, c.value);
             }
-	} while(0 == ioctl (fd, VIDIOC_QUERYCTRL, &ctrl));
+	} while(0 == v4l2_ioctl (fd, VIDIOC_QUERYCTRL, &ctrl));
     } else
 #endif
     {
         /* Check all the standard controls */
         for(i=V4L2_CID_BASE; i<V4L2_CID_LASTP1; i++) {
             ctrl.id = i;
-            if(ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == 0) {
+            if(v4l2_ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == 0) {
                 if(ctrl.flags & V4L2_CTRL_FLAG_DISABLED) {
                     continue;
                 }
@@ -83,7 +84,7 @@ int do_save(int fd, FILE *file)
                     continue;
                 }
                 c.id = i;
-                if(ioctl(fd, VIDIOC_G_CTRL, &c) == 0) {
+                if(v4l2_ioctl(fd, VIDIOC_G_CTRL, &c) == 0) {
                     fprintf(file, FORMATW, i, ctrl.name, c.value);
                 }
             }
@@ -92,7 +93,7 @@ int do_save(int fd, FILE *file)
         /* Check any custom controls */
         for(i=V4L2_CID_PRIVATE_BASE; ; i++) {
             ctrl.id = i;
-            if(ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == 0) {
+            if(v4l2_ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == 0) {
                 if(ctrl.flags & V4L2_CTRL_FLAG_DISABLED) {
                     continue;
                 }
@@ -102,7 +103,7 @@ int do_save(int fd, FILE *file)
                     continue;
                 }
                 c.id = i;
-                if(ioctl(fd, VIDIOC_G_CTRL, &c) == 0) {
+                if(v4l2_ioctl(fd, VIDIOC_G_CTRL, &c) == 0) {
                     fprintf(file, FORMATW, i, ctrl.name, c.value);
                 }
             } else {
@@ -129,7 +130,7 @@ int do_load(int fd, FILE *file)
             n++;
         }
         ctrl.id = id;
-        if(ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == 0) {
+        if(v4l2_ioctl(fd, VIDIOC_QUERYCTRL, &ctrl) == 0) {
             if(strcmp((char *)ctrl.name, n)) {
                 fprintf(stderr, "Control name mismatch\n");
                 return EXIT_FAILURE;
@@ -148,7 +149,7 @@ int do_load(int fd, FILE *file)
             
             c.id = id;
             c.value = value;
-            if(ioctl(fd, VIDIOC_S_CTRL, &c) != 0) {
+            if(v4l2_ioctl(fd, VIDIOC_S_CTRL, &c) != 0) {
                 fprintf(stderr, "Failed to set control \"%s\": %s\n",
                         ctrl.name, strerror(errno));
                 continue;
@@ -199,7 +200,7 @@ int main(int argc, char **argv)
         return EXIT_FAILURE;
     }
     
-    fd = open(device, O_RDWR, 0);
+    fd = v4l2_open(device, O_RDWR, 0);
     if(fd < 0) {
         fprintf(stderr, "Unable to open %s: %s\n", device, strerror(errno));
         return EXIT_FAILURE;
@@ -225,7 +226,7 @@ int main(int argc, char **argv)
     }
     
     fclose(file);
-    close(fd);
+    v4l2_close(fd);
     
     return ret;
 }

v4l2ucp-1.3-v4l2ctrl-nextflag.patch:

--- NEW FILE v4l2ucp-1.3-v4l2ctrl-nextflag.patch ---
diff -up v4l2ucp-1.3/v4l2ctrl.c~ v4l2ucp-1.3/v4l2ctrl.c
--- v4l2ucp-1.3/v4l2ctrl.c~	2009-05-25 16:24:38.000000000 +0200
+++ v4l2ucp-1.3/v4l2ctrl.c	2009-05-25 16:30:57.000000000 +0200
@@ -65,7 +65,7 @@ int do_save(int fd, FILE *file)
                 continue;
             }
             if(v4l2_ioctl(fd, VIDIOC_G_CTRL, &c) == 0) {
-                fprintf(file, FORMATW, i, ctrl.name, c.value);
+                fprintf(file, FORMATW, c.id, ctrl.name, c.value);
             }
 	} while(0 == v4l2_ioctl (fd, VIDIOC_QUERYCTRL, &ctrl));
     } else


Index: v4l2ucp.spec
===================================================================
RCS file: /cvs/extras/rpms/v4l2ucp/devel/v4l2ucp.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- v4l2ucp.spec	25 May 2009 12:43:18 -0000	1.3
+++ v4l2ucp.spec	25 May 2009 20:27:01 -0000	1.4
@@ -1,6 +1,6 @@
 Name:           v4l2ucp
 Version:        1.3
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Video4linux universal control panel
 Group:          Applications/Multimedia
 License:        GPLv2+
@@ -8,6 +8,8 @@ URL:            http://v4l2ucp.sourcefor
 Source0:        http://downloads.sourceforge.net/v4l2ucp/v4l2ucp-%{version}.tar.gz
 Source1:        %{name}.desktop
 Patch0:         v4l2ucp-1.3-default-dev.patch
+Patch1:         v4l2ucp-1.3-libv4l.patch
+Patch2:         v4l2ucp-1.3-v4l2ctrl-nextflag.patch
 # This image was taken from camorama, which is also licensed GPLv2+
 Source2:        %{name}.png
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -26,6 +28,8 @@ controls to their default state.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 
 %build
@@ -74,6 +78,9 @@ fi
 
 
 %changelog
+* Mon May 25 2009 Hans de Goede <hdegoede at redhat.com> 1.3-2
+- Add libv4l support
+
 * Mon May 25 2009 Hans de Goede <hdegoede at redhat.com> 1.3-1
 - New upstream release 1.3
 




More information about the fedora-extras-commits mailing list