diff -u camorama-0.19/debian/control camorama-0.19/debian/control --- camorama-0.19/debian/control +++ camorama-0.19/debian/control @@ -1,8 +1,9 @@ Source: camorama Section: gnome Priority: optional -Maintainer: Leo Costela -Build-Depends: libgconf2-dev, file, gettext, libgtk2.0-dev (>= 2.10), libglib2.0-dev, pkg-config, libgnutls-dev, cdbs, libgnomevfs2-dev, debhelper (>= 5), libpng12-dev, libgnome2-dev, libgnomeui-dev, libglade2-dev, libx11-dev, libxml-parser-perl +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Leo Costela +Build-Depends: libgconf2-dev, file, gettext, libgtk2.0-dev (>= 2.10), libglib2.0-dev, pkg-config, libgnutls-dev, cdbs, libgnomevfs2-dev, debhelper (>= 5), libpng12-dev, libgnome2-dev, libgnomeui-dev, libglade2-dev, libx11-dev, libxml-parser-perl, libv4l-dev Homepage: http://camorama.fixedgear.org Standards-Version: 3.7.2 diff -u camorama-0.19/debian/changelog camorama-0.19/debian/changelog --- camorama-0.19/debian/changelog +++ camorama-0.19/debian/changelog @@ -1,3 +1,10 @@ +camorama (0.19-2ubuntu1) jaunty; urgency=low + + * Add S50_0.19_libv4l.patch from Fedora and add libv4l-dev as dependency + Fix LP: #260918. + + -- Stéphane Marguet (Stemp) Fri, 10 Jul 2009 19:26:33 +0200 + camorama (0.19-2) unstable; urgency=low * debian/patches: add S50_0.19_versionfix.patch to fix VERSION use only in patch2: unchanged: --- camorama-0.19.orig/debian/patches/S50_0.19_libv4l.patch +++ camorama-0.19/debian/patches/S50_0.19_libv4l.patch @@ -0,0 +1,1581 @@ +diff -Nur camorama-0.19/src/callbacks.c camorama-0.19.new/src/callbacks.c +--- camorama-0.19/src/callbacks.c 2007-09-16 15:36:55.000000000 +0200 ++++ camorama-0.19.new/src/callbacks.c 2009-07-09 18:37:52.518868712 +0200 +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + + extern GtkWidget *main_window, *prefswindow; + //extern state func_state; +@@ -393,7 +394,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) { +@@ -404,7 +405,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)); + * } + */ + +@@ -430,7 +431,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"); + * * } +@@ -539,7 +540,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; +@@ -580,7 +581,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) { +@@ -622,7 +623,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"); + } +@@ -669,7 +670,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) { +@@ -684,7 +685,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"); +diff -Nur camorama-0.19/src/callbacks.c.orig camorama-0.19.new/src/callbacks.c.orig +--- camorama-0.19/src/callbacks.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ camorama-0.19.new/src/callbacks.c.orig 2007-09-16 15:36:55.000000000 +0200 +@@ -0,0 +1,821 @@ ++#include ++#include ++#include "callbacks.h" ++#include "interface.h" ++#include "support.h" ++#include "filter.h" ++#include ++#include ++#include ++#include ++#include ++ ++extern GtkWidget *main_window, *prefswindow; ++//extern state func_state; ++//extern gint effect_mask; ++extern int frames; ++extern int frames2; ++extern int seconds; ++extern GtkWidget *dentry, *entry2, *string_entry; ++extern GtkWidget *host_entry, ++ *directory_entry, *filename_entry, *login_entry, *pw_entry; ++int frame; ++ ++/* ++ * pref callbacks ++ */ ++ ++void ts_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->timestamp = gtk_toggle_button_get_active ((GtkToggleButton *) rb); ++ gconf_client_set_bool (cam->gc, KEY4, cam->timestamp, NULL); ++} ++ ++void customstring_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->usestring = gtk_toggle_button_get_active ((GtkToggleButton *) rb); ++ gconf_client_set_bool (cam->gc, KEY18, cam->usestring, NULL); ++ gtk_widget_set_sensitive (glade_xml_get_widget ++ (cam->xml, "string_entry"), cam->usestring); ++} ++ ++void drawdate_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->usedate = gtk_toggle_button_get_active ((GtkToggleButton *) rb); ++ gconf_client_set_bool (cam->gc, KEY19, cam->usedate, NULL); ++} ++ ++void append_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->timefn = gtk_toggle_button_get_active ((GtkToggleButton *) rb); ++ gconf_client_set_bool (cam->gc, KEY14, cam->timefn, NULL); ++ ++} ++ ++void rappend_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->rtimefn = gtk_toggle_button_get_active ((GtkToggleButton *) rb); ++ gconf_client_set_bool (cam->gc, KEY15, cam->rtimefn, NULL); ++ ++} ++ ++void jpg_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->savetype = JPEG; ++ gconf_client_set_int (cam->gc, KEY3, cam->savetype, NULL); ++ ++} ++ ++void png_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->savetype = PNG; ++ gconf_client_set_int (cam->gc, KEY3, cam->savetype, NULL); ++} ++ ++void ppm_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->savetype = PPM; ++ gconf_client_set_int (cam->gc, KEY3, cam->savetype, NULL); ++} ++ ++void set_sensitive (cam * cam) ++{ ++ gtk_widget_set_sensitive (glade_xml_get_widget (cam->xml, "table4"), ++ cam->cap); ++ ++ gtk_widget_set_sensitive (glade_xml_get_widget ++ (cam->xml, "appendbutton"), cam->cap); ++ gtk_widget_set_sensitive (glade_xml_get_widget (cam->xml, "tsbutton"), ++ cam->cap); ++ gtk_widget_set_sensitive (glade_xml_get_widget (cam->xml, "jpgb"), ++ cam->cap); ++ gtk_widget_set_sensitive (glade_xml_get_widget (cam->xml, "pngb"), ++ cam->cap); ++ gtk_widget_set_sensitive (glade_xml_get_widget (cam->xml, "table5"), ++ cam->rcap); ++ gtk_widget_set_sensitive (glade_xml_get_widget (cam->xml, "timecb"), ++ cam->rcap); ++ gtk_widget_set_sensitive (glade_xml_get_widget ++ (cam->xml, "tsbutton2"), cam->rcap); ++ gtk_widget_set_sensitive (glade_xml_get_widget (cam->xml, "fjpgb"), ++ cam->rcap); ++ gtk_widget_set_sensitive (glade_xml_get_widget (cam->xml, "fpngb"), ++ cam->rcap); ++ gtk_widget_set_sensitive (glade_xml_get_widget (cam->xml, "hbox20"), ++ cam->acap); ++ ++} ++ ++void cap_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->cap = gtk_toggle_button_get_active ((GtkToggleButton *) rb); ++ ++ gconf_client_set_bool (cam->gc, KEY12, cam->cap, NULL); ++ update_tooltip (cam); ++ set_sensitive (cam); ++ ++} ++ ++void rcap_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->rcap = gtk_toggle_button_get_active ((GtkToggleButton *) rb); ++ gconf_client_set_bool (cam->gc, KEY13, cam->rcap, NULL); ++ update_tooltip (cam); ++ set_sensitive (cam); ++ ++} ++ ++void acap_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->acap = gtk_toggle_button_get_active ((GtkToggleButton *) rb); ++ ++ gconf_client_set_bool (cam->gc, KEY20, cam->acap, NULL); ++ ++ if (cam->acap == TRUE) { ++ cam->timeout_id = ++ gtk_timeout_add (cam->timeout_interval, ++ (GSourceFunc) timeout_capture_func, cam); ++ if (cam->debug == TRUE) { ++ printf ("add autocap - %d - timeout_interval = \n", ++ cam->timeout_id, cam->timeout_interval); ++ } ++ } else { ++ if (cam->debug == TRUE) { ++ printf ("remove autocap - %d - timeout_interval = \n", ++ cam->timeout_id, cam->timeout_interval); ++ } ++ gtk_timeout_remove (cam->timeout_id); ++ } ++ update_tooltip (cam); ++ set_sensitive (cam); ++} ++ ++void interval_change (GtkWidget * sb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->timeout_interval = ++ gtk_spin_button_get_value ((GtkSpinButton *) sb) * 60000; ++ gconf_client_set_int (cam->gc, KEY21, cam->timeout_interval, NULL); ++ if (cam->acap == TRUE) { ++ if (cam->debug == TRUE) { ++ printf ++ ("interval_change; old timeout_id = %d old interval = %d\n", ++ cam->timeout_id, cam->timeout_interval); ++ } ++ gtk_timeout_remove (cam->timeout_id); ++ cam->timeout_id = ++ gtk_timeout_add (cam->timeout_interval, ++ (GSourceFunc) timeout_capture_func, cam); ++ if (cam->debug == TRUE) { ++ printf ("new timeout_id = %d, new interval = %d\n", ++ cam->timeout_id, cam->timeout_interval); ++ } ++ } ++ update_tooltip (cam); ++} ++ ++void rjpg_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->rsavetype = JPEG; ++ gconf_client_set_int (cam->gc, KEY10, cam->rsavetype, NULL); ++ ++} ++ ++void rpng_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->rsavetype = PNG; ++ gconf_client_set_int (cam->gc, KEY10, cam->rsavetype, NULL); ++} ++ ++void rppm_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->rsavetype = PPM; ++ gconf_client_set_int (cam->gc, KEY10, cam->rsavetype, NULL); ++} ++ ++void rts_func (GtkWidget * rb, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ cam->rtimestamp = gtk_toggle_button_get_active ((GtkToggleButton *) rb); ++ gconf_client_set_bool (cam->gc, KEY11, cam->rtimestamp, NULL); ++ ++} ++ ++void ++gconf_notify_func (GConfClient * client, guint cnxn_id, GConfEntry * entry, ++ char *str) ++{ ++ GConfValue *value; ++ ++ value = gconf_entry_get_value (entry); ++ str = g_strdup (gconf_value_get_string (value)); ++ ++} ++ ++void ++gconf_notify_func_bool (GConfClient * client, guint cnxn_id, ++ GConfEntry * entry, gboolean val) ++{ ++ GConfValue *value; ++ value = gconf_entry_get_value (entry); ++ val = gconf_value_get_bool (value); ++ ++} ++ ++void ++gconf_notify_func_int (GConfClient * client, guint cnxn_id, ++ GConfEntry * entry, int val) ++{ ++ GConfValue *value; ++ value = gconf_entry_get_value (entry); ++ val = gconf_value_get_int (value); ++ ++} ++ ++int delete_event (GtkWidget * widget, gpointer data) ++{ ++ gtk_main_quit (); ++ return FALSE; ++} ++ ++/* ++ * apply preferences ++ */ ++void prefs_func (GtkWidget * okbutton, cam * cam) ++{ ++ GConfClient *client; ++ ++ client = gconf_client_get_default (); ++ ++ if (gnome_file_entry_get_full_path ((GnomeFileEntry *) dentry, TRUE) ++ != NULL) { ++ cam->pixdir = g_strdup ((gchar *) ++ gnome_file_entry_get_full_path ((GnomeFileEntry *) dentry, FALSE)); ++ gconf_client_set_string (cam->gc, KEY1, cam->pixdir, NULL); ++ ++ } else { ++ if (cam->debug == TRUE) { ++ fprintf (stderr, "null directory\ndirectory unchanged."); ++ } ++ } ++ ++ /* ++ * this is stupid, even if the string is empty, it will not return NULL ++ */ ++ if (strlen (gtk_entry_get_text ((GtkEntry *) entry2)) > 0) { ++ cam->capturefile = ++ g_strdup (gtk_entry_get_text ((GtkEntry *) entry2)); ++ gconf_client_set_string (cam->gc, KEY2, cam->capturefile, NULL); ++ } ++ ++ if (strlen (gtk_entry_get_text ((GtkEntry *) host_entry)) > 0) { ++ cam->rhost = g_strdup (gtk_entry_get_text ((GtkEntry *) host_entry)); ++ gconf_client_set_string (cam->gc, KEY5, cam->rhost, NULL); ++ } ++ if (strlen (gtk_entry_get_text ((GtkEntry *) login_entry)) > 0) { ++ cam->rlogin = ++ g_strdup (gtk_entry_get_text ((GtkEntry *) login_entry)); ++ gconf_client_set_string (cam->gc, KEY6, cam->rlogin, NULL); ++ } ++ if (strlen (gtk_entry_get_text ((GtkEntry *) pw_entry)) > 0) { ++ cam->rpw = g_strdup (gtk_entry_get_text ((GtkEntry *) pw_entry)); ++ gconf_client_set_string (cam->gc, KEY7, cam->rpw, NULL); ++ } ++ if (strlen (gtk_entry_get_text ((GtkEntry *) directory_entry)) > 0) { ++ cam->rpixdir = ++ g_strdup (gtk_entry_get_text ((GtkEntry *) directory_entry)); ++ gconf_client_set_string (cam->gc, KEY8, cam->rpixdir, NULL); ++ } ++ if (strlen (gtk_entry_get_text ((GtkEntry *) filename_entry)) > 0) { ++ cam->rcapturefile = ++ g_strdup (gtk_entry_get_text ((GtkEntry *) filename_entry)); ++ gconf_client_set_string (cam->gc, KEY9, cam->rcapturefile, NULL); ++ } ++ if (strlen (gtk_entry_get_text ((GtkEntry *) string_entry)) > 0) { ++ cam->ts_string = ++ g_strdup (gtk_entry_get_text ((GtkEntry *) string_entry)); ++ gconf_client_set_string (cam->gc, KEY16, cam->ts_string, NULL); ++ } ++ if (cam->debug == TRUE) { ++ fprintf (stderr, "dir now = %s\nfile now = %s\n", cam->pixdir, ++ cam->capturefile); ++ } ++ gtk_widget_hide (prefswindow); ++ ++} ++ ++void on_quit_activate (GtkMenuItem * menuitem, gpointer user_data) ++{ ++ gtk_main_quit (); ++} ++ ++void on_preferences1_activate (GtkMenuItem * menuitem, gpointer user_data) ++{ ++ gtk_widget_show (prefswindow); ++} ++ ++void on_change_size_activate (GtkWidget * widget, cam * cam) ++{ ++ gchar const *name; ++ gchar *title; ++ ++ name = gtk_widget_get_name (widget); ++ printf("name = %s\n",name); ++ if (strcmp (name, "small") == 0) { ++ cam->x = cam->vid_cap.minwidth; ++ cam->y = cam->vid_cap.minheight; ++ if (cam->debug) { ++ printf ("\nsmall\n"); ++ } ++ } else if (strcmp (name, "medium") == 0) { ++ cam->x = cam->vid_cap.maxwidth / 2; ++ cam->y = cam->vid_cap.maxheight / 2; ++ if (cam->debug) { ++ printf ("\nmed\n"); ++ } ++ } else { ++ cam->x = cam->vid_cap.maxwidth; ++ cam->y = cam->vid_cap.maxheight; ++ if (cam->debug) { ++ printf ("\nlarge\n"); ++ } ++ } ++ ++ 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) { ++ * cam->pic = 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) { ++ * fprintf(stderr, "Unable to capture image (mmap).\n"); ++ * } ++ * error_dialog(_("Unable to capture image.")); ++ * exit(-1); ++ * } ++ * }else{ ++ * cam->pic_buf = malloc(cam->x * cam->y * cam->depth); ++ * read(cam->dev,cam->pic,(cam->x * cam->y * 3)); ++ * } ++ */ ++ ++ cam->vid_win.x = 0; ++ cam->vid_win.y = 0; ++ cam->vid_win.width = cam->x; ++ cam->vid_win.height = cam->y; ++ cam->vid_win.chromakey = 0; ++ cam->vid_win.flags = 0; ++ ++ set_win_info (cam); ++ // get_win_info(cam); ++ cam->vid_map.height = cam->y; ++ cam->vid_map.width = cam->x; ++ /* ++ * cam->vid_win.height = cam->y; ++ * * cam->vid_win.width = cam->x; ++ * * get_win_info(cam); ++ */ ++ cam->vid_map.format = cam->vid_pic.palette; ++ // get_win_info(cam); ++ /* ++ * 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(cam->debug == TRUE) { ++ * * fprintf(stderr, "Unable to capture image (VIDIOCMCAPTURE) during resize.\n"); ++ * * } ++ * * //error_dialog(_("Unable to capture image.")); ++ * * //exit(-1); ++ * * } ++ * * } ++ * * } ++ */ ++ get_win_info (cam); ++ frame = 0; ++ gtk_window_resize (GTK_WINDOW ++ (glade_xml_get_widget (cam->xml, "main_window")), 320, ++ 240); ++ ++ title = g_strdup_printf ("Camorama - %s - %dx%d", cam->vid_cap.name, ++ cam->x, cam->y); ++ gtk_window_set_title (GTK_WINDOW ++ (glade_xml_get_widget (cam->xml, "main_window")), ++ title); ++ g_free (title); ++} ++ ++void on_show_adjustments_activate (GtkMenuItem * menuitem, cam * cam) ++{ ++ ++ if (GTK_WIDGET_VISIBLE (glade_xml_get_widget (cam->xml, "adjustments_table"))) { ++ gtk_widget_hide (glade_xml_get_widget (cam->xml, "adjustments_table")); ++ gtk_window_resize (GTK_WINDOW ++ (glade_xml_get_widget ++ (cam->xml, "main_window")), 320, 240); ++ cam->show_adjustments = FALSE; ++ ++ } else { ++ gtk_widget_show (glade_xml_get_widget (cam->xml, "adjustments_table")); ++ cam->show_adjustments = TRUE; ++ } ++ gconf_client_set_bool (cam->gc, KEY22, cam->show_adjustments, NULL); ++} ++ ++void ++on_show_effects_activate(GtkMenuItem* menuitem, cam* cam) { ++ GtkWidget* effects = glade_xml_get_widget(cam->xml, "scrolledwindow_effects"); ++ cam->show_effects = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)); ++ ++ if(!cam->show_effects) { ++ gtk_widget_hide(effects); ++ gtk_window_resize(GTK_WINDOW(glade_xml_get_widget(cam->xml, "main_window")), 320, 240); ++ } else { ++ gtk_widget_show(effects); ++ } ++ ++ gconf_client_set_bool(cam->gc, KEY23, cam->show_effects, NULL); ++} ++ ++void on_about_activate (GtkMenuItem * menuitem, cam * cam) ++{ ++ static GtkWidget *about = NULL; ++ const gchar *authors[] = { ++ "Greg Jones ", ++ "Jens Knutson ", ++ NULL ++ }; ++ const gchar *documenters[] = { NULL }; ++ GdkPixbuf *logo = ++ (GdkPixbuf *) create_pixbuf (PACKAGE_DATA_DIR "/pixmaps/camorama.png"); ++ char *translators = _("translator_credits"); ++ ++ if (!strcmp (translators, "translator_credits")) ++ translators = NULL; ++ if (about != NULL) { ++ gtk_window_present (GTK_WINDOW (about)); ++ return; ++ } ++ ++ about = gnome_about_new (_("Camorama"), PACKAGE_VERSION, ++ "Copyright \xc2\xa9 2002 Greg Jones", ++ _("View, alter and save images from a webcam"), ++ (const char **) authors, ++ (const char **) documenters, translators, logo); ++ gtk_window_set_transient_for (GTK_WINDOW (about), ++ GTK_WINDOW (glade_xml_get_widget ++ (cam->xml, "main_window"))); ++ ++ g_object_add_weak_pointer (G_OBJECT (about), (void **) &(about)); ++ ++ gtk_widget_show (about); ++} ++ ++static void ++apply_filters(cam* cam) { ++ 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) ++// threshold_channel (cam->pic_buf, cam->x, cam->y, cam->dither); ++#warning "FIXME: enable the threshold filter" ++// if((effect_mask & CAMORAMA_FILTER_THRESHOLD) != 0) ++// threshold (cam->pic_buf, cam->x, cam->y, cam->dither); ++} ++ ++/* ++ * get image from cam - does all the work ;) ++ */ ++gint ++read_timeout_func(cam* cam) { ++ int i, count = 0; ++ GdkGC *gc; ++ ++ read (cam->dev, cam->pic, (cam->x * cam->y * 3)); ++ frames2++; ++ /* ++ * update_rec.x = 0; ++ * update_rec.y = 0; ++ * update_rec.width = cam->x; ++ * update_rec.height = cam->y; ++ */ ++ count++; ++ /* ++ * refer the frame ++ */ ++ cam->pic_buf = cam->pic; // + cam->vid_buf.offsets[frame]; ++ ++ if (cam->vid_pic.palette == VIDEO_PALETTE_YUV420P) { ++ yuv420p_to_rgb (cam->pic_buf, cam->tmp, cam->x, cam->y, cam->depth); ++ cam->pic_buf = cam->tmp; ++ } ++ ++ apply_filters(cam); ++ ++ gc = gdk_gc_new (cam->pixmap); ++ gdk_draw_rgb_image (cam->pixmap, ++ gc, 0, 0, ++ cam->vid_win.width, cam->vid_win.height, ++ GDK_RGB_DITHER_NORMAL, cam->pic_buf, ++ cam->vid_win.width * cam->depth); ++ ++ gtk_widget_queue_draw_area (glade_xml_get_widget (cam->xml, "da"), 0, ++ 0, cam->x, cam->y); ++ return 1; ++ ++} ++ ++gint timeout_func (cam * cam) ++{ ++ int i, count = 0; ++ GdkGC *gc; ++ ++ i = -1; ++ while (i < 0) { ++ i = ioctl (cam->dev, VIDIOCSYNC, &frame); ++ ++ if (i < 0 && errno == EINTR) { ++ if (cam->debug == TRUE) { ++ printf ("i = %d\n", i); ++ } ++ continue; ++ } ++ if (i < 0) { ++ if (cam->debug == TRUE) { ++ fprintf (stderr, "Unable to capture image (VIDIOCSYNC)\n"); ++ } ++ error_dialog (_("Unable to capture image.")); ++ exit (-1); ++ } ++ break; ++ } ++ count++; ++ /* ++ * refer the frame ++ */ ++ cam->pic_buf = cam->pic + cam->vid_buf.offsets[frame]; ++ if (cam->vid_pic.palette == VIDEO_PALETTE_YUV420P) { ++ yuv420p_to_rgb (cam->pic_buf, cam->tmp, cam->x, cam->y, cam->depth); ++ cam->pic_buf = cam->tmp; ++ } ++ ++ apply_filters(cam); ++ ++ ++ gc = gdk_gc_new (cam->pixmap); ++ ++ gdk_draw_rgb_image (cam->pixmap, ++ gc, 0, 0, ++ cam->vid_win.width, cam->vid_win.height, ++ GDK_RGB_DITHER_NORMAL, cam->pic_buf, ++ cam->vid_win.width * cam->depth); ++ ++ gtk_widget_queue_draw_area (glade_xml_get_widget (cam->xml, "da"), 0, ++ 0, cam->x, cam->y); ++ ++ cam->vid_map.frame = frame; ++ if (ioctl (cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) { ++ if (cam->debug == TRUE) { ++ fprintf (stderr, "Unable to capture image (VIDIOCMCAPTURE)\n"); ++ } ++ error_dialog (_("Unable to capture image.")); ++ exit (-1); ++ } ++ ++ /* ++ * next frame ++ */ ++ frame++; ++ ++ /* ++ * reset to the 1st frame ++ */ ++ if (frame >= cam->vid_buf.frames) { ++ frame = 0; ++ } ++ ++ frames2++; ++ g_object_unref ((gpointer) gc); ++ return 1; ++} ++ ++gint fps (GtkWidget * sb) ++{ ++ gchar *stat; ++ ++ seconds++; ++ stat = g_strdup_printf ("%.2f fps - current %.2f fps - average", ++ (float) frames / (float) (2), ++ (float) frames2 / (float) (seconds * 2)); ++ frames = 0; ++ gnome_appbar_push (GNOME_APPBAR (sb), stat); ++ g_free (stat); ++ return 1; ++} ++ ++void on_status_show (GtkWidget * sb, cam * cam) ++{ ++ cam->status = sb; ++} ++ ++void init_cam (GtkWidget * capture, cam * cam) ++{ ++ cam->pic = ++ 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) { ++ fprintf (stderr, "Unable to capture image (mmap).\n"); ++ } ++ error_dialog (_("Unable to capture image.")); ++ exit (-1); ++ } ++ cam->vid_map.height = cam->y; ++ cam->vid_map.width = cam->x; ++ 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 (cam->debug == TRUE) { ++ fprintf (stderr, ++ "Unable to capture image (VIDIOCMCAPTURE).\n"); ++ } ++ error_dialog (_("Unable to capture image.")); ++ exit (-1); ++ } ++ } ++ frame = 0; ++} ++ ++void capture_func (GtkWidget * widget, cam * cam) ++{ ++ if (cam->debug == TRUE) { ++ printf ++ ("capture_func\nx = %d, y = %d, depth = %d, realloc size = %d\n", ++ cam->x, cam->y, cam->depth, (cam->x * cam->y * cam->depth)); ++ } ++ ++ memcpy (cam->tmp, cam->pic_buf, cam->x * cam->y * cam->depth); ++ ++ if (cam->rcap == TRUE) { ++ remote_save (cam); ++ } ++ if (cam->cap == TRUE) { ++ local_save (cam); ++ } ++ ++} ++ ++gint timeout_capture_func (cam * cam) ++{ ++ /* GdkRectangle rect; ++ * rect->x = 0; rect->y = 0; ++ * rect->width = cam->x; rect->height = cam->y; */ ++ ++ /* need to return true, or the timeout will be destroyed - don't forget! :) */ ++ if (cam->hidden == TRUE) { ++ /* call timeout_func to get a new picture. stupid, but it works. ++ * also need to add this to capture_func ++ * maybe add a "window_state_event" handler to do the same when window is iconified */ ++ ++ pt2Function (cam); ++ pt2Function (cam); ++ pt2Function (cam); ++ pt2Function (cam); ++ ++ } ++ memcpy (cam->tmp, cam->pic_buf, cam->x * cam->y * cam->depth); ++ ++ if (cam->cap == TRUE) { ++ local_save (cam); ++ } ++ if (cam->rcap == TRUE) { ++ remote_save (cam); ++ } ++ return 1; ++} ++ ++void contrast_change (GtkHScale * sc1, cam * cam) ++{ ++ ++ cam->vid_pic.contrast = ++ 256 * (int) gtk_range_get_value ((GtkRange *) sc1); ++ set_pic_info (cam); ++} ++ ++void brightness_change (GtkHScale * sc1, cam * cam) ++{ ++ ++ cam->vid_pic.brightness = ++ 256 * (int) gtk_range_get_value ((GtkRange *) sc1); ++ set_pic_info (cam); ++} ++ ++void colour_change (GtkHScale * sc1, cam * cam) ++{ ++ ++ cam->vid_pic.colour = 256 * (int) gtk_range_get_value ((GtkRange *) sc1); ++ set_pic_info (cam); ++} ++ ++void hue_change (GtkHScale * sc1, cam * cam) ++{ ++ ++ cam->vid_pic.hue = 256 * (int) gtk_range_get_value ((GtkRange *) sc1); ++ set_pic_info (cam); ++} ++ ++void wb_change (GtkHScale * sc1, cam * cam) ++{ ++ ++ cam->vid_pic.whiteness = ++ 256 * (int) gtk_range_get_value ((GtkRange *) sc1); ++ set_pic_info (cam); ++} ++ ++void help_cb (GtkWidget * widget, gpointer data) ++{ ++ GError *error = NULL; ++ ++ if (error != NULL) { ++ /* ++ * FIXME: This is bad :) ++ */ ++ g_warning ("%s\n", error->message); ++ g_error_free (error); ++ } ++} ++ ++void update_tooltip (cam * cam) ++{ ++ gchar *tooltip_text; ++ ++ if (cam->debug == TRUE) { ++ printf ("update_tooltip called\n"); ++ } ++ if (cam->acap == TRUE) { ++ tooltip_text = ++ g_strdup_printf ++ (_("Local Capture: %d\nRemote Capture: %d\nCapture Interval: %d"), ++ cam->cap, cam->rcap, cam->timeout_interval / 60000); ++ if (cam->debug == TRUE) { ++ printf ("tip - acap on\n"); ++ } ++ } else { ++ if (cam->debug == TRUE) { ++ printf ("tip - acap off\n"); ++ } ++ tooltip_text = g_strdup_printf (_("Automatic Capture Disabled")); ++ } ++ gtk_status_icon_set_tooltip(cam->tray_icon, tooltip_text); ++ g_free (tooltip_text); ++} +diff -Nur camorama-0.19/src/main.c camorama-0.19.new/src/main.c +--- camorama-0.19/src/main.c 2007-09-16 15:36:55.000000000 +0200 ++++ camorama-0.19.new/src/main.c 2009-07-09 18:37:52.518868712 +0200 +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + + #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); +@@ -285,5 +286,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; + } +diff -Nur camorama-0.19/src/main.c.orig camorama-0.19.new/src/main.c.orig +--- camorama-0.19/src/main.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ camorama-0.19.new/src/main.c.orig 2007-09-16 15:36:55.000000000 +0200 +@@ -0,0 +1,289 @@ ++#include ++#include "interface.h" ++ ++#include "callbacks.h" ++#include "support.h" ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include "camorama-display.h" ++#include "camorama-stock-items.h" ++ ++static gboolean ver = FALSE, max = FALSE, min = FALSE, half = ++ FALSE, use_read = FALSE; ++ ++/*static gint tray_icon_destroyed (GtkWidget *tray, gpointer data) ++{ ++ GConfClient *client = gconf_client_get_default (); ++ ++ //Somehow the delete_event never got called, so we use "destroy" ++ if (tray != MyApp->GetMainWindow ()->docklet) ++ return true; ++ GtkWidget *new_tray = gnomemeeting_init_tray (); ++ ++ if (gconf_client_get_bool ++ (client, GENERAL_KEY "do_not_disturb", 0)) ++ gnomemeeting_tray_set_content (new_tray, 2); ++ ++ ++ MyApp->GetMainWindow ()->docklet = GTK_WIDGET (new_tray); ++ gtk_widget_show (gm); ++ ++ return true; ++}*/ ++ ++static GtkWidget* ++camorama_glade_handler (GladeXML* xml, ++ gchar * func_name, ++ gchar * name, ++ gchar * string1, ++ gchar * string2, ++ gint int1, ++ gint int2, ++ gpointer data) ++{ ++ gboolean reached = TRUE; ++#warning "FIXME: move the glade crap into the window class" ++ if (string1 && !strcmp (string1, "CamoDisplay")) { ++ GtkWidget* widget = camo_display_new ((cam*)data); ++ gtk_widget_show (widget); ++ return widget; ++ } ++ ++ g_return_val_if_fail (!reached, NULL); ++ return NULL; ++} ++ ++int ++main(int argc, char *argv[]) { ++ cam cam_object, *cam; ++ Display *display; ++ Screen *screen_num; ++ gchar *poopoo = NULL; ++ gchar *pixfilename = "camorama/camorama.png"; ++ gchar *filename; //= "/usr/opt/garnome/share/camorama/camorama.glade"; ++ int x = -1, y = -1; ++ gboolean buggery = FALSE; ++ GtkWidget *button; ++ GConfClient *gc; ++ ++ const struct poptOption popt_options[] = { ++ {"version", 'V', POPT_ARG_NONE, &ver, 0, ++ N_("show version and exit"), NULL}, ++ {"device", 'd', POPT_ARG_STRING, &poopoo, 0, ++ N_("v4l device to use"), NULL}, ++ {"debug", 'D', POPT_ARG_NONE, &buggery, 0, ++ N_("enable debugging code"), NULL}, ++ {"width", 'x', POPT_ARG_INT, &x, 0, N_("capture width"), ++ NULL}, ++ {"height", 'y', POPT_ARG_INT, &y, 0, N_("capture height"), ++ NULL}, ++ {"max", 'M', POPT_ARG_NONE, &max, 0, ++ N_("maximum capture size"), NULL}, ++ {"min", 'm', POPT_ARG_NONE, &min, 0, ++ N_("minimum capture size"), NULL}, ++ {"half", 'H', POPT_ARG_NONE, &half, 0, ++ N_("middle capture size"), NULL}, ++ {"read", 'R', POPT_ARG_NONE, &use_read, 0, ++ N_("use read() rather than mmap()"), NULL}, ++ POPT_TABLEEND ++ }; ++ ++ cam = &cam_object; ++ /* set some default values */ ++ cam->frame_number = 0; ++ cam->pic = NULL; ++ cam->pixmap = NULL; ++ cam->size = PICHALF; ++ cam->video_dev = NULL; ++ cam->read = FALSE; ++ ++ bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); ++ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); ++ textdomain (GETTEXT_PACKAGE); ++ setlocale (LC_ALL, ""); ++ ++ /* gnome_program_init - initialize everything (gconf, threads, etc) */ ++ gnome_program_init (PACKAGE_NAME, PACKAGE_VERSION, LIBGNOMEUI_MODULE, argc, argv, ++ GNOME_PARAM_APP_DATADIR, PACKAGE_DATA_DIR, ++ GNOME_PARAM_POPT_TABLE, popt_options, ++ GNOME_PARAM_HUMAN_READABLE_NAME, _("camorama"), NULL); ++ ++ /* gtk is initialized now */ ++ camorama_stock_init(); ++ camorama_filters_init(); ++ ++ cam->debug = buggery; ++ ++ cam->x = x; ++ cam->y = y; ++ glade_gnome_init (); ++ glade_set_custom_handler (camorama_glade_handler, ++ cam); ++ ++ ++ if (ver) { ++ fprintf (stderr, _("\n\nCamorama version %s\n\n"), VERSION); ++ exit (0); ++ } ++ if (max) { ++ cam->size = PICMAX; ++ } ++ if (min) { ++ cam->size = PICMIN; ++ } ++ if (half) { ++ cam->size = PICHALF; ++ } ++ if (use_read) { ++ printf ("gah!\n"); ++ cam->read = TRUE; ++ } ++ gc = gconf_client_get_default (); ++ cam->gc = gc; ++ ++ gconf_client_add_dir (cam->gc, PATH, GCONF_CLIENT_PRELOAD_NONE, NULL); ++ gconf_client_notify_add (cam->gc, KEY1, (void *) gconf_notify_func, ++ cam->pixdir, NULL, NULL); ++ gconf_client_notify_add (cam->gc, KEY5, (void *) gconf_notify_func, ++ cam->rhost, NULL, NULL); ++ gconf_client_notify_add (cam->gc, KEY2, (void *) gconf_notify_func, ++ cam->capturefile, NULL, NULL); ++ gconf_client_notify_add (cam->gc, KEY3, ++ (void *) gconf_notify_func_int, ++ GINT_TO_POINTER (cam->savetype), NULL, NULL); ++ gconf_client_notify_add (cam->gc, KEY4, ++ (void *) gconf_notify_func_bool, ++ &cam->timestamp, NULL, NULL); ++ ++ if (!poopoo) { ++ gchar const* gconf_device = gconf_client_get_string(cam->gc, KEY_DEVICE, NULL); ++ if(gconf_device) { ++ cam->video_dev = g_strdup(gconf_device); ++ } else { ++ cam->video_dev = g_strdup ("/dev/video0"); ++ } ++ } else { ++ cam->video_dev = g_strdup (poopoo); ++ } ++ ++ cam->pixdir = g_strdup (gconf_client_get_string (cam->gc, KEY1, NULL)); ++ cam->capturefile = ++ g_strdup (gconf_client_get_string (cam->gc, KEY2, NULL)); ++ cam->rhost = g_strdup (gconf_client_get_string (cam->gc, KEY5, NULL)); ++ cam->rlogin = g_strdup (gconf_client_get_string (cam->gc, KEY6, NULL)); ++ cam->rpw = g_strdup (gconf_client_get_string (cam->gc, KEY7, NULL)); ++ cam->rpixdir = g_strdup (gconf_client_get_string (cam->gc, KEY8, NULL)); ++ cam->rcapturefile = ++ g_strdup (gconf_client_get_string (cam->gc, KEY9, NULL)); ++ cam->savetype = gconf_client_get_int (cam->gc, KEY3, NULL); ++ cam->rsavetype = gconf_client_get_int (cam->gc, KEY10, NULL); ++ cam->ts_string = ++ g_strdup (gconf_client_get_string (cam->gc, KEY16, NULL)); ++ cam->date_format = "%Y-%m-%d %H:%M:%S"; ++ cam->timestamp = gconf_client_get_bool (cam->gc, KEY4, NULL); ++ cam->rtimestamp = gconf_client_get_bool (cam->gc, KEY11, NULL); ++ ++ cam->cap = gconf_client_get_bool (cam->gc, KEY12, NULL); ++ cam->rcap = gconf_client_get_bool (cam->gc, KEY13, NULL); ++ cam->timefn = gconf_client_get_bool (cam->gc, KEY14, NULL); ++ cam->rtimefn = gconf_client_get_bool (cam->gc, KEY15, NULL); ++ cam->usestring = gconf_client_get_bool (cam->gc, KEY18, NULL); ++ cam->usedate = gconf_client_get_bool (cam->gc, KEY19, NULL); ++ cam->acap = gconf_client_get_bool (cam->gc, KEY20, NULL); ++ cam->timeout_interval = gconf_client_get_int (cam->gc, KEY21, NULL); ++ cam->show_adjustments = gconf_client_get_bool (cam->gc, KEY22, NULL); ++ cam->show_effects = gconf_client_get_bool (cam->gc, KEY23, NULL); ++ ++ ++ /* get desktop depth */ ++ display = (Display *) gdk_x11_get_default_xdisplay (); ++ screen_num = xlib_rgb_get_screen (); ++ gdk_pixbuf_xlib_init (display, 0); ++ cam->desk_depth = xlib_rgb_get_depth (); ++ ++ cam->dev = open (cam->video_dev, O_RDWR); ++ ++ camera_cap (cam); ++ get_win_info (cam); ++ ++ /* query/set window attributes */ ++ cam->vid_win.x = 0; ++ cam->vid_win.y = 0; ++ cam->vid_win.width = cam->x; ++ cam->vid_win.height = cam->y; ++ cam->vid_win.chromakey = 0; ++ cam->vid_win.flags = 0; ++ ++ set_win_info (cam); ++ get_win_info (cam); ++ ++ /* get picture attributes */ ++ get_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; ++ cam->hue = cam->vid_pic.hue; ++ cam->wb = cam->vid_pic.whiteness; ++ cam->depth = cam->vid_pic.depth / 8; ++ cam->pic_buf = malloc (cam->x * cam->y * cam->depth); ++ cam->tmp = ++ malloc (cam->vid_cap.maxwidth * cam->vid_cap.maxheight * cam->depth); ++ //cam->tmp = NULL; ++ /* set the buffer size */ ++ if (cam->read == FALSE) { ++ set_buffer (cam); ++ } ++ //cam->read = FALSE; ++ /* initialize cam and create the window */ ++ ++ if (cam->read == FALSE) { ++ pt2Function = timeout_func; ++ init_cam (NULL, cam); ++ } else { ++ printf ("using read()\n"); ++ cam->pic = ++ realloc (cam->pic, ++ (cam->vid_cap.maxwidth * cam->vid_cap.maxheight * 3)); ++ pt2Function = read_timeout_func; ++ } ++ cam->pixmap = gdk_pixmap_new (NULL, cam->x, cam->y, cam->desk_depth); ++ ++ filename = ++ gnome_program_locate_file (NULL, ++ GNOME_FILE_DOMAIN_APP_DATADIR, ++ "camorama/camorama.glade", TRUE, NULL); ++ if (filename == NULL) { ++ error_dialog (_ ++ ("Couldn't find the main interface file (camorama.glade).")); ++ exit (1); ++ } ++ ++ //pixfilename = gnome_program_locate_file(NULL, GNOME_FILE_DOMAIN_APP_DATADIR, "pixmaps/camorama.png", TRUE, NULL); ++ //printf("pixfile = %s\n",pixfilename); ++ //pixfilename); ++ //printf("pixfile = %s\n",pixfilename); ++ cam->xml = glade_xml_new (filename, NULL, NULL); ++ /*eggtray */ ++ ++ /*tray_icon = egg_tray_icon_new ("Our other cool tray icon"); ++ * button = gtk_button_new_with_label ("This is a another\ncool tray icon"); ++ * g_signal_connect (button, "clicked", ++ * G_CALLBACK (second_button_pressed), tray_icon); ++ * ++ * gtk_container_add (GTK_CONTAINER (tray_icon), button); ++ * gtk_widget_show_all (GTK_WIDGET (tray_icon)); */ ++ load_interface (cam); ++ ++ cam->idle_id = gtk_idle_add ((GSourceFunc) pt2Function, (gpointer) cam); ++ ++ gtk_timeout_add (2000, (GSourceFunc) fps, cam->status); ++ gtk_main (); ++ return 0; ++} +diff -Nur camorama-0.19/src/Makefile.am camorama-0.19.new/src/Makefile.am +--- camorama-0.19/src/Makefile.am 2007-09-16 14:48:05.000000000 +0200 ++++ camorama-0.19.new/src/Makefile.am 2009-07-09 18:37:52.518868712 +0200 +@@ -36,7 +36,7 @@ + filter.h \ + $(BUILT_SOURCES)\ + $(NULL) +-camorama_LDADD = $(PACKAGE_LIBS) ++camorama_LDADD = $(PACKAGE_LIBS) -lv4l1 + + DISTCLEANFILES=$(BUILT_SOURCES) + +diff -Nur camorama-0.19/src/Makefile.in camorama-0.19.new/src/Makefile.in +--- camorama-0.19/src/Makefile.in 2007-10-06 21:06:28.000000000 +0200 ++++ camorama-0.19.new/src/Makefile.in 2009-07-09 18:37:52.518868712 +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 +diff -Nur camorama-0.19/src/v4l.c camorama-0.19.new/src/v4l.c +--- camorama-0.19/src/v4l.c 2007-09-16 14:48:05.000000000 +0200 ++++ camorama-0.19.new/src/v4l.c 2009-07-09 18:37:52.518868712 +0200 +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #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) { +@@ -237,7 +238,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) { +diff -Nur camorama-0.19/src/v4l.c.orig camorama-0.19.new/src/v4l.c.orig +--- camorama-0.19/src/v4l.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ camorama-0.19.new/src/v4l.c.orig 2007-09-16 14:48:05.000000000 +0200 +@@ -0,0 +1,258 @@ ++#include"v4l.h" ++#include ++#include ++#include ++#include "support.h" ++ ++extern int frame_number; ++extern int errno; ++ ++void print_cam(cam *cam){ ++ printf("\nCamera Info\n"); ++ printf("-------------\n"); ++ printf("device = %s, x = %d, y = %d\n",cam->video_dev, cam->x,cam->y); ++ printf("depth = %d, desk_depth = %d, size = %d\n",cam->depth,cam->desk_depth,cam->size); ++ printf("capture directory = %s, capture file = %s\n",cam->pixdir, cam->capturefile); ++ printf("remote capture directory = %s, remote capture file = %s\n",cam->rpixdir, cam->rcapturefile); ++ printf("remote host = %s, remote login = %s\n",cam->rhost,cam->rlogin); ++ printf("timestamp = %s\n\n",cam->ts_string); ++ ++} ++void print_palette(int p) ++{ ++ ++ switch (p) { ++ case VIDEO_PALETTE_HI240: ++ printf("High 240 cube (BT848)\n"); ++ break; ++ ++ case VIDEO_PALETTE_RGB565: ++ printf("565 16 bit RGB\n"); ++ break; ++ ++ case VIDEO_PALETTE_RGB24: ++ printf("24bit RGB\n"); ++ break; ++ ++ case VIDEO_PALETTE_RGB32: ++ printf("32bit RGB\n"); ++ break; ++ ++ case VIDEO_PALETTE_RGB555: ++ printf("555 15bit RGB\n"); ++ break; ++ ++ case VIDEO_PALETTE_YUV422: ++ printf("YUV422 capture"); ++ break; ++ ++ case VIDEO_PALETTE_YUYV: ++ printf("YUYV\n"); ++ break; ++ ++ case VIDEO_PALETTE_UYVY: ++ printf("UYVY\n"); ++ break; ++ ++ case VIDEO_PALETTE_YUV420: ++ printf("YUV420\n"); ++ break; ++ ++ case VIDEO_PALETTE_YUV411: ++ printf("YUV411 capture\n"); ++ break; ++ ++ case VIDEO_PALETTE_RAW: ++ printf("RAW capture (BT848)\n"); ++ break; ++ ++ case VIDEO_PALETTE_YUV422P: ++ printf("YUV 4:2:2 Planar"); ++ break; ++ ++ case VIDEO_PALETTE_YUV411P: ++ printf("YUV 4:1:1 Planar\n"); ++ break; ++ ++ case VIDEO_PALETTE_YUV420P: ++ printf("YUV 4:2:0 Planar\n"); ++ break; ++ ++ case VIDEO_PALETTE_YUV410P: ++ printf("YUV 4:1:0 Planar\n"); ++ break; ++ } ++} ++ ++void camera_cap(cam * cam) ++{ ++ char *msg; ++ if(ioctl(cam->dev, VIDIOCGCAP, &cam->vid_cap) == -1) { ++ if(cam->debug == TRUE) { ++ fprintf(stderr, "VIDIOCGCAP -- could not get camera capabilities, exiting.....\n"); ++ } ++ msg = g_strdup_printf(_("Could not connect to video device (%s).\nPlease check connection."), cam->video_dev); ++ error_dialog(msg); ++ g_free(msg); ++ exit(0); ++ } ++ if(cam->x > 0 && cam->y > 0) { ++ if(cam->vid_cap.maxwidth < cam->x) { ++ cam->x = cam->vid_cap.maxwidth; ++ } ++ if(cam->vid_cap.minwidth > cam->x) { ++ cam->x = cam->vid_cap.minwidth; ++ } ++ if(cam->vid_cap.maxheight < cam->y) { ++ cam->y = cam->vid_cap.maxheight; ++ } ++ if(cam->vid_cap.minheight > cam->y) { ++ cam->y = cam->vid_cap.minheight; ++ } ++ } else { ++ switch (cam->size) { ++ case PICMAX: ++ cam->x = cam->vid_cap.maxwidth; ++ cam->y = cam->vid_cap.maxheight; ++ break; ++ ++ case PICMIN: ++ cam->x = cam->vid_cap.minwidth; ++ cam->y = cam->vid_cap.minheight; ++ break; ++ ++ case PICHALF: ++ cam->x = cam->vid_cap.maxwidth / 2; ++ cam->y = cam->vid_cap.maxheight / 2; ++ break; ++ ++ default: ++ cam->x = cam->vid_cap.maxwidth / 2; ++ cam->y = cam->vid_cap.maxheight / 2; ++ break; ++ } ++ } ++ if((cam->vid_cap.type & VID_TYPE_CAPTURE) != 1) { ++ cam->read = TRUE; ++ } ++ ++ if(cam->debug == TRUE) { ++ printf("\nVIDIOCGCAP\n"); ++ printf("device name = %s\n", cam->vid_cap.name); ++ printf("device type = %d\n", cam->vid_cap.type); ++ if(cam->read == FALSE){ ++ printf("can use mmap()\n"); ++ } ++ printf("# of channels = %d\n", cam->vid_cap.channels); ++ printf("# of audio devices = %d\n", cam->vid_cap.audios); ++ printf("max width = %d\n", cam->vid_cap.maxwidth); ++ printf("max height = %d\n", cam->vid_cap.maxheight); ++ printf("min width = %d\n", cam->vid_cap.minwidth); ++ printf("min height = %d\n", cam->vid_cap.minheight); ++ } ++} ++ ++void ++set_pic_info(cam* cam) { ++ char *msg; ++ 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_YUV420P; ++ if(ioctl(cam->dev, VIDIOCSPICT, &cam->vid_pic) == -1) { ++ if(cam->debug) { ++ g_message("VIDIOCSPICT -- could not set picture info, exiting...."); ++ } ++ msg = g_strdup_printf(_("Could not connect to video device (%s).\nPlease check connection."), cam->video_dev); ++ error_dialog(msg); ++ g_free(msg); ++ exit(0); ++ } ++} ++ ++void get_pic_info(cam * cam){ ++//set_pic_info(cam); ++ char *msg; ++ ++ if(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) { ++ fprintf(stderr, "VIDIOCGPICT -- could not get picture info, exiting....\n"); ++ } ++ g_free(msg); ++ exit(0); ++ } ++ ++ if(cam->debug == TRUE) { ++ printf("\nVIDIOCGPICT:\n"); ++ printf("bright = %d\n", cam->vid_pic.brightness); ++ printf("hue = %d\n", cam->vid_pic.hue); ++ printf("colour = %d\n", cam->vid_pic.colour); ++ printf("contrast = %d\n", cam->vid_pic.contrast); ++ printf("whiteness = %d\n", cam->vid_pic.whiteness); ++ printf("colour depth = %d\n", cam->vid_pic.depth); ++ print_palette(cam->vid_pic.palette); ++ } ++} ++ ++void get_win_info(cam * cam) ++{ ++ gchar *msg; ++ if(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) { ++ fprintf(stderr, "VIDIOCGWIN -- could not get window info, exiting....\n"); ++ } ++ exit(0); ++ } ++ if(cam->debug == TRUE) { ++ printf("\nVIDIOCGWIN\n"); ++ printf("x = %d\n", cam->vid_win.x); ++ printf("y = %d\n", cam->vid_win.y); ++ printf("width = %d\n", cam->vid_win.width); ++ printf("height = %d\n", cam->vid_win.height); ++ printf("chromakey = %d\n", cam->vid_win.chromakey); ++ printf("flags = %d\n", cam->vid_win.flags); ++ } ++} ++void set_win_info(cam * cam) ++{ ++ gchar *msg; ++ if(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) { ++ fprintf(stderr, "VIDIOCSWIN -- could not set window info, exiting....\nerrno = %d", errno); ++ } ++ g_free(msg); ++ exit(0); ++ } ++ ++} ++ ++void set_buffer(cam * cam) ++{ ++ char *msg; ++ if(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) { ++ fprintf(stderr, "VIDIOCGMBF -- could not set buffer info, exiting...\n"); ++ } ++ g_free(msg); ++ exit(0); ++ ++ } ++ ++ if(cam->debug == TRUE) { ++ printf("\nVIDIOCGMBUF\n"); ++ printf("mb.size = %d\n", cam->vid_buf.size); ++ printf("mb.frames = %d\n", cam->vid_buf.frames); ++ printf("mb.offset = %d\n", cam->vid_buf.offsets[1]); ++ } ++ ++}