Port to libv4l using patch from Fedora.
authorSamuli Suominen <ssuominen@gentoo.org>
Thu, 8 Apr 2010 16:29:48 +0000 (16:29 +0000)
committerSamuli Suominen <ssuominen@gentoo.org>
Thu, 8 Apr 2010 16:29:48 +0000 (16:29 +0000)
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64

media-video/camorama/ChangeLog
media-video/camorama/Manifest
media-video/camorama/camorama-0.19-r2.ebuild [new file with mode: 0644]
media-video/camorama/files/camorama-0.19-fixes.patch [new file with mode: 0644]
media-video/camorama/files/camorama-0.19-libv4l.patch [new file with mode: 0644]

index b18cf5492efd1226edf61acdc9683527421bdabf..0bdb735dd0ac1ca71b9ded84a7af6e25c6d04126 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for media-video/camorama
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/camorama/ChangeLog,v 1.19 2009/05/14 20:06:08 maekke Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/camorama/ChangeLog,v 1.20 2010/04/08 16:29:48 ssuominen Exp $
+
+*camorama-0.19-r2 (08 Apr 2010)
+
+  08 Apr 2010; Samuli Suominen <ssuominen@gentoo.org>
+  +camorama-0.19-r2.ebuild, +files/camorama-0.19-fixes.patch,
+  +files/camorama-0.19-libv4l.patch:
+  Port to libv4l using patch from Fedora.
 
   14 May 2009; Markus Meier <maekke@gentoo.org> camorama-0.19-r1.ebuild:
   amd64/x86 stable, bug #269465
index 2cd99ad01a98829c095fe33dcdcd6a35b5e2668a..a705e03744ac4c093dd3e4c556a31d43856b95da 100644 (file)
@@ -1,5 +1,8 @@
+AUX camorama-0.19-fixes.patch 3930 RMD160 306b7cb8c413fea5fac55d7e8c264ca81b8b7141 SHA1 b2ef5b11c6b7e9e183b20c19841937212f5775ed SHA256 ac9fa437d928e77b299e8a2b24b28ce5b0d91a619a9bc2bbfebdd32c7edf3839
 AUX camorama-0.19-gconf.patch 1541 RMD160 51f36bfbd32b8830ac0b775112fec439f95a9861 SHA1 de4123c27f47f8c3cc1899514fa52782cccec84e SHA256 4ac3b70bf976ce8b03b71a4ef3d7984a8a9da7058b7a3f189eb7149bf2f12185
+AUX camorama-0.19-libv4l.patch 7007 RMD160 6f8f833ed87ccb7df6f43b8c007222a1f11748ed SHA1 072138ecbaacb4c3f9f23d0d331872396a3b5629 SHA256 921c4428edcac808e3d5d8b383cf8b9878026c0aecd7594a5efc4563179edba3
 DIST camorama-0.19.tar.bz2 277169 RMD160 c8a491dd2c75b2e4b98b115a628af0008f5c4804 SHA1 ce04cd2d4abe265b19a365a515f225111dcfb969 SHA256 948c24f96c77f550881102c2c6ca818ba00ffb7a48216ae21ae75eb55d351970
 EBUILD camorama-0.19-r1.ebuild 838 RMD160 def3c0a7b34a99416cc362a8d56cface09c8e18d SHA1 ea70332c90b19b8716022b8d5664d22b011bd849 SHA256 99ceab80805b46711f0fcd27ce1a350457ef7429ae4fe3352d3c3446e8091cd0
-MISC ChangeLog 2657 RMD160 c01920793a8a6cc7a22c9e03b65d87a596c26391 SHA1 b024e244117805d6771e94cea31bc2e8868a4c44 SHA256 3a80da6bfe970484cff4391e42b0f0e38d386fbbab4241af3f49269d0149bc85
+EBUILD camorama-0.19-r2.ebuild 899 RMD160 74968ce6bed9c7323889032dc3eadd001be66fe0 SHA1 a86319626d84c04c14aec76f23dbd846d749ebb4 SHA256 e0710991df768f280ca2535c4bd168882011a3d687b0083e59a0eea73f5ca97c
+MISC ChangeLog 2889 RMD160 e7ef22164f85af717f3b953f234f057d8a97b5b8 SHA1 a81688525f59f4694888c7fef090dab936f2aedd SHA256 92b149ec9d8419ecf7b622b7cbaa46673f9fef0e6ed1721248dc40488f3176cc
 MISC metadata.xml 224 RMD160 a894a47c3ba494f6e918fe6ebc70da6877385457 SHA1 d53ccf04d9b49b1152b19604732fa1c842a70cb6 SHA256 888efa552a0159d0de6ea80ae3d38ab453c12fcc62a0ede08e26ddc35fc1ed2d
