From: Brandon Philips <philips@linux-jhys.site>
Subject: cheese: warn on video encode overrun v2

Machines with slow processors and high def webcams can get in a
situation where they over run the save_queue. This causes Cheese to
lockup for long periods of time.

Handle this situation gracefully by watching for gstreamer overrun
events, stopping recording on such an event and warning the user with an
info bar.

Version 2
---------
- Move signals field into CheeseCameraPrivate to avoid having a file global
  variable in a library.

Signed-off-by: Brandon Philips <bphilips@suse.de>

---
 libcheese/cheese-camera.c |  107 +++++++++++++++++--------
 libcheese/cheese-camera.h |    1 
 src/Makefile.am           |    2 
 src/Makefile.in           |    5 -
 src/cheese-window.c       |  190 +++++++++++++++++++++++++++++++++++++---------
 5 files changed, 227 insertions(+), 78 deletions(-)
 create mode 100644 src/cheese-buffer-overrun.c
 create mode 100644 src/cheese-buffer-overrun.h

Index: cheese/src/Makefile.am
===================================================================
--- cheese.orig/src/Makefile.am
+++ cheese/src/Makefile.am
@@ -33,8 +33,6 @@ cheese_SOURCES = \
 	eog-thumbnail.h \
 	eog-thumb-nav.c \
 	eog-thumb-nav.h \
-	cheese-no-camera.c \
-	cheese-no-camera.h \
 	cheese-prefs-widget.h \
 	cheese-prefs-widget.c \
 	cheese-prefs-dialog-widgets.h \
Index: cheese/src/Makefile.in
===================================================================
--- cheese.orig/src/Makefile.in
+++ cheese/src/Makefile.in
@@ -54,7 +54,7 @@ am_cheese_OBJECTS = cheese.$(OBJEXT) che
 	cheese-commands-file.$(OBJEXT) cheese-dbus.$(OBJEXT) \
 	cheese-effect-chooser.$(OBJEXT) cheese-thumb-view.$(OBJEXT) \
 	eog-thumbnail.$(OBJEXT) eog-thumb-nav.$(OBJEXT) \
-	cheese-no-camera.$(OBJEXT) cheese-prefs-widget.$(OBJEXT) \
+	cheese-prefs-widget.$(OBJEXT) \
 	cheese-prefs-dialog-widgets.$(OBJEXT) \
 	cheese-prefs-resolution-combo.$(OBJEXT) \
 	cheese-prefs-balance-scale.$(OBJEXT) \
@@ -295,8 +295,6 @@ cheese_SOURCES = \
 	eog-thumbnail.h \
 	eog-thumb-nav.c \
 	eog-thumb-nav.h \
-	cheese-no-camera.c \
-	cheese-no-camera.h \
 	cheese-prefs-widget.h \
 	cheese-prefs-widget.c \
 	cheese-prefs-dialog-widgets.h \
@@ -419,7 +417,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cheese-commands.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cheese-dbus.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cheese-effect-chooser.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cheese-no-camera.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cheese-prefs-balance-scale.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cheese-prefs-burst-spinbox.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cheese-prefs-camera-combo.Po@am__quote@
Index: cheese/libcheese/cheese-camera.c
===================================================================
--- cheese.orig/libcheese/cheese-camera.c
+++ cheese/libcheese/cheese-camera.c
@@ -42,6 +42,15 @@ G_DEFINE_TYPE (CheeseCamera, cheese_came
 
 #define CHEESE_CAMERA_ERROR cheese_camera_error_quark ()
 
+enum
+{
+  CHEESE_SIGNAL_PHOTO_SAVED,
+  CHEESE_SIGNAL_PHOTO_TAKEN,
+  CHEESE_SIGNAL_VIDEO_SAVED,
+  CHEESE_SIGNAL_OVERRUN,
+  CHEESE_SIGNAL_LAST
+};
+
 typedef struct
 {
   GtkWidget *video_window;
@@ -81,6 +90,7 @@ typedef struct
   int y_resolution;
   int selected_device;
   CheeseVideoFormat *current_format;
+  guint signals[CHEESE_SIGNAL_LAST];
 
   guint eos_timeout_id;
 } CheeseCameraPrivate;
@@ -93,16 +103,6 @@ enum
   PROP_FORMAT,
 };
 
