diff --git a/0009-Fix-cheese_camera_device_update_format_table-going-i.patch b/0009-Fix-cheese_camera_device_update_format_table-going-i.patch new file mode 100644 index 0000000..d043654 --- /dev/null +++ b/0009-Fix-cheese_camera_device_update_format_table-going-i.patch @@ -0,0 +1,45 @@ +From 9c2b429ec0b027657c0767103fbbfebbc8a992ed Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 22 Aug 2012 10:02:08 +0200 +Subject: [PATCH 3/4] Fix cheese_camera_device_update_format_table() going + into an infinite loop + +Some devices report a very small min_width / height down to reporting +0x0 as minimum resolution, which causes an infinte loop in +cheese_camera_device_update_format_table(). + +This patch limits the minimum resultion to 160x120, both to fix the +infinite loop issue, and to remove ridiculous resolutions such as +2x2, 5x3, 11x7, 22x15 etc. which are seen in the resolution drop down on +some devices. + +For more details on the infinite loop issue, see: +https://bugzilla.redhat.com/show_bug.cgi?id=850505 + +Signed-off-by: Hans de Goede +--- + libcheese/cheese-camera-device.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/libcheese/cheese-camera-device.c b/libcheese/cheese-camera-device.c +index 9b977a4..653cba9 100644 +--- a/libcheese/cheese-camera-device.c ++++ b/libcheese/cheese-camera-device.c +@@ -296,6 +296,14 @@ cheese_camera_device_update_format_table (CheeseCameraDevice *device) + min_height = gst_value_get_int_range_min (height); + max_height = gst_value_get_int_range_max (height); + ++ /* Some devices report a very small min_width / height down to reporting ++ * 0x0 as minimum resolution, which causes an infinte loop below, limit ++ * these to something reasonable. */ ++ if (min_width < 160) ++ min_width = 160; ++ if (min_height < 120) ++ min_height = 120; ++ + cur_width = min_width; + cur_height = min_height; + +-- +1.7.11.4 + diff --git a/0010-Ensure-width-is-a-multiple-of-8-and-height-a-multipl.patch b/0010-Ensure-width-is-a-multiple-of-8-and-height-a-multipl.patch new file mode 100644 index 0000000..4fd082a --- /dev/null +++ b/0010-Ensure-width-is-a-multiple-of-8-and-height-a-multipl.patch @@ -0,0 +1,73 @@ +From 121fd6f5355b5e56fa21004f030fe02eb1de7ae7 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 22 Aug 2012 10:58:57 +0200 +Subject: [PATCH 4/4] Ensure width is a multiple of 8, and height a multiple + of 2 + +We ask Gstreamer to us an YUV format in the pipeline, by setting the +camera-bins "filter-caps" to "video/x-raw-yuv", and gstreamer demands +of yuv format frames that their width is a multiple of 8, and their height +a multiple of 2. + +Previous to this patch my bttv tvcard lists the following resolutions in +cheese: +924x576 (*) +920x576 +640x480 +462x288 (*) +460x288 (*) +320x240 +231x144 (*) +230x144 (*) +160x120 + +Where all the ones marked with an asterisk don't work. + +After this patch the list is: +920x576 +640x480 +456x288 +320x240 +224x144 +160x120 + +And all work. + +Signed-off-by: Hans de Goede +--- + libcheese/cheese-camera-device.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/libcheese/cheese-camera-device.c b/libcheese/cheese-camera-device.c +index 653cba9..370abff 100644 +--- a/libcheese/cheese-camera-device.c ++++ b/libcheese/cheese-camera-device.c +@@ -313,8 +313,10 @@ cheese_camera_device_update_format_table (CheeseCameraDevice *device) + { + CheeseVideoFormat *format = g_slice_new0 (CheeseVideoFormat); + +- format->width = cur_width; +- format->height = cur_height; ++ /* Gstreamer wants resolutions for YUV formats where the width is ++ * a multiple of 8, and the height is a multiple of 2 */ ++ format->width = cur_width & ~7; ++ format->height = cur_height & ~1; + + cheese_camera_device_add_format (device, format); + +@@ -328,8 +330,10 @@ cheese_camera_device_update_format_table (CheeseCameraDevice *device) + { + CheeseVideoFormat *format = g_slice_new0 (CheeseVideoFormat); + +- format->width = cur_width; +- format->height = cur_height; ++ /* Gstreamer wants resolutions for YUV formats where the width is ++ * a multiple of 8, and the height is a multiple of 2 */ ++ format->width = cur_width & ~7; ++ format->height = cur_height & ~1; + + cheese_camera_device_add_format (device, format); + +-- +1.7.11.4 + diff --git a/cheese.spec b/cheese.spec index 25d52f3..63e4ede 100644 --- a/cheese.spec +++ b/cheese.spec @@ -1,7 +1,7 @@ Name: cheese Epoch: 2 Version: 3.4.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Application for taking pictures and movies from a webcam Group: Amusements/Graphics @@ -26,6 +26,9 @@ Patch6: 0006-cheese-thumb-view-Don-t-add-0-sized-files-to-the-thu.patch Patch7: 0007-cheese-thumb-view-Don-t-set-columns-to-5000-in-horiz.patch # https://bugzilla.gnome.org/show_bug.cgi?id=678447 Patch8: 0008-cheese-optimize-encoding.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=850505 +Patch9: 0009-Fix-cheese_camera_device_update_format_table-going-i.patch +Patch10: 0010-Ensure-width-is-a-multiple-of-8-and-height-a-multipl.patch BuildRequires: gtk3-devel >= 3.0.0 BuildRequires: gstreamer-devel >= 0.10.23 @@ -91,6 +94,8 @@ for writing applications that require a webcam display widget. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 +%patch10 -p1 %build @@ -166,6 +171,10 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_datadir}/gir-1.0/Cheese-3.0.gir %changelog +* Wed Aug 22 2012 Hans de Goede - 2:3.4.2-4 +- Fix cheese crashing on tvcards which report they can capture 0x0 as + minimum resolution (rhbz#850505) + * Tue Jun 19 2012 Hans de Goede - 2:3.4.2-3 - Reduce camerabin pipeline creation time (rhbz#797188, gnome#677731) - Don't add 0 byte sized files to the thumb-view (rhbz#830166, gnome#677735)