Update to 3.11.3

This commit is contained in:
Richard Hughes 2014-01-14 10:03:34 +00:00
parent 34c5c38b01
commit f0f8a452f7
15 changed files with 7 additions and 941 deletions

1
.gitignore vendored
View File

@ -49,3 +49,4 @@ cheese-2.31.1.tar.bz2
/cheese-3.10.0.tar.xz
/cheese-3.10.1.tar.xz
/cheese-3.11.1.tar.xz
/cheese-3.11.3.tar.xz

View File

@ -1,87 +0,0 @@
From 65027bed3ef54b18534e7f3a552bb7275df48b33 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 6 Aug 2013 14:50:00 +0200
Subject: [PATCH 01/11] cheese-window: Allow changing effects while shooting /
recording a video
There is no technical reason to disable the effect selector while shooting
a video. Likewise there is no technical reason to disallow start / stop
recording / shooting, or changing mode when the effect selector is change.
Removing these unnecessary limitations simplifies the code, and allows users
to change effects while recording a video.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/cheese-application.vala | 25 +++----------------------
src/cheese-window.vala | 4 ----
2 files changed, 3 insertions(+), 26 deletions(-)
diff --git a/src/cheese-application.vala b/src/cheese-application.vala
index 253e57c..0b6689f 100644
--- a/src/cheese-application.vala
+++ b/src/cheese-application.vala
@@ -369,17 +369,8 @@ public class Cheese.Application : Gtk.Application
switch (new_state)
{
case Gst.State.PLAYING:
- if (effects.state.get_boolean ())
- {
- mode.set_enabled (false);
- shoot.set_enabled (false);
- }
- else
- {
- mode.set_enabled (true);
- shoot.set_enabled (true);
- }
-
+ mode.set_enabled (true);
+ shoot.set_enabled (true);
effects.set_enabled (true);
main_window.camera_state_change_playing ();
@@ -492,17 +483,7 @@ public class Cheese.Application : Gtk.Application
{
return_if_fail (value != null);
- var state = value.get_boolean ();
-
- var shoot = this.lookup_action ("shoot") as SimpleAction;
- var mode = this.lookup_action ("mode") as SimpleAction;
-
- // Effects selection and shooting/mode changes are mutually exclusive.
- shoot.set_enabled (!state);
- mode.set_enabled (!state);
-
- main_window.set_effects (state);
-
+ main_window.set_effects (value.get_boolean ());
action.set_state (value);
}
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index 4585a66..dd8fbfc 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -379,8 +379,6 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
{
var mode = this.application.lookup_action ("mode") as SimpleAction;
mode.set_enabled (true);
- var effects = this.application.lookup_action ("effects") as SimpleAction;
- effects.set_enabled (true);
var preferences = this.application.lookup_action ("preferences") as SimpleAction;
preferences.set_enabled (true);
}
@@ -392,8 +390,6 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
{
var mode = this.application.lookup_action ("mode") as SimpleAction;
mode.set_enabled (false);
- var effects = this.application.lookup_action ("effects") as SimpleAction;
- effects.set_enabled (false);
var preferences = this.application.lookup_action ("preferences") as SimpleAction;
preferences.set_enabled (false);
}
--
1.8.3.1

View File

@ -1,87 +0,0 @@
From 09c6b1c1f17ad20c87a3bee7c4665bb6ef34a211 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 22 Aug 2012 10:32:08 +0200
Subject: [PATCH 2/4] Setup vp8enc in a way suitable for realtime encoding
Note that upstream has nacked this patch wanting to fix it instead by
using a realtime vp8enc preset, and teaching vp8enc to automatically pick
a number of threads when threads == 0, see:
https://bugzilla.gnome.org/show_bug.cgi?id=678447
Although that would indeed be better, unfortunately code for neither exists
atm, so for now we carry this patch in Fedora, since it makes the difference
between making recordings in cheese working or not working.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
libcheese/cheese-camera.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index af073f3..d41a669 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -32,6 +32,7 @@
#include <clutter-gst/clutter-gst.h>
#include <gst/gst.h>
#include <X11/Xlib.h>
+#include <unistd.h>
#include "cheese-camera.h"
#include "cheese-camera-device.h"
@@ -444,6 +445,7 @@ cheese_camera_set_video_recording (CheeseCamera *camera, GError **error)
CheeseCameraPrivate *priv = camera->priv;
GstElement *video_enc;
GstElement *mux;
+ int n_threads;
g_return_if_fail (error == NULL || *error == NULL);
@@ -453,11 +455,18 @@ cheese_camera_set_video_recording (CheeseCamera *camera, GError **error)
return;
}
g_object_set (priv->camerabin, "video-encoder", video_enc, NULL);
- /* Use a preset, or set some reasonable defaults. */
- if (!gst_preset_load_preset (GST_PRESET (video_enc), "Profile Realtime"))
- {
- g_object_set (G_OBJECT (video_enc), "max-latency", 1, "speed", 2, NULL);
- }
+
+ /* Since we do realtime encoding setup the encoder for speed without
+ sacrificing too much quality */
+ g_object_set (G_OBJECT (video_enc), "max-latency", 1, NULL);
+ g_object_set (G_OBJECT (video_enc), "speed", 6, NULL);
+#ifdef _SC_NPROCESSORS_ONLN
+ n_threads = sysconf (_SC_NPROCESSORS_ONLN); /* includes hyper-threading */
+ n_threads = MIN (n_threads, 64);
+#else
+ n_threads = 3;
+#endif
+ g_object_set (G_OBJECT (video_enc), "threads", n_threads, NULL);
if ((mux = gst_element_factory_make ("webmmux", "webmmux")) == NULL)
{
@@ -692,6 +701,7 @@ cheese_camera_play (CheeseCamera *camera)
{
CheeseCameraPrivate *priv;
CheeseCameraDevice *device;
+ GObject *video_enc;
GstCaps *caps;
g_return_if_fail (CHEESE_IS_CAMERA (camera));
@@ -714,6 +724,12 @@ cheese_camera_play (CheeseCamera *camera)
g_signal_emit_by_name (priv->camerabin, "set-video-resolution-fps",
priv->current_format->width,
priv->current_format->height, 0, 1, 0);
+ if (priv->current_format->width >= 1280 &&
+ priv->current_format->height >= 720)
+ {
+ g_object_get (priv->camerabin, "video-encoder", &video_enc, NULL);
+ g_object_set (video_enc, "token-parts", 2, NULL);
+ }
}
gst_caps_unref (caps);
--
1.7.11.4

View File

@ -1,89 +0,0 @@
From e898276f5fd5c4748766748340fd2cde898ca2e3 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 18 Jun 2013 09:05:19 +0200
Subject: [PATCH 02/11] cheese-window: Add cancel_running_action () method
And use it to stop recording / the photo countdown when we get an error
while either one is active.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/cheese-window.vala | 47 +++++++++++++++++++++++++++++++----------------
1 file changed, 31 insertions(+), 16 deletions(-)
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index dd8fbfc..e117ec2 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -717,6 +717,34 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
}
/**
+ * Cancel the current action (if any)
+ */
+ private bool cancel_running_action ()
+ {
+ if ((current_countdown != null && current_countdown.running) ||
+ is_bursting || is_recording)
+ {
+ action_cancelled = true;
+ switch (current_mode)
+ {
+ case MediaMode.PHOTO:
+ current_countdown.stop ();
+ finish_countdown_callback ();
+ break;
+ case MediaMode.BURST:
+ toggle_photo_bursting (false);
+ break;
+ case MediaMode.VIDEO:
+ toggle_video_recording (false);
+ break;
+ }
+ action_cancelled = false;
+ return true;
+ }
+ return false;
+ }
+
+ /**
* Cancel the current activity if the escape key is pressed.
*
* @param event the key event, to check which key was pressed
@@ -729,23 +757,9 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
key = Gdk.keyval_name (event.keyval);
if (strcmp (key, "Escape") == 0)
{
- if ((current_countdown != null && current_countdown.running) || is_bursting || is_recording)
+ if (cancel_running_action())
{
- action_cancelled = true;
- switch (current_mode)
- {
- case MediaMode.PHOTO:
- current_countdown.stop ();
- finish_countdown_callback ();
- break;
- case MediaMode.BURST:
- toggle_photo_bursting (false);
- break;
- case MediaMode.VIDEO:
- toggle_video_recording (false);
- break;
- }
- action_cancelled = false;
+ return false;
}
else if (is_effects_selector_active)
{
@@ -1147,6 +1161,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
*/
public void camera_state_change_null ()
{
+ cancel_running_action();
if (!error_layer.visible)
{
show_error (_("There was an error playing video from the webcam"));
--
1.8.3.1

View File

@ -1,90 +0,0 @@
From 6ddb9d4fd4ccf98028c83b924705f66753a16524 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 18 Jun 2013 11:14:16 +0200
Subject: [PATCH 03/11] cheese-preferences: Add camera_changed () method
This centralizes camera-change handling, and adds a check for their being
no camera removing a whole bunch of glib Critical messages being printed
when cheese is started without a camera.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/cheese-preferences.vala | 34 +++++++++++++++++++++++++---------
1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index f04660a..44e3547 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -128,6 +128,28 @@ public class Cheese.PreferencesDialog : GLib.Object
}
/**
+ * Update resolution list and save the current camera to settings.
+ */
+ private void camera_changed ()
+ {
+ Cheese.CameraDevice device, iter_device;
+ TreeIter iter;
+
+ device = camera.get_selected_device ();
+ if (device == null)
+ return;
+ settings.set_string ("camera", device.get_device_node ());
+ setup_resolutions_for_device (device);
+
+ for (bool next = camera_model.get_iter_first (out iter); next;
+ next = camera_model.iter_next (ref iter)) {
+ camera_model.get (iter, 1, out iter_device, -1);
+ if (iter_device == device)
+ source_combo.set_active_iter (iter);
+ }
+ }
+
+ /**
* Initialize and populate the camera device combo box model.
*/
private void initialize_camera_devices ()
@@ -140,8 +162,7 @@ public class Cheese.PreferencesDialog : GLib.Object
devices.foreach(add_camera_device);
- settings.set_string ("camera", camera.get_selected_device ().get_device_node ());
- setup_resolutions_for_device (camera.get_selected_device ());
+ camera_changed ();
}
/**
@@ -227,8 +248,7 @@ public class Cheese.PreferencesDialog : GLib.Object
combo.model.get (iter, 1, out dev);
camera.set_device_by_device_node (dev.get_device_node ());
camera.switch_camera_device ();
- setup_resolutions_for_device (camera.get_selected_device ());
- settings.set_string ("camera", dev.get_device_node ());
+ camera_changed ();
}
/**
@@ -474,8 +494,7 @@ public class Cheese.PreferencesDialog : GLib.Object
}
}
- settings.set_string ("camera", camera.get_selected_device ().get_device_node ());
- setup_resolutions_for_device (camera.get_selected_device ());
+ camera_changed ();
}
/**
@@ -496,9 +515,6 @@ public class Cheese.PreferencesDialog : GLib.Object
0, dev.get_name () + " (" + dev.get_device_node () + ")",
1, dev);
- if (camera.get_selected_device ().get_device_node () == dev.get_device_node ())
- source_combo.set_active_iter (iter);
-
if (camera_model.iter_n_children (null) > 1)
source_combo.sensitive = true;
}
--
1.8.3.1

View File

@ -1,44 +0,0 @@
From e3480dd3e55665e9e48a39a74fd7ee4e56bc0736 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 18 Jun 2013 11:38:05 +0200
Subject: [PATCH 04/11] cheese_camera_get_camera_devices: Allow calling before
cheese_camera_setup()
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
libcheese/cheese-camera.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index ab5490d..de066af 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -363,6 +363,9 @@ cheese_camera_detect_camera_devices (CheeseCamera *camera)
{
CheeseCameraPrivate *priv = camera->priv;
+ if (priv->monitor)
+ return; /* Camera devices already detected */
+
priv->num_camera_devices = 0;
priv->camera_devices = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
@@ -1649,13 +1652,11 @@ cheese_camera_setup (CheeseCamera *camera, const gchar *uuid, GError **error)
GPtrArray *
cheese_camera_get_camera_devices (CheeseCamera *camera)
{
- CheeseCameraPrivate *priv;
-
g_return_val_if_fail (CHEESE_IS_CAMERA (camera), NULL);
- priv = camera->priv;
+ cheese_camera_detect_camera_devices (camera);
- return g_ptr_array_ref (priv->camera_devices);
+ return g_ptr_array_ref (camera->priv->camera_devices);
}
/**
--
1.8.3.1

View File

@ -1,131 +0,0 @@
From 27d41d89a35c3c6b25f5c908d05c3365721e09bc Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 18 Jun 2013 11:40:41 +0200
Subject: [PATCH 05/11] cheese: Move camera_setup to cheese-preferences
cheese-preferences already keeps track of which cameras there are and is in
control of selecting camera resolution and the source-device. This patch also
makes it control of start / stop, thereby logical grouping all camera-control
code in a single place.
Having all camera control code in a single place makes dealing with various
hotplug issues a lot easier.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/cheese-application.vala | 20 ++++----------------
src/cheese-preferences.vala | 24 ++++++++++++++++++++++--
src/vapi/cheese-common.vapi | 2 +-
3 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/src/cheese-application.vala b/src/cheese-application.vala
index 0b6689f..aa62a2e 100644
--- a/src/cheese-application.vala
+++ b/src/cheese-application.vala
@@ -158,8 +158,10 @@ public class Cheese.Application : Gtk.Application
main_window.key_press_event.connect (on_webcam_key_pressed);
main_window.show ();
- setup_camera ();
+ create_camera ();
preferences_dialog = new PreferencesDialog (camera);
+ preferences_dialog.camera_error.connect (main_window.show_error);
+ preferences_dialog.camera_play ();
var preferences = this.lookup_action ("preferences");
preferences.notify["enabled"].connect (on_preferences_enabled);
this.add_window (main_window);
@@ -267,7 +269,7 @@ public class Cheese.Application : Gtk.Application
/**
* Setup the camera listed in GSettings.
*/
- public void setup_camera ()
+ public void create_camera ()
{
var effects = this.lookup_action ("effects") as SimpleAction;
var mode = this.lookup_action ("mode") as SimpleAction;
@@ -281,19 +283,6 @@ public class Cheese.Application : Gtk.Application
settings.get_int ("photo-x-resolution"),
settings.get_int ("photo-y-resolution"));
- try
- {
- camera.setup (device);
- }
- catch (Error err)
- {
- video_preview.hide ();
- message ("Error during camera setup: %s\n", err.message);
- main_window.show_error (err.message);
-
- return;
- }
-
double value;
value = settings.get_double ("brightness");
@@ -322,7 +311,6 @@ public class Cheese.Application : Gtk.Application
camera.state_flags_changed.connect (on_camera_state_flags_changed);
main_window.set_camera (camera);
- camera.play ();
}
/**
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index 44e3547..a73bb46 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -111,6 +111,28 @@ public class Cheese.PreferencesDialog : GLib.Object
}
/**
+ * Signal raised when there is an error with the camera device
+ */
+ public signal void camera_error (string? error);
+
+ /**
+ * Start playing video from the camera
+ */
+ public void camera_play ()
+ {
+ try
+ {
+ camera.setup (null);
+ camera.play ();
+ camera_changed ();
+ }
+ catch (Error err)
+ {
+ camera_error (err.message);
+ }
+ }
+
+ /**
* Set up combo box cell renderers.
*/
private void setup_combo_box_models ()
@@ -161,8 +183,6 @@ public class Cheese.PreferencesDialog : GLib.Object
source_combo.sensitive = false;
devices.foreach(add_camera_device);
-
- camera_changed ();
}
/**
diff --git a/src/vapi/cheese-common.vapi b/src/vapi/cheese-common.vapi
index 26e12a2..cd8a71c 100644
--- a/src/vapi/cheese-common.vapi
+++ b/src/vapi/cheese-common.vapi
@@ -49,7 +49,7 @@ namespace Cheese
public void toggle_effects_pipeline (bool active);
public void connect_effect_texture (Cheese.Effect effect, Clutter.Texture texture);
public void set_video_format (Cheese.VideoFormat format);
- public void setup (string udi) throws GLib.Error;
+ public void setup (string? udi) throws GLib.Error;
public void start_video_recording (string filename);
public void stop ();
public void stop_video_recording ();
--
1.8.3.1

View File

@ -1,108 +0,0 @@
From a1805cadf3e6f7396a323c26e391cd91c28c829f Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 18 Jun 2013 11:59:55 +0200
Subject: [PATCH 06/11] cheese: Properly deal with going from 0 -> 1 devices
Before this patch cheese showed a "No device found" message when started
without any devices connected, and would keep showing this after the user
plugged in a webcam. The new cam also could not be selected from the
preferences dialog.
After this patch cheese will automatically switch to showing video from a
newly plugged in webcam (when it had no devices before).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/cheese-application.vala | 1 +
src/cheese-preferences.vala | 28 +++++++++++++++++++++++++---
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/src/cheese-application.vala b/src/cheese-application.vala
index aa62a2e..fbb1145 100644
--- a/src/cheese-application.vala
+++ b/src/cheese-application.vala
@@ -368,6 +368,7 @@ public class Cheese.Application : Gtk.Application
mode.set_enabled (false);
shoot.set_enabled (false);
+ preferences_dialog.camera_stop ();
main_window.camera_state_change_null ();
break;
default:
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index a73bb46..06929f5 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -24,6 +24,8 @@ using Gtk;
public class Cheese.PreferencesDialog : GLib.Object
{
private Cheese.Camera camera;
+ private bool camera_is_setup;
+ private bool camera_is_playing;
private GLib.Settings settings;
@@ -122,8 +124,16 @@ public class Cheese.PreferencesDialog : GLib.Object
{
try
{
- camera.setup (null);
- camera.play ();
+ if (!camera_is_setup)
+ {
+ camera.setup (null);
+ camera_is_setup = true;
+ }
+ if (!camera_is_playing)
+ {
+ camera.play ();
+ camera_is_playing = true;
+ }
camera_changed ();
}
catch (Error err)
@@ -133,6 +143,14 @@ public class Cheese.PreferencesDialog : GLib.Object
}
/**
+ * Call this when the gstreamer pipe transitions to NULL
+ */
+ public void camera_stop ()
+ {
+ camera_is_playing = false;
+ }
+
+ /**
* Set up combo box cell renderers.
*/
private void setup_combo_box_models ()
@@ -268,7 +286,7 @@ public class Cheese.PreferencesDialog : GLib.Object
combo.model.get (iter, 1, out dev);
camera.set_device_by_device_node (dev.get_device_node ());
camera.switch_camera_device ();
- camera_changed ();
+ camera_play ();
}
/**
@@ -529,6 +547,7 @@ public class Cheese.PreferencesDialog : GLib.Object
{
TreeIter iter;
Cheese.CameraDevice dev = (Cheese.CameraDevice) device;
+ bool was_empty = camera_model.iter_n_children (null) == 0;
camera_model.append (out iter);
camera_model.set (iter,
@@ -537,6 +556,9 @@ public class Cheese.PreferencesDialog : GLib.Object
if (camera_model.iter_n_children (null) > 1)
source_combo.sensitive = true;
+
+ if (was_empty)
+ source_combo.set_active_iter (iter);
}
/**
--
1.8.3.1

View File

@ -1,56 +0,0 @@
From 2a27acbbb6786e8a9b35e1c483ceb9dc5b097839 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 18 Jun 2013 13:45:38 +0200
Subject: [PATCH 07/11] cheese: Avoid unnecessary calls to
switch_camera_device()
And thus avoid stopping and restarting the stream for no reason.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/cheese-preferences.vala | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index 06929f5..723a916 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -26,6 +26,7 @@ public class Cheese.PreferencesDialog : GLib.Object
private Cheese.Camera camera;
private bool camera_is_setup;
private bool camera_is_playing;
+ private string camera_device_node;
private GLib.Settings settings;
@@ -178,7 +179,8 @@ public class Cheese.PreferencesDialog : GLib.Object
device = camera.get_selected_device ();
if (device == null)
return;
- settings.set_string ("camera", device.get_device_node ());
+ camera_device_node = device.get_device_node ();
+ settings.set_string ("camera", camera_device_node);
setup_resolutions_for_device (device);
for (bool next = camera_model.get_iter_first (out iter); next;
@@ -281,10 +283,16 @@ public class Cheese.PreferencesDialog : GLib.Object
TreeIter iter;
Cheese.CameraDevice dev;
+ string dev_node;
combo.get_active_iter (out iter);
combo.model.get (iter, 1, out dev);
- camera.set_device_by_device_node (dev.get_device_node ());
+ dev_node = dev.get_device_node ();
+
+ if (dev_node == camera_device_node)
+ return;
+
+ camera.set_device_by_device_node (dev_node);
camera.switch_camera_device ();
camera_play ();
}
--
1.8.3.1

View File

@ -1,30 +0,0 @@
From e0bf5c088e7d438b3f64cd9ceeee639a03bf484a Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 18 Jun 2013 14:01:45 +0200
Subject: [PATCH 08/11] on_camera_update_num_camera_devices: Remove unnecessary
camera_changed() call
If the camera is actually changed then camera_changed already gets called
from either camera_play() or on_source_change().
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/cheese-preferences.vala | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index 723a916..c46a1a5 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -539,8 +539,6 @@ public class Cheese.PreferencesDialog : GLib.Object
remove_camera_device (iter, old_device, active_device);
}
}
-
- camera_changed ();
}
/**
--
1.8.3.1

View File

@ -1,72 +0,0 @@
From edaf892e8fdcf2ceb956e8dc0a41c928c3fff13f Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 19 Jun 2013 16:47:41 +0200
Subject: [PATCH 09/11] cheese-preferences: Simplify remove_camera_device
Now that we cache the device-node for the active camera, remove_camera_device
and its callers can be simplified.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/cheese-preferences.vala | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index c46a1a5..6e0bbd5 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -506,12 +506,6 @@ public class Cheese.PreferencesDialog : GLib.Object
TreeIter iter;
camera_model.get_iter_first (out iter);
- // Combobox active element.
- TreeIter active_iter;
- Cheese.CameraDevice active_device;
- source_combo.get_active_iter (out active_iter);
- camera_model.get (active_iter, 1, out active_device, -1);
-
// Find which device was removed.
bool device_removed = false;
devices.foreach ((device) =>
@@ -523,7 +517,7 @@ public class Cheese.PreferencesDialog : GLib.Object
// Found the device that was removed.
if (strcmp (old_device.device_node, new_device.device_node) != 0)
{
- remove_camera_device (iter, new_device, active_device);
+ remove_camera_device (iter, new_device);
device_removed = true;
// Remember, this is from the anonymous function!
return;
@@ -536,7 +530,7 @@ public class Cheese.PreferencesDialog : GLib.Object
{
Cheese.CameraDevice old_device;
camera_model.get (iter, 1, out old_device, -1);
- remove_camera_device (iter, old_device, active_device);
+ remove_camera_device (iter, old_device);
}
}
}
@@ -571,16 +565,15 @@ public class Cheese.PreferencesDialog : GLib.Object
* Remove the supplied camera device from the device combo box model.
*
* @param iter the iterator of the device to remove
- * @param device_node the device to remove from the combo box model
- * @param active_device_node the currently-active camera device
+ * @param device the device to remove from the combo box model
*/
- private void remove_camera_device (TreeIter iter, Cheese.CameraDevice device_node,
- Cheese.CameraDevice active_device_node)
+ private void remove_camera_device (TreeIter iter,
+ Cheese.CameraDevice device)
{
unowned GLib.PtrArray devices = camera.get_camera_devices ();
// Check if the camera that we want to remove, is the active one
- if (strcmp (device_node.device_node, active_device_node.device_node) == 0)
+ if (device.device_node == camera_device_node)
{
if (devices.len > 0)
set_new_available_camera_device (iter);
--
1.8.3.1

View File

@ -1,66 +0,0 @@
From 0c841182b61efe48e98c6d2dea1f8c7ab7f464ef Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 19 Jun 2013 17:29:28 +0200
Subject: [PATCH 10/11] cheese-preferences: Cleanly handle going from 1 -> 0
devices
Cleanly handle going from 1 -> 0 devices and going from 1 -> 0 -> 1 devices.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/cheese-preferences.vala | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index 6e0bbd5..fc72435 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -278,13 +278,13 @@ public class Cheese.PreferencesDialog : GLib.Object
[CCode (instance_pos = -1)]
public void on_source_change (Gtk.ComboBox combo)
{
- // TODO: Handle going from 1 to 0 devices, cleanly!
- return_if_fail (camera.num_camera_devices > 0);
-
TreeIter iter;
Cheese.CameraDevice dev;
string dev_node;
+ if (combo.get_active () == -1)
+ return;
+
combo.get_active_iter (out iter);
combo.model.get (iter, 1, out dev);
dev_node = dev.get_device_node ();
@@ -570,16 +570,20 @@ public class Cheese.PreferencesDialog : GLib.Object
private void remove_camera_device (TreeIter iter,
Cheese.CameraDevice device)
{
- unowned GLib.PtrArray devices = camera.get_camera_devices ();
-
- // Check if the camera that we want to remove, is the active one
- if (device.device_node == camera_device_node)
+ if (camera.num_camera_devices == 0) /* Last camera gone? */
{
- if (devices.len > 0)
- set_new_available_camera_device (iter);
- else
- this.dialog.hide();
+ ListStore resolution_model = new ListStore (2, typeof (string),
+ typeof (Cheese.VideoFormat));
+ photo_resolution_combo.model = resolution_model;
+ video_resolution_combo.model = resolution_model;
+ camera_device_node = "";
+ camera_error(_("No device found"));
}
+ else if (device.device_node == camera_device_node)
+ {
+ set_new_available_camera_device (iter);
+ }
+
camera_model.remove (iter);
if (camera_model.iter_n_children (null) <= 1)
--
1.8.3.1

View File

@ -1,48 +0,0 @@
From 82d8c27242efcf40612edaccc47c37a79aeaf6c8 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 3 Sep 2013 15:39:49 +0200
Subject: [PATCH 11/11] cheese-window: Disable effect switching buttons on
webcam error
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/cheese-window.vala | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index e117ec2..8e31611 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -1027,9 +1027,11 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
var effects_next = this.lookup_action ("effects-next") as SimpleAction;
var effects_previous = this.lookup_action ("effects-previous") as SimpleAction;
- effects_next.set_enabled (is_effects_selector_active
+ effects_next.set_enabled (!error_layer.visible
+ && is_effects_selector_active
&& current_effects_page != effects_manager.effects.length () / EFFECTS_PER_PAGE);
- effects_previous.set_enabled (is_effects_selector_active
+ effects_previous.set_enabled (!error_layer.visible
+ && is_effects_selector_active
&& current_effects_page != 0);
}
@@ -1148,6 +1150,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
public void camera_state_change_playing ()
{
show_error (null);
+ setup_effects_page_switch_sensitivity ();
Effect effect = effects_manager.get_effect (settings.get_string ("selected-effect"));
if (effect != null)
@@ -1166,6 +1169,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
{
show_error (_("There was an error playing video from the webcam"));
}
+ setup_effects_page_switch_sensitivity ();
}
/**
--
1.8.3.1

View File

@ -1,6 +1,6 @@
Name: cheese
Epoch: 2
Version: 3.11.1
Version: 3.11.3
Release: 1%{?dist}
Summary: Application for taking pictures and movies from a webcam
@ -9,22 +9,6 @@ License: GPLv2+
URL: http://projects.gnome.org/cheese/
#VCS: git:git://git.gnome.org/cheese
Source0: http://download.gnome.org/sources/cheese/3.11/%{name}-%{version}.tar.xz
# https://bugzilla.gnome.org/show_bug.cgi?id=678447
# Patch2: 0002-Setup-vp8enc-in-a-way-suitable-for-realtime-encoding.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=707387
Patch1: 0001-cheese-window-Allow-changing-effects-while-shooting-.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=603612
Patch2: 0002-cheese-window-Add-cancel_running_action-method.patch
Patch3: 0003-cheese-preferences-Add-camera_changed-method.patch
Patch4: 0004-cheese_camera_get_camera_devices-Allow-calling-befor.patch
Patch5: 0005-cheese-Move-camera_setup-to-cheese-preferences.patch
Patch6: 0006-cheese-Properly-deal-with-going-from-0-1-devices.patch
Patch7: 0007-cheese-Avoid-unnecessary-calls-to-switch_camera_devi.patch
Patch8: 0008-on_camera_update_num_camera_devices-Remove-unnecessa.patch
Patch9: 0009-cheese-preferences-Simplify-remove_camera_device.patch
Patch10: 0010-cheese-preferences-Cleanly-handle-going-from-1-0-dev.patch
Patch11: 0011-cheese-window-Disable-effect-switching-buttons-on-we.patch
BuildRequires: gtk3-devel >= 3.0.0
BuildRequires: gstreamer1-devel
@ -81,18 +65,6 @@ for writing applications that require a webcam display widget.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%build
%configure --disable-static
@ -142,10 +114,8 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%doc AUTHORS README
%{_bindir}/cheese
%{_datadir}/applications/cheese.desktop
%{_datadir}/cheese
%{_datadir}/icons/hicolor/*/apps/cheese.png
%{_datadir}/icons/hicolor/*/actions/*.png
%{_datadir}/icons/hicolor/scalable/actions/*.svg
%{_datadir}/appdata/cheese.appdata.xml
%{_mandir}/man1/cheese.1.gz
%files -f %{name}.lang libs
@ -165,6 +135,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%{_datadir}/gir-1.0/Cheese-3.0.gir
%changelog
* Tue Jan 14 2014 Richard Hughes <rhughes@redhat.com> - 2:3.11.3-1
- Update to 3.11.3
* Wed Oct 30 2013 Richard Hughes <rhughes@redhat.com> - 2:3.11.1-1
- Update to 3.11.1

View File

@ -1 +1 @@
aa1cf37b54d032f6ecedcbdfc50fbacb cheese-3.11.1.tar.xz
14a32c6e5d3e3d5ea8b7a7144a83516a cheese-3.11.3.tar.xz