diff --git a/media-video/camorama/camorama-0.19-r2.ebuild b/media-video/camorama/camorama-0.19-r2.ebuild
new file mode 100644 (file)
index 0000000..3ee64e2
--- /dev/null
@@ -0,0 +1,39 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/camorama/camorama-0.19-r2.ebuild,v 1.1 2010/04/08 16:29:48 ssuominen Exp $
+
+EAPI=2
+inherit eutils gnome2
+
+DESCRIPTION="a webcam application featuring various image filters."
+HOMEPAGE="http://camorama.fixedgear.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND=">=x11-libs/gtk+-2.10:2
+       >=gnome-base/libgnomeui-2
+       >=gnome-base/libgnome-2
+       >=gnome-base/gconf-2
+       >=gnome-base/libglade-2
+       media-libs/libv4l"
+DEPEND="${RDEPEND}
+       sys-devel/gettext
+       dev-util/pkgconfig
+       dev-util/intltool"
+
+SCROLLKEEPER_UPDATE="0"
+
+pkg_setup() {
+       G2CONF="${G2CONF} --disable-schemas-install"
+}
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-gconf.patch \
+               "${FILESDIR}"/${P}-fixes.patch \
+               "${FILESDIR}"/${P}-libv4l.patch
+
+       gnome2_src_prepare
+}
diff --git a/media-video/camorama/files/camorama-0.19-fixes.patch b/media-video/camorama/files/camorama-0.19-fixes.patch
new file mode 100644 (file)
index 0000000..949c19d
--- /dev/null
@@ -0,0 +1,107 @@
+http://cvs.fedoraproject.org/viewvc/rpms/camorama/devel/
+
+--- camorama-0.19/src/callbacks.c      2007-09-16 15:36:55.000000000 +0200
++++ camorama-0.19.new/src/callbacks.c  2008-06-29 22:22:44.000000000 +0200
+@@ -387,9 +387,6 @@
+         }
+     }
+ 
+-    cam->pixmap = gdk_pixmap_new (NULL, cam->x, cam->y, cam->desk_depth);
+-    gtk_widget_set_size_request (glade_xml_get_widget (cam->xml, "da"),
+-                                 cam->x, cam->y);
+ 
+     /*
+      * if(cam->read == FALSE) {
+@@ -441,6 +438,11 @@
+      * * } 
+      */
+     get_win_info (cam);
++
++    cam->pixmap = gdk_pixmap_new (NULL, cam->x, cam->y, cam->desk_depth);
++    gtk_widget_set_size_request (glade_xml_get_widget (cam->xml, "da"),
++                                 cam->x, cam->y);
++
+     frame = 0;
+     gtk_window_resize (GTK_WINDOW
+                        (glade_xml_get_widget (cam->xml, "main_window")), 320,
+@@ -520,8 +522,14 @@
+     gtk_widget_show (about);
+ }
+ 
++void
++camorama_filter_color_filter(void* filter, guchar *image, int x, int y, int depth);
++
+ static void
+ apply_filters(cam* cam) {
++      /* v4l has reverse rgb order from what camora expect so call the color
++         filter to fix things up before running the user selected filters */
++      camorama_filter_color_filter(NULL, cam->pic_buf, cam->x, cam->y, cam->depth);
+       camorama_filter_chain_apply(cam->filter_chain, cam->pic_buf, cam->x, cam->y, cam->depth);
+ #warning "FIXME: enable the threshold channel filter"
+ //    if((effect_mask & CAMORAMA_FILTER_THRESHOLD_CHANNEL)  != 0) 
+--- camorama-0.19/src/filter.c 2007-09-16 14:48:50.000000000 +0200
++++ camorama-0.19.new/src/filter.c     2008-06-29 22:11:42.000000000 +0200
+@@ -151,12 +151,12 @@
+ static void
+ camorama_filter_color_init(CamoramaFilterColor* self) {}
+ 
+-static void
++void
+ camorama_filter_color_filter(CamoramaFilterColor* filter, guchar *image, int x, int y, int depth) {
+       int i;
+       char tmp;
+       i = x * y;
+-      while (--i) {
++      while (i--) {
+               tmp = image[0];
+               image[0] = image[2];
+               image[2] = tmp;
+--- camorama-0.19/src/main.c   2007-09-16 15:36:55.000000000 +0200
++++ camorama-0.19.new/src/main.c       2008-06-29 22:20:04.000000000 +0200
+@@ -224,8 +224,7 @@
+ 
+     /* get picture attributes */
+     get_pic_info (cam);
+-//    set_pic_info(cam);
+-    /* set_pic_info(cam); */
++    set_pic_info (cam);
+     cam->contrast = cam->vid_pic.contrast;
+     cam->brightness = cam->vid_pic.brightness;
+     cam->colour = cam->vid_pic.colour;
+--- camorama-0.19/src/v4l.c    2007-09-16 14:48:05.000000000 +0200
++++ camorama-0.19.new/src/v4l.c        2008-06-29 22:20:23.000000000 +0200
+@@ -158,8 +158,8 @@
+       if(cam->debug) {
+               g_message("SET PIC");
+       }
+-      //cam->vid_pic.palette = VIDEO_PALETTE_RGB24;
+-      //cam->vid_pic.depth = 24;
++      cam->vid_pic.palette = VIDEO_PALETTE_RGB24;
++      cam->vid_pic.depth = 24;
+       //cam->vid_pic.palette = VIDEO_PALETTE_YUV420P;
+       if(ioctl(cam->dev, VIDIOCSPICT, &cam->vid_pic) == -1) {
+               if(cam->debug) {
+@@ -232,6 +232,8 @@
+       exit(0);
+    }
+ 
++   cam->x = cam->vid_win.width;
++   cam->y = cam->vid_win.height;
+ }
+ 
+ void set_buffer(cam * cam)
+--- camorama-0.19/src/camorama-window.c~       2007-09-16 15:36:55.000000000 +0200
++++ camorama-0.19/src/camorama-window.c        2009-06-23 20:19:16.000000000 +0200
+@@ -209,11 +209,7 @@ load_interface(cam* cam) {
+ 
+     logo = gtk_icon_theme_load_icon(gtk_icon_theme_get_for_screen(gtk_widget_get_screen(glade_xml_get_widget(cam->xml, "main_window"))), CAMORAMA_STOCK_WEBCAM, 24, 0, NULL);
+     gtk_window_set_default_icon(logo);
+-    logo = (GdkPixbuf *) create_pixbuf (PACKAGE_DATA_DIR "/pixmaps/camorama.png");
+-    if (logo == NULL) {
+-        printf ("\n\nLOGO NO GO\n\n");
+-    }
+-
++    logo = gtk_icon_theme_load_icon(gtk_icon_theme_get_for_screen(gtk_widget_get_screen(glade_xml_get_widget(cam->xml, "main_window"))), "camorama", 48, 0, NULL);
+     if (cam->show_adjustments == FALSE) {
+         gtk_widget_hide (glade_xml_get_widget
+                          (cam->xml, "adjustments_table"));
diff --git a/media-video/camorama/files/camorama-0.19-libv4l.patch b/media-video/camorama/files/camorama-0.19-libv4l.patch
new file mode 100644 (file)
index 0000000..ada58fe
--- /dev/null
@@ -0,0 +1,198 @@
+http://cvs.fedoraproject.org/viewvc/rpms/camorama/devel/
+
+--- camorama-0.19/src/Makefile.am      2007-09-16 14:48:05.000000000 +0200
++++ camorama-0.19.new/src/Makefile.am  2009-06-24 15:01:37.000000000 +0200
+@@ -36,7 +36,7 @@
+       filter.h        \
+       $(BUILT_SOURCES)\
+       $(NULL)
+-camorama_LDADD = $(PACKAGE_LIBS)
++camorama_LDADD = $(PACKAGE_LIBS) -lv4l1
+ 
+ DISTCLEANFILES=$(BUILT_SOURCES)
+ 
+--- camorama-0.19/src/Makefile.in      2007-10-06 21:06:28.000000000 +0200
++++ camorama-0.19.new/src/Makefile.in  2009-06-24 15:01:50.000000000 +0200
+@@ -248,7 +248,7 @@
+       $(BUILT_SOURCES)\
+       $(NULL)
+ 
+-camorama_LDADD = $(PACKAGE_LIBS)
++camorama_LDADD = $(PACKAGE_LIBS) -lv4l1
+ DISTCLEANFILES = $(BUILT_SOURCES)
+ all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+--- camorama-0.19/src/callbacks.c      2009-06-24 15:01:55.000000000 +0200
++++ camorama-0.19.new/src/callbacks.c  2009-06-24 14:55:42.000000000 +0200
+@@ -9,6 +9,7 @@
+ #include <libgnomeui/gnome-propertybox.h>
+ #include <libgnomeui/gnome-window-icon.h>
+ #include <pthread.h>
++#include <libv4l1.h>
+ 
+ extern GtkWidget *main_window, *prefswindow;
+ //extern state func_state;
+@@ -390,7 +391,7 @@
+ 
+     /*
+      * if(cam->read == FALSE) {
+-     *  cam->pic = mmap(0, cam->vid_buf.size, PROT_READ | PROT_WRITE, MAP_SHARED, cam->dev, 0);
++     *  cam->pic = v4l1_mmap(0, cam->vid_buf.size, PROT_READ | PROT_WRITE, MAP_SHARED, cam->dev, 0);
+      *  
+      *  if((unsigned char *) -1 == (unsigned char *) cam->pic) {
+      *   if(cam->debug == TRUE) {
+@@ -401,7 +402,7 @@
+      *  }
+      *  }else{
+      *   cam->pic_buf = malloc(cam->x * cam->y * cam->depth);
+-     *   read(cam->dev,cam->pic,(cam->x * cam->y * 3));
++     *   v4l1_read(cam->dev,cam->pic,(cam->x * cam->y * 3));
+      *  } 
+      */
+ 
+@@ -427,7 +428,7 @@
+      * if(cam->read == FALSE) {
+      * * for(frame = 0; frame < cam->vid_buf.frames; frame++) {
+      * * cam->vid_map.frame = frame;
+-     * * if(ioctl(cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
++     * * if(v4l1_ioctl(cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
+      * * if(cam->debug == TRUE) {
+      * * fprintf(stderr, "Unable to capture image (VIDIOCMCAPTURE) during resize.\n");
+      * * }
+@@ -547,7 +548,7 @@
+     int i, count = 0;
+     GdkGC *gc;
+ 
+-    read (cam->dev, cam->pic, (cam->x * cam->y * 3));
++    v4l1_read (cam->dev, cam->pic, (cam->x * cam->y * 3));
+     frames2++;
+     /*
+      * update_rec.x = 0;
+@@ -588,7 +589,7 @@
+ 
+     i = -1;
+     while (i < 0) {
+-        i = ioctl (cam->dev, VIDIOCSYNC, &frame);
++        i = v4l1_ioctl (cam->dev, VIDIOCSYNC, &frame);
+ 
+         if (i < 0 && errno == EINTR) {
+             if (cam->debug == TRUE) {
+@@ -630,7 +631,7 @@
+                                 0, cam->x, cam->y);
+ 
+     cam->vid_map.frame = frame;
+-    if (ioctl (cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
++    if (v4l1_ioctl (cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
+         if (cam->debug == TRUE) {
+             fprintf (stderr, "Unable to capture image (VIDIOCMCAPTURE)\n");
+         }
+@@ -677,7 +678,7 @@
+ void init_cam (GtkWidget * capture, cam * cam)
+ {
+     cam->pic =
+-        mmap (0, cam->vid_buf.size, PROT_READ | PROT_WRITE,
++        v4l1_mmap (0, cam->vid_buf.size, PROT_READ | PROT_WRITE,
+               MAP_SHARED, cam->dev, 0);
+ 
+     if ((unsigned char *) -1 == (unsigned char *) cam->pic) {
+@@ -692,7 +693,7 @@
+     cam->vid_map.format = cam->vid_pic.palette;
+     for (frame = 0; frame < cam->vid_buf.frames; frame++) {
+         cam->vid_map.frame = frame;
+-        if (ioctl (cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
++        if (v4l1_ioctl (cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
+             if (cam->debug == TRUE) {
+                 fprintf (stderr,
+                          "Unable to capture image (VIDIOCMCAPTURE).\n");
+--- camorama-0.19/src/main.c   2009-06-24 15:01:55.000000000 +0200
++++ camorama-0.19.new/src/main.c       2009-06-24 14:59:35.000000000 +0200
+@@ -9,6 +9,7 @@
+ #include <gdk-pixbuf-xlib/gdk-pixbuf-xlib.h>
+ #include <gdk-pixbuf-xlib/gdk-pixbuf-xlibrgb.h>
+ #include <locale.h>
++#include <libv4l1.h>
+ 
+ #include "camorama-display.h"
+ #include "camorama-stock-items.h"
+@@ -206,7 +207,7 @@
+     gdk_pixbuf_xlib_init (display, 0);
+     cam->desk_depth = xlib_rgb_get_depth ();
+ 
+-    cam->dev = open (cam->video_dev, O_RDWR);
++    cam->dev = v4l1_open (cam->video_dev, O_RDWR);
+ 
+     camera_cap (cam);
+     get_win_info (cam);
+@@ -284,5 +285,8 @@
+ 
+     gtk_timeout_add (2000, (GSourceFunc) fps, cam->status);
+     gtk_main ();
++    v4l1_munmap(cam->pic, cam->vid_buf.size);
++    v4l1_close(cam->dev);
++    
+     return 0;
+ }
+--- camorama-0.19/src/v4l.c    2009-06-24 15:01:55.000000000 +0200
++++ camorama-0.19.new/src/v4l.c        2009-06-24 14:54:09.000000000 +0200
+@@ -2,6 +2,7 @@
+ #include<time.h>
+ #include<errno.h>
+ #include<gnome.h>
++#include <libv4l1.h>
+ #include "support.h"
+ 
+ extern int frame_number;
+@@ -87,7 +88,7 @@
+ void camera_cap(cam * cam)
+ {
+    char *msg;
+-   if(ioctl(cam->dev, VIDIOCGCAP, &cam->vid_cap) == -1) {
++   if(v4l1_ioctl(cam->dev, VIDIOCGCAP, &cam->vid_cap) == -1) {
+       if(cam->debug == TRUE) {
+          fprintf(stderr, "VIDIOCGCAP  --  could not get camera capabilities, exiting.....\n");
+       }
+@@ -161,7 +162,7 @@
+       cam->vid_pic.palette = VIDEO_PALETTE_RGB24;
+       cam->vid_pic.depth = 24;
+       //cam->vid_pic.palette = VIDEO_PALETTE_YUV420P;
+-      if(ioctl(cam->dev, VIDIOCSPICT, &cam->vid_pic) == -1) {
++      if(v4l1_ioctl(cam->dev, VIDIOCSPICT, &cam->vid_pic) == -1) {
+               if(cam->debug) {
+                       g_message("VIDIOCSPICT  --  could not set picture info, exiting....");
+               }
+@@ -176,7 +177,7 @@
+ //set_pic_info(cam);
+    char *msg;
+       
+-   if(ioctl(cam->dev, VIDIOCGPICT, &cam->vid_pic) == -1) {
++   if(v4l1_ioctl(cam->dev, VIDIOCGPICT, &cam->vid_pic) == -1) {
+       msg = g_strdup_printf(_("Could not connect to video device (%s).\nPlease check connection."), cam->video_dev);
+       error_dialog(msg);
+       if(cam->debug == TRUE) {
+@@ -201,7 +202,7 @@
+ void get_win_info(cam * cam)
+ {
+    gchar *msg;
+-   if(ioctl(cam->dev, VIDIOCGWIN, &cam->vid_win) == -1) {
++   if(v4l1_ioctl(cam->dev, VIDIOCGWIN, &cam->vid_win) == -1) {
+       msg = g_strdup_printf(_("Could not connect to video device (%s).\nPlease check connection."), cam->video_dev);
+       error_dialog(msg);
+       if(cam->debug == TRUE) {
+@@ -222,7 +223,7 @@
+ void set_win_info(cam * cam)
+ {
+    gchar *msg;
+-   if(ioctl(cam->dev, VIDIOCSWIN, &cam->vid_win) == -1) {
++   if(v4l1_ioctl(cam->dev, VIDIOCSWIN, &cam->vid_win) == -1) {
+       msg = g_strdup_printf(_("Could not connect to video device (%s).\nPlease check connection."), cam->video_dev);
+       error_dialog(msg);
+       if(cam->debug == TRUE) {
+@@ -239,7 +240,7 @@
+ void set_buffer(cam * cam)
+ {
+    char *msg;
+-   if(ioctl(cam->dev, VIDIOCGMBUF, &cam->vid_buf) == -1) {
++   if(v4l1_ioctl(cam->dev, VIDIOCGMBUF, &cam->vid_buf) == -1) {
+       msg = g_strdup_printf(_("Could not connect to video device (%s).\nPlease check connection."), cam->video_dev);
+       error_dialog(msg);
+       if(cam->debug == TRUE) {