-enum
-{
-  PHOTO_SAVED,
-  PHOTO_TAKEN,
-  VIDEO_SAVED,
-  LAST_SIGNAL
-};
-
-static guint camera_signals[LAST_SIGNAL];
-
 typedef enum
 {
   RGB,
@@ -258,11 +258,11 @@ cheese_camera_photo_data_cb (GstElement
     g_free (priv->photo_filename);
     priv->photo_filename = NULL;
 
-    g_signal_emit (camera, camera_signals[PHOTO_SAVED], 0);
+    g_signal_emit (camera, priv->signals[CHEESE_SIGNAL_PHOTO_SAVED], 0);
   }
   else
   {
-    g_signal_emit (camera, camera_signals[PHOTO_TAKEN], 0, pixbuf);
+    g_signal_emit (camera, priv->signals[CHEESE_SIGNAL_PHOTO_TAKEN], 0, pixbuf);
     g_object_unref (pixbuf);
   }
 }
@@ -280,7 +280,7 @@ cheese_camera_bus_message_cb (GstBus *bu
 
       g_source_remove (priv->eos_timeout_id);
 
-      g_signal_emit (camera, camera_signals[VIDEO_SAVED], 0);
+      g_signal_emit (camera, priv->signals[CHEESE_SIGNAL_VIDEO_SAVED], 0);
 
       cheese_camera_change_sink (camera, priv->video_display_bin,
                                  priv->photo_save_bin, priv->video_save_bin);
@@ -290,6 +290,18 @@ cheese_camera_bus_message_cb (GstBus *bu
 }
 
 static void
+cheese_queue_overrun_cb (GstElement * queue, gpointer data)
+{
+  CheeseCamera *camera = CHEESE_CAMERA (data);
+  CheeseCameraPrivate *priv = CHEESE_CAMERA_GET_PRIVATE (camera);
+  g_warning ("Video encoding queue overrun your CPU is too slow or busy\n");
+  g_warning ("priv->signals[CHEESE_SIGNAL_OVERRUN]@%p = %i\n",
+		  &priv->signals[CHEESE_SIGNAL_OVERRUN],
+		  priv->signals[CHEESE_SIGNAL_OVERRUN]);
+  g_signal_emit (camera, priv->signals[CHEESE_SIGNAL_OVERRUN], 0);
+}
+
+static void
 cheese_camera_add_device (CheeseCameraDeviceMonitor *monitor,
                           const gchar               *id,
                           const gchar               *device_file,
@@ -461,6 +473,14 @@ cheese_camera_create_video_display_bin (
   {
     cheese_camera_set_error_element_not_found (error, "queue");
   }
+  else
+  {
+    g_object_set (save_queue, "max-size-buffers", 0, NULL);
+    g_object_set (save_queue, "max-size-bytes", 0, NULL);
+    g_object_set (save_queue, "max-size-time", G_GINT64_CONSTANT(5000000000), NULL);
+  }
+
+  g_signal_connect (save_queue, "overrun", G_CALLBACK (cheese_queue_overrun_cb), camera);
 
   if ((video_display_queue = gst_element_factory_make ("queue", "video_display_queue")) == NULL)
   {
@@ -580,6 +600,15 @@ cheese_camera_create_video_save_bin (Che
   {
     cheese_camera_set_error_element_not_found (error, "queue");
   }
+  else
+  {
+    g_object_set (audio_queue, "max-size-buffers", 0, NULL);
+    g_object_set (audio_queue, "max-size-bytes", 0, NULL);
+    g_object_set (audio_queue, "max-size-time", G_GINT64_CONSTANT(5000000000), NULL);
+  }
+
+  g_signal_connect (audio_queue, "overrun", G_CALLBACK (cheese_queue_overrun_cb), camera);
+
   if ((audio_convert = gst_element_factory_make ("audioconvert", "audio_convert")) == NULL)
   {
     cheese_camera_set_error_element_not_found (error, "audioconvert");
@@ -867,7 +896,7 @@ cheese_camera_force_stop_video_recording
   if (priv->is_recording)
   {
     GST_WARNING ("Cannot cleanly shutdown recording pipeline, forcing");
-    g_signal_emit (camera, camera_signals[VIDEO_SAVED], 0);
+    g_signal_emit (camera, priv->signals[CHEESE_SIGNAL_VIDEO_SAVED], 0);
 
     cheese_camera_change_sink (camera, priv->video_display_bin,
                                priv->photo_save_bin, priv->video_save_bin);
@@ -1038,28 +1067,6 @@ cheese_camera_class_init (CheeseCameraCl
   object_class->get_property = cheese_camera_get_property;
   object_class->set_property = cheese_camera_set_property;
 
-  camera_signals[PHOTO_SAVED] = g_signal_new ("photo-saved", G_OBJECT_CLASS_TYPE (klass),
-                                              G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
-                                              G_STRUCT_OFFSET (CheeseCameraClass, photo_saved),
-                                              NULL, NULL,
-                                              g_cclosure_marshal_VOID__VOID,
-                                              G_TYPE_NONE, 0);
-
-  camera_signals[PHOTO_TAKEN] = g_signal_new ("photo-taken", G_OBJECT_CLASS_TYPE (klass),
-                                              G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
-                                              G_STRUCT_OFFSET (CheeseCameraClass, photo_taken),
-                                              NULL, NULL,
-                                              g_cclosure_marshal_VOID__OBJECT,
-                                              G_TYPE_NONE, 1, GDK_TYPE_PIXBUF);
-
-  camera_signals[VIDEO_SAVED] = g_signal_new ("video-saved", G_OBJECT_CLASS_TYPE (klass),
-                                              G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
-                                              G_STRUCT_OFFSET (CheeseCameraClass, video_saved),
-                                              NULL, NULL,
-                                              g_cclosure_marshal_VOID__VOID,
-                                              G_TYPE_NONE, 0);
-
-
   g_object_class_install_property (object_class, PROP_VIDEO_WINDOW,
                                    g_param_spec_pointer ("video-window",
                                                          NULL,
@@ -1095,6 +1102,34 @@ cheese_camera_init (CheeseCamera *camera
   priv->device_name             = NULL;
   priv->photo_handler_signal_id = 0;
   priv->current_format          = NULL;
+
+  priv->signals[CHEESE_SIGNAL_PHOTO_SAVED] = g_signal_new ("photo-saved", G_OBJECT_TYPE (camera),
+                                              G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+                                              G_STRUCT_OFFSET (CheeseCameraClass, photo_saved),
+                                              NULL, NULL,
+                                              g_cclosure_marshal_VOID__VOID,
+                                              G_TYPE_NONE, 0);
+
+  priv->signals[CHEESE_SIGNAL_PHOTO_TAKEN] = g_signal_new ("photo-taken", G_OBJECT_TYPE (camera),
+                                              G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+                                              G_STRUCT_OFFSET (CheeseCameraClass, photo_taken),
+                                              NULL, NULL,
+                                              g_cclosure_marshal_VOID__OBJECT,
+                                              G_TYPE_NONE, 1, GDK_TYPE_PIXBUF);
+
+  priv->signals[CHEESE_SIGNAL_VIDEO_SAVED] = g_signal_new ("video-saved", G_OBJECT_TYPE (camera),
+                                              G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+                                              G_STRUCT_OFFSET (CheeseCameraClass, video_saved),
+                                              NULL, NULL,
+                                              g_cclosure_marshal_VOID__VOID,
+                                              G_TYPE_NONE, 0);
+
+  priv->signals[CHEESE_SIGNAL_OVERRUN] = g_signal_new ("overrun", G_OBJECT_TYPE (camera),
+                                              G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+                                              G_STRUCT_OFFSET (CheeseCameraClass, overrun),
+                                              NULL, NULL,
+                                              g_cclosure_marshal_VOID__VOID,
+                                              G_TYPE_NONE, 0);
 }
 
 CheeseCamera *
Index: cheese/libcheese/cheese-camera.h
===================================================================
--- cheese.orig/libcheese/cheese-camera.h
+++ cheese/libcheese/cheese-camera.h
@@ -65,6 +65,7 @@ typedef struct
   void (*photo_saved)(CheeseCamera *camera);
   void (*photo_taken)(CheeseCamera *camera, GdkPixbuf *pixbuf);
   void (*video_saved)(CheeseCamera *camera);
+  void (*overrun) (CheeseCamera *webcam);
 } CheeseCameraClass;
 
 enum CheeseCameraError
Index: cheese/src/cheese-window.c
===================================================================
--- cheese.orig/src/cheese-window.c
+++ cheese/src/cheese-window.c
@@ -45,7 +45,6 @@
 #include "cheese-countdown.h"
 #include "cheese-effect-chooser.h"
 #include "eog-thumb-nav.h"
-#include "cheese-no-camera.h"
 #include "cheese-prefs-dialog.h"
 #include "cheese-flash.h"
 #include "cheese-widget-private.h"
@@ -441,6 +440,58 @@ cheese_window_toggle_wide_mode (GtkWidge
   g_object_set (priv->gconf, "gconf_prop_wide_mode", toggled, NULL);
 }
 
+void
+cheese_info_bar_set_text_and_icon (GtkInfoBar  *info_bar,
+                                   const gchar *icon_stock_id,
+                                   const gchar *primary_text,
+                                   const gchar *secondary_text)
+{
+  GtkWidget *content_area;
+  GtkWidget *image;
+  GtkWidget *vbox;
+  gchar     *primary_markup;
+  gchar     *secondary_markup;
+  GtkWidget *primary_label;
+  GtkWidget *secondary_label;
+
+  content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar));
+
+  image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG);
+  gtk_widget_show (image);
+  gtk_box_pack_start (GTK_BOX (content_area), image, FALSE, FALSE, 0);
+  gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0);
+
+  vbox = gtk_vbox_new (FALSE, 6);
+  gtk_widget_show (vbox);
+  gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
+
+  primary_markup = g_strdup_printf ("<b>%s</b>", primary_text);
+  primary_label  = gtk_label_new (primary_markup);
+  g_free (primary_markup);
+  gtk_widget_show (primary_label);
+  gtk_box_pack_start (GTK_BOX (vbox), primary_label, TRUE, TRUE, 0);
+  gtk_label_set_use_markup (GTK_LABEL (primary_label), TRUE);
+  gtk_label_set_line_wrap (GTK_LABEL (primary_label), TRUE);
+  gtk_misc_set_alignment (GTK_MISC (primary_label), 0, 0.5);
+  GTK_WIDGET_SET_FLAGS (primary_label, GTK_CAN_FOCUS);
+  gtk_label_set_selectable (GTK_LABEL (primary_label), TRUE);
+
+  if (secondary_text != NULL)
+  {
+    secondary_markup = g_strdup_printf ("<small>%s</small>",
+                                        secondary_text);
+    secondary_label = gtk_label_new (secondary_markup);
+    g_free (secondary_markup);
+    gtk_widget_show (secondary_label);
+    gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0);
+    GTK_WIDGET_SET_FLAGS (secondary_label, GTK_CAN_FOCUS);
+    gtk_label_set_use_markup (GTK_LABEL (secondary_label), TRUE);
+    gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
+    gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
+    gtk_misc_set_alignment (GTK_MISC (secondary_label), 0, 0.5);
+  }
+}
+
 static void
 cheese_window_photo_saved_cb (CheeseCamera *camera, CheeseWindow *cheese_window)
 {
@@ -489,6 +540,62 @@ cheese_window_selection_changed_cb (GtkI
 }
 
 static void
+cheese_window_set_info_bar (CheeseWindow *cheese_window,
+                            GtkWidget    *info_bar)
+{
+  CheeseWindowPrivate *priv = CHEESE_WINDOW_GET_PRIVATE (cheese_window);
+  if (priv->info_bar == info_bar)
+    return;
+
+  if (priv->info_bar != NULL)
+    gtk_widget_destroy (priv->info_bar);
+
+  priv->info_bar = info_bar;
+
+  if (info_bar == NULL)
+    return;
+
+  gtk_container_add (GTK_CONTAINER (priv->info_bar_alignment), priv->info_bar);
+  gtk_widget_show (GTK_WIDGET (priv->info_bar));
+}
+
+static void
+cheese_window_info_bar_help_response (GtkWidget *widget, gint response_id, CheeseWindow *cheese_window)
+{
+  GError  *error = NULL;
+  gboolean ret;
+
+  if (response_id == GTK_RESPONSE_HELP)
+  {
+    ret = g_app_info_launch_default_for_uri ("ghelp:cheese?faq", NULL, &error);
+
+    if (ret == FALSE)
+    {
+      GtkWidget *d;
+      d = gtk_message_dialog_new (GTK_WINDOW (cheese_window),
+                                  GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                  GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+                                  _("Unable to open help file for Cheese"));
+      gtk_dialog_run (GTK_DIALOG (d));
+      gtk_widget_destroy (d);
+      g_error_free (error);
+    }
+  }
+}
+
+static void
+cheese_window_buffer_overrun_info_bar_response (GtkWidget *widget, gint response_id, CheeseWindow *cheese_window)
+{
+  cheese_window_info_bar_help_response (widget, response_id, cheese_window);
+
+  if (response_id == GTK_RESPONSE_OK)
+  {
+    cheese_window_set_info_bar (cheese_window, NULL);
+  }
+}
+
+
+static void
 cheese_window_thumbnails_changed (GtkTreeModel *model,
                                   CheeseWindow *cheese_window)
 {
@@ -637,33 +744,11 @@ cheese_window_countdown_picture_cb (gpoi
   g_free (photo_filename);
 }
 
-static void
-cheese_window_no_camera_info_bar_response (GtkWidget *widget, gint response_id, CheeseWindow *cheese_window)
-{
-  GError  *error = NULL;
-  gboolean ret;
-
-  if (response_id == GTK_RESPONSE_HELP)
-  {
-    ret = g_app_info_launch_default_for_uri ("ghelp:cheese?faq", NULL, &error);
-
-    if (ret == FALSE)
-    {
-      GtkWidget *d;
-      d = gtk_message_dialog_new (GTK_WINDOW (cheese_window),
-                                  GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-                                  GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
-                                  _("Unable to open help file for Cheese"));
-      gtk_dialog_run (GTK_DIALOG (d));
-      gtk_widget_destroy (d);
-      g_error_free (error);
-    }
-  }
-}
 
-static void
-cheese_window_stop_recording (CheeseWindow *cheese_window)
+static gboolean
+cheese_window_stop_recording (gpointer data)
 {
+  CheeseWindow *cheese_window = data;
   CheeseWindowPrivate *priv = CHEESE_WINDOW_GET_PRIVATE (cheese_window);
   if (priv->recording)
   {
@@ -679,7 +764,9 @@ cheese_window_stop_recording (CheeseWind
 
     cheese_camera_stop_video_recording (priv->camera);
     priv->recording = FALSE;
+    return TRUE;
   }
+  return FALSE;
 }
 
 static gboolean
@@ -730,6 +817,32 @@ cheese_window_escape_key_cb (CheeseWindo
   return TRUE;
 }
 
+static void
+cheese_window_video_overrun_cb (CheeseCamera *camera, CheeseWindow *cheese_window)
+{
+  GtkWidget *info_bar;
+
+  g_warning ("cheese_window_video_overrun_cb \n");
+
+  gdk_threads_enter ();
+  info_bar = gtk_info_bar_new_with_buttons (GTK_STOCK_HELP, GTK_RESPONSE_HELP, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
+  gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar),
+                                 GTK_MESSAGE_WARNING);
+  cheese_info_bar_set_text_and_icon (GTK_INFO_BAR (info_bar),
+                                               "gtk-dialog-error",
+                                               _("Unable to encode video fast enough"),
+                                               _("Please select a lower resolution, close other intensive applications or refer to help."));
+  g_signal_connect (info_bar,
+                    "response",
+                    G_CALLBACK (cheese_window_buffer_overrun_info_bar_response),
+                    cheese_window);
+
+  cheese_window_set_info_bar (cheese_window, info_bar);
+  gdk_threads_leave ();
+
+  g_idle_add(cheese_window_stop_recording, cheese_window);
+}
+
 static gboolean
 cheese_window_take_photo (gpointer data)
 {
@@ -1209,6 +1322,7 @@ on_widget_error (CheeseWidget        *wi
 {
   CheeseWindowPrivate *priv = CHEESE_WINDOW_GET_PRIVATE (window);
   GError *error = NULL;
+  GtkWidget *info_bar;
 
   cheese_widget_get_error (widget, &error);
   g_return_if_fail (error != NULL);
@@ -1216,11 +1330,21 @@ on_widget_error (CheeseWidget        *wi
   /* FIXME: hotplug new devices and hide the info bar */
   gtk_action_group_set_sensitive (priv->actions_prefs, FALSE);
   gtk_action_group_set_sensitive (priv->actions_photo, FALSE);
-  cheese_no_camera_set_info_bar_text_and_icon (GTK_INFO_BAR (priv->info_bar),
+
+  info_bar = gtk_info_bar_new_with_buttons (GTK_STOCK_HELP, GTK_RESPONSE_HELP, NULL);
+  gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar),
+                                 GTK_MESSAGE_WARNING);
+
+  cheese_info_bar_set_text_and_icon(GTK_INFO_BAR (info_bar),
                                                "gtk-dialog-error",
                                                error->message,
                                                _("Please refer to the help for further information."));
-  gtk_widget_show (priv->info_bar);
+  g_signal_connect (info_bar,
+                    "response",
+                    G_CALLBACK (cheese_window_info_bar_help_response),
+                    window);
+
+  cheese_window_set_info_bar (window, info_bar);
 
   g_error_free (error);
 }
@@ -1237,6 +1361,8 @@ on_widget_ready (CheeseWidget        *wi
                     G_CALLBACK (cheese_window_photo_saved_cb), window);
   g_signal_connect (priv->camera, "video-saved",
                     G_CALLBACK (cheese_window_video_saved_cb), window);
+  g_signal_connect (priv->camera, "overrun",
+                    G_CALLBACK (cheese_window_video_overrun_cb), window);
 
   gtk_widget_set_sensitive (GTK_WIDGET (priv->take_picture), TRUE);
   gtk_widget_set_sensitive (GTK_WIDGET (priv->take_picture_fullscreen), TRUE);
@@ -1289,14 +1415,6 @@ cheese_window_init (CheeseWindow *cheese
   setup_widgets_from_builder (cheese_window);
   setup_menubar_and_actions (cheese_window);
 
-  priv->info_bar  = cheese_no_camera_info_bar_new ();
-  gtk_container_add (GTK_CONTAINER (priv->info_bar_alignment), priv->info_bar);
-
-  g_signal_connect (priv->info_bar,
-                    "response",
-                    G_CALLBACK (cheese_window_no_camera_info_bar_response),
-                    cheese_window);
-
   g_signal_connect (G_OBJECT (priv->thewidget), "notify::state",
                     G_CALLBACK (widget_state_change_cb), cheese_window);
 
