[0.11] gst-plugins-bad: camerabin2: Check zoom notify callback from camera-source
Wim Taymans
wtay at kemper.freedesktop.org
Mon Sep 26 13:32:34 PDT 2011
Module: gst-plugins-bad
Branch: 0.11
Commit: 00e635e78676fd6680d2a0789dcad77e61c25d54
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=00e635e78676fd6680d2a0789dcad77e61c25d54
Author: Thiago Santos <thiago.sousa.santos at collabora.co.uk>
Date: Mon Sep 12 16:50:10 2011 -0300
camerabin2: Check zoom notify callback from camera-source
Camerabin2 has a zoom property that is simply proxied to its
internal camera-source element. This patch makes camerabin2 listen
to 'notify' signals from it so it can update its zoom property value
when camera-source changes its zoom as a side-effect of another operation
or because the user set the zoom directly to it, instead of doing
it from camerabin2.
---
gst/camerabin2/gstcamerabin2.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c
index 1caa164..e554d5b 100644
--- a/gst/camerabin2/gstcamerabin2.c
+++ b/gst/camerabin2/gstcamerabin2.c
@@ -1152,6 +1152,17 @@ gst_camera_bin_src_notify_max_zoom_cb (GObject * self, GParamSpec * pspec,
g_object_notify (G_OBJECT (camera), "max-zoom");
}
+static void
+gst_camera_bin_src_notify_zoom_cb (GObject * self, GParamSpec * pspec,
+ gpointer user_data)
+{
+ GstCameraBin2 *camera = (GstCameraBin2 *) user_data;
+
+ g_object_get (self, "zoom", &camera->zoom, NULL);
+ GST_DEBUG_OBJECT (camera, "Zoom updated to %f", camera->zoom);
+ g_object_notify (G_OBJECT (camera), "zoom");
+}
+
static gboolean
gst_camera_bin_image_src_buffer_probe (GstPad * pad, GstBuffer * buf,
gpointer data)
@@ -1495,6 +1506,8 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera)
"preview-caps", camera->preview_caps, "preview-filter",
camera->preview_filter, NULL);
}
+ g_signal_connect (G_OBJECT (camera->src), "notify::zoom",
+ (GCallback) gst_camera_bin_src_notify_zoom_cb, camera);
g_object_set (camera->src, "zoom", camera->zoom, NULL);
g_signal_connect (G_OBJECT (camera->src), "notify::max-zoom",
(GCallback) gst_camera_bin_src_notify_max_zoom_cb, camera);
More information about the gstreamer-commits
mailing list