rpms/camE/devel camE-1.9-libv4l1.patch, NONE, 1.1 camE.spec, 1.18, 1.19

Hans de Goede jwrdegoede at fedoraproject.org
Sat Aug 30 19:33:08 UTC 2008


Author: jwrdegoede

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

Modified Files:
	camE.spec 
Added Files:
	camE-1.9-libv4l1.patch 
Log Message:
* Sat Aug 30 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 1.9-13
- Add patch to use libv4l to support webcams which use custom video formats


camE-1.9-libv4l1.patch:

--- NEW FILE camE-1.9-libv4l1.patch ---
diff -up camE-1.9/Makefile~ camE-1.9/Makefile
--- camE-1.9/Makefile~	2008-08-07 19:50:38.000000000 +0200
+++ camE-1.9/Makefile	2008-08-07 19:50:38.000000000 +0200
@@ -24,7 +24,7 @@ OBJS=webcam.o parseconfig.o
 all build: $(PROGS)
 
 camE: $(OBJS)
-	$(CC) $(CFLAGS) -o $@ $(OBJS) `giblib-config --libs` -lcurl
+	$(CC) $(CFLAGS) -o $@ $(OBJS) `giblib-config --libs` -lcurl -lv4l1
 
 install: all
 	$(INSTALL_DIR) $(bindir)
diff -up camE-1.9/webcam.c~ camE-1.9/webcam.c
--- camE-1.9/webcam.c~	2008-08-07 19:50:17.000000000 +0200
+++ camE-1.9/webcam.c	2008-08-07 19:50:17.000000000 +0200
@@ -33,6 +33,8 @@
 
 #include <net/if.h>
 
+#include <libv4l1.h> 
+
 #include "parseconfig.h"
 #include "pwc-ioctl.h"
 
