r15058 - in /desktop/unstable/cheese/debian: changelog patches/10_fallback_on_failure.patch

sjoerd at users.alioth.debian.org sjoerd at users.alioth.debian.org
Thu Mar 13 09:41:03 UTC 2008


Author: sjoerd
Date: Thu Mar 13 09:41:02 2008
New Revision: 15058

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=15058
Log:
* debian/patches/10_fallback_on_failure.patch:
  + Added. Fallback to videotestsrc if getting information from the video
    device fails

Added:
    desktop/unstable/cheese/debian/patches/10_fallback_on_failure.patch
Modified:
    desktop/unstable/cheese/debian/changelog

Modified: desktop/unstable/cheese/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/cheese/debian/changelog?rev=15058&op=diff
==============================================================================
--- desktop/unstable/cheese/debian/changelog (original)
+++ desktop/unstable/cheese/debian/changelog Thu Mar 13 09:41:02 2008
@@ -11,8 +11,11 @@
   * 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
 
- -- Sjoerd Simons <sjoerd at debian.org>  Thu, 13 Mar 2008 10:31:23 +0100
+ -- Sjoerd Simons <sjoerd at debian.org>  Thu, 13 Mar 2008 10:40:02 +0100
 
 cheese (0.2.4-0ubuntu2) hardy; urgency=low
 

Added: desktop/unstable/cheese/debian/patches/10_fallback_on_failure.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/cheese/debian/patches/10_fallback_on_failure.patch?rev=15058&op=file
==============================================================================
--- desktop/unstable/cheese/debian/patches/10_fallback_on_failure.patch (added)
+++ desktop/unstable/cheese/debian/patches/10_fallback_on_failure.patch Thu Mar 13 09:41:02 2008
@@ -1,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;
+ }




More information about the pkg-gnome-commits mailing list