diff -u cheese-2.22.0/debian/changelog cheese-2.22.0/debian/changelog --- cheese-2.22.0/debian/changelog +++ cheese-2.22.0/debian/changelog @@ -1,3 +1,19 @@ +cheese (2.22.0-0ubuntu2) hardy; urgency=low + + * Added the following patches from Debian (LP: #206700) + * debian/patches/00_fix_crash_on_init.patch: + + Added. Fixed crash on intialisation because of running strcmp on NULL. + (From upstream svn) + * debian/patches/10_fallback_on_failure.patch: + + Added. Fallback to videotestsrc if getting information from the video + device fails. + * debian/patches/20_dont_start_pipeline_in_init.patch: + + Added. Don't create the gstreamer pipeline in the Webcam object + initialisation as this is quite bad style. As a nice side-effect this + fixes cheese not using the webcam device set in gconf. + + -- Gary Lasker Tue, 25 Mar 2008 14:06:53 -0400 + cheese (2.22.0-0ubuntu1) hardy; urgency=low * New upstream release (LP: #185669) only in patch2: unchanged: --- cheese-2.22.0.orig/debian/patches/00_fix_crash_on_init.patch +++ cheese-2.22.0/debian/patches/00_fix_crash_on_init.patch @@ -0,0 +1,13 @@ +Index: src/cheese-webcam.c +=================================================================== +--- src/cheese-webcam.c (revision 587) ++++ src/cheese-webcam.c (revision 588) +@@ -579,7 +579,7 @@ + selected_device = 0; + for (i = 1; i < priv->num_webcam_devices ; i++) + { +- if (strcmp (priv->webcam_devices[i].video_device, priv->device_name) == 0) ++ if (g_strcmp0 (priv->webcam_devices[i].video_device, priv->device_name) == 0) + selected_device = i; + } + CheeseWebcamDevice *selected_webcam = &(priv->webcam_devices[selected_device]); only in patch2: unchanged: --- cheese-2.22.0.orig/debian/patches/10_fallback_on_failure.patch +++ cheese-2.22.0/debian/patches/10_fallback_on_failure.patch @@ -0,0 +1,72 @@ +Index: src/cheese-webcam.c +=================================================================== +--- src/cheese-webcam.c (revision 590) ++++ src/cheese-webcam.c (working copy) +@@ -562,11 +562,10 @@ + CheeseWebcamPrivate* priv = CHEESE_WEBCAM_GET_PRIVATE (webcam); + GError *err = NULL; + char *webcam_input; +- ++ + if (priv->num_webcam_devices == 0) + { +- priv->webcam_source_bin = gst_parse_bin_from_description ("videotestsrc name=video_source", +- TRUE, &err); ++ goto fallback; + } + else + { +@@ -588,12 +588,16 @@ + format = &(g_array_index (selected_webcam->video_formats, CheeseVideoFormat, 0)); + for (i = 1; i < selected_webcam->num_video_formats; i++) + { +- ++ + if (g_array_index (selected_webcam->video_formats, CheeseVideoFormat, i).width > format->width) + { + format = &(g_array_index (selected_webcam->video_formats, CheeseVideoFormat, i)); + } + } ++ ++ if (format == NULL) ++ goto fallback; ++ + /* Select the highest framerate up to 30 Hz*/ + framerate_numerator = 1; + framerate_denominator = 1; +@@ -616,19 +620,31 @@ + format->height, + framerate_numerator, + framerate_denominator); +- g_print ("%s\n", webcam_input); +- + priv->webcam_source_bin = gst_parse_bin_from_description (webcam_input, + TRUE, &err); +- g_free (webcam_input); ++ g_free (webcam_input); ++ ++ if ( priv->webcam_source_bin == NULL) ++ goto fallback; + } ++ ++ priv->video_source = gst_bin_get_by_name (GST_BIN (priv->webcam_source_bin), "video_source"); ++ return TRUE; ++ ++fallback: + if (err != NULL) + { + g_error_free (err); ++ err = NULL; ++ } ++ ++ priv->webcam_source_bin = gst_parse_bin_from_description ("videotestsrc name=video_source", ++ TRUE, &err); ++ if (err != NULL) ++ { ++ g_error_free (err); + return FALSE; + } +- +- priv->video_source = gst_bin_get_by_name (GST_BIN (priv->webcam_source_bin), "video_source"); + return TRUE; + } only in patch2: unchanged: --- cheese-2.22.0.orig/debian/patches/20_dont_start_pipeline_in_init.patch +++ cheese-2.22.0/debian/patches/20_dont_start_pipeline_in_init.patch @@ -0,0 +1,68 @@ +Index: src/cheese-window.c +=================================================================== +--- src/cheese-window.c (revision 590) ++++ src/cheese-window.c (working copy) +@@ -1202,6 +1202,8 @@ + cheese_window->webcam = cheese_webcam_new (cheese_window->screen, webcam_device); + g_free (webcam_device); + ++ cheese_webcam_setup (cheese_window->webcam); ++ + g_signal_connect (cheese_window->webcam, "photo-saved", + G_CALLBACK (cheese_window_photo_saved_cb), cheese_window); + g_signal_connect (cheese_window->webcam, "video-saved", +Index: src/cheese-webcam.c +=================================================================== +--- src/cheese-webcam.c (revision 590) ++++ src/cheese-webcam.c (working copy) +@@ -1081,14 +1097,20 @@ + cheese_webcam_init (CheeseWebcam *webcam) + { + CheeseWebcamPrivate* priv = CHEESE_WEBCAM_GET_PRIVATE (webcam); +- gboolean ok; + + priv->is_recording = FALSE; + priv->pipeline_is_playing = FALSE; + priv->photo_filename = NULL; + priv->webcam_devices = NULL; + priv->device_name = NULL; ++} + ++void ++cheese_webcam_setup (CheeseWebcam *webcam) ++{ ++ CheeseWebcamPrivate* priv = CHEESE_WEBCAM_GET_PRIVATE (webcam); ++ gboolean ok = TRUE; ++ + cheese_webcam_detect_webcam_devices (webcam); + cheese_webcam_create_video_display_bin (webcam); + cheese_webcam_create_photo_save_bin (webcam); +@@ -1115,6 +1137,7 @@ + gdk_threads_leave(); + } + ++ + CheeseWebcam* + cheese_webcam_new (GtkWidget* video_window, char *webcam_device_name) + { +@@ -1122,7 +1145,7 @@ + if (webcam_device_name) + { + webcam = g_object_new (CHEESE_TYPE_WEBCAM, "video-window", video_window, +- "device_name", webcam_device_name, NULL); ++ "device-name", webcam_device_name, NULL); + } + else + { +Index: src/cheese-webcam.h +=================================================================== +--- src/cheese-webcam.h (revision 590) ++++ src/cheese-webcam.h (working copy) +@@ -67,6 +67,7 @@ + + GType cheese_webcam_get_type (void); + CheeseWebcam *cheese_webcam_new (GtkWidget *video_window, char *webcam_device_name); ++void cheese_webcam_setup (CheeseWebcam *webcam); + void cheese_webcam_play (CheeseWebcam *webcam); + void cheese_webcam_stop (CheeseWebcam *webcam); + void cheese_webcam_set_effect (CheeseWebcam *webcam, CheeseWebcamEffect effect);