@@ -207,12 +209,12 @@ struct timeval timeval_float( float f )
 void
 close_device()
 {
-  if (munmap(grab_data, grab_size) != 0) {
+  if (v4l1_munmap(grab_data, grab_size) != 0) {
     perror("munmap()");
     exit(1);
   }
   grab_data = NULL;
-  if (close(grab_fd))
+  if (v4l1_close(grab_fd))
     perror("close(grab_fd) ");
   grab_fd = -1;
 }
@@ -224,9 +226,9 @@ try_palette(int fd,
 {
   cam_pic.palette = pal;
   cam_pic.depth = depth;
-  if (ioctl(fd, VIDIOCSPICT, &cam_pic) < 0)
+  if (v4l1_ioctl(fd, VIDIOCSPICT, &cam_pic) < 0)
     return 0;
-  if (ioctl(fd, VIDIOCGPICT, &cam_pic) < 0)
+  if (v4l1_ioctl(fd, VIDIOCGPICT, &cam_pic) < 0)
     return 0;
   if (cam_pic.palette == pal)
     return 1;
@@ -263,23 +265,23 @@ grab_init()
   struct video_mbuf vid_mbuf;
   int type;
 
-  if ((grab_fd = open(grab_device, O_RDWR)) == -1) {
+  if ((grab_fd = v4l1_open(grab_device, O_RDWR)) == -1) {
     fprintf(stderr, "open %s: %s\n", grab_device, strerror(errno));
     exit(1);
   }
-  if (ioctl(grab_fd, VIDIOCGCAP, &grab_cap) == -1) {
+  if (v4l1_ioctl(grab_fd, VIDIOCGCAP, &grab_cap) == -1) {
     fprintf(stderr, "%s: no v4l device\n", grab_device);
     exit(1);
   }
 
-  if (ioctl(grab_fd, VIDIOCGPICT, &cam_pic) < 0)
+  if (v4l1_ioctl(grab_fd, VIDIOCGPICT, &cam_pic) < 0)
     perror("getting pic info");
   cam_pic.contrast = 65535 * ((float) cam_contrast / 100);
   cam_pic.brightness = 65535 * ((float) cam_brightness / 100);
   cam_pic.hue = 65535 * ((float) cam_hue / 100);
   cam_pic.colour = 65535 * ((float) cam_colour / 100);
   cam_pic.whiteness = 65535 * ((float) cam_whiteness / 100);
-  if (ioctl(grab_fd, VIDIOCSPICT, &cam_pic) < 0)
+  if (v4l1_ioctl(grab_fd, VIDIOCSPICT, &cam_pic) < 0)
     perror("setting cam pic");
   device_palette = find_palette(grab_fd, &grab_buf);
 
@@ -288,7 +290,7 @@ grab_init()
   grab_buf.width = grab_width;
   grab_buf.height = grab_height;
 
-  ioctl(grab_fd, VIDIOCGMBUF, &vid_mbuf);
+  v4l1_ioctl(grab_fd, VIDIOCGMBUF, &vid_mbuf);
   camlog("%s detected\n", grab_cap.name);
 
   /* special philips features */
@@ -301,7 +303,7 @@ grab_init()
     /* philips cam detected, maybe enable special features */
     camlog("enabling pwc-specific features\n");
 
-    ioctl(grab_fd, VIDIOCGWIN, &vwin);
+    v4l1_ioctl(grab_fd, VIDIOCGWIN, &vwin);
     if (vwin.flags & PWC_FPS_MASK) {
       /* Set new framerate */
       vwin.flags &= ~PWC_FPS_FRMASK;
@@ -311,12 +313,12 @@ grab_init()
     /* Turning off snapshot mode */
     vwin.flags &= ~(PWC_FPS_SNAPSHOT);
 
-    if (ioctl(grab_fd, VIDIOCSWIN, &vwin) < 0)
+    if (v4l1_ioctl(grab_fd, VIDIOCSWIN, &vwin) < 0)
       perror("trying to set extra pwc flags");
 
-    if (ioctl(grab_fd, VIDIOCPWCSAGC, &gain) < 0)
+    if (v4l1_ioctl(grab_fd, VIDIOCPWCSAGC, &gain) < 0)
       perror("trying to set gain");
-    if (ioctl(grab_fd, VIDIOCPWCSSHUTTER, &shutter) < 0)
+    if (v4l1_ioctl(grab_fd, VIDIOCPWCSSHUTTER, &shutter) < 0)
       perror("trying to set shutter");
 
     wb.mode = PWC_WB_AUTO;
@@ -338,19 +340,19 @@ grab_init()
       camlog("unknown pwc white balance mode '%s' ignored\n", pwc_wb_mode);
     }
 
-    if (ioctl(grab_fd, VIDIOCPWCSAWB, &wb) < 0)
+    if (v4l1_ioctl(grab_fd, VIDIOCPWCSAWB, &wb) < 0)
       perror("trying to set pwc white balance mode");
   }
 
   /* set image source and TV norm */
   grab_chan.channel = grab_input;
-  if (ioctl(grab_fd, VIDIOCGCHAN, &grab_chan) == -1) {
+  if (v4l1_ioctl(grab_fd, VIDIOCGCHAN, &grab_chan) == -1) {
     perror("ioctl VIDIOCGCHAN");
     exit(1);
   }
   grab_chan.channel = grab_input;
   grab_chan.norm = grab_norm;
-  if (ioctl(grab_fd, VIDIOCSCHAN, &grab_chan) == -1) {
+  if (v4l1_ioctl(grab_fd, VIDIOCSCHAN, &grab_chan) == -1) {
     perror("ioctl VIDIOCSCHAN");
     exit(1);
   }
@@ -358,7 +360,7 @@ grab_init()
   /*   grab_size = grab_buf.width * grab_buf.height * 3; */
   grab_size = vid_mbuf.size;
   grab_data =
-    mmap(0, grab_size, PROT_READ | PROT_WRITE, MAP_SHARED, grab_fd, 0);
+    v4l1_mmap(0, grab_size, PROT_READ | PROT_WRITE, MAP_SHARED, grab_fd, 0);
   if ((grab_data == NULL) || (MAP_FAILED == grab_data)) {
     fprintf(stderr,
             "couldn't mmap vidcam. your card doesn't support that?\n");
@@ -558,11 +560,11 @@ grab_one(int *width,
     j++;
 
   while (j--) {
-    if (ioctl(grab_fd, VIDIOCMCAPTURE, &grab_buf) == -1) {
+    if (v4l1_ioctl(grab_fd, VIDIOCMCAPTURE, &grab_buf) == -1) {
       perror("ioctl VIDIOCMCAPTURE");
       return NULL;
     }
-    if (ioctl(grab_fd, VIDIOCSYNC, &i) == -1) {
+    if (v4l1_ioctl(grab_fd, VIDIOCSYNC, &i) == -1) {
       perror("ioctl VIDIOCSYNC");
       return NULL;
     }


Index: camE.spec
===================================================================
RCS file: /cvs/extras/rpms/camE/devel/camE.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- camE.spec	20 Feb 2008 04:00:56 -0000	1.18
+++ camE.spec	30 Aug 2008 19:32:37 -0000	1.19
@@ -1,17 +1,18 @@
 Summary: Rewrite of the xawtv webcam app, which adds imlib2 support
 Name: camE
 Version: 1.9
-Release: 12
+Release: 13
 # COPYING is GPLv2 but no source files contain "or any later version" except
 # pwc-ioctl.h which was taken from the pwc kernel module.
-License: GPLv2 and GPLv2+
+License: GPLv2
 Group: System Environment/Daemons
 URL: http://linuxbrit.co.uk/camE/
 Source: http://linuxbrit.co.uk/downloads/camE-%{version}.tar.gz
 Patch0: camE-1.9-cflags.patch
 Patch1: camE-1.9-curlopt.patch
+Patch2: camE-1.9-libv4l1.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires: giblib-devel, curl-devel, zlib-devel
+BuildRequires: giblib-devel, curl-devel, zlib-devel, libv4l-devel
 
 %description
 camE is a rewrite of the xawtv webcam app, which adds imlib2 support and
@@ -22,6 +23,7 @@
 %setup -q
 %patch0 -p1 -b .cflags
 %patch1 -p1 -b .curlopt
+%patch2 -p1
 
 
 %build
@@ -46,6 +48,9 @@
 
 
 %changelog
+* Sat Aug 30 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 1.9-13
+- Add patch to use libv4l to support webcams which use custom video formats
+
 * Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 1.9-12
 - Autorebuild for GCC 4.3
 




More information about the fedora-extras-commits mailing list