diff options
author | Mohammed Hassan <mohammed.hassan@jolla.com> | 2015-03-06 14:49:20 +0200 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-03-08 16:00:49 -0300 |
commit | d49dbefd6c49193073c6334fd493f6899bf237d2 (patch) | |
tree | 053f5eb0e7362955e1275f00e0e425314db25ac7 /gst/camerabin2 | |
parent | 160df421ea3042aa1f60889c1e4632283137f219 (diff) | |
download | gstreamer-plugins-bad-d49dbefd6c49193073c6334fd493f6899bf237d2.tar.gz |
camerabin: update zoom param spec if video source changes its max-zoom
If the video source happens to allow max-zoom to be greater than our maximum hard coded
value of 10 then the user cannot set anything greater than our maximum specified in the
param spec. We have to update our param spec to prevent glib from capping the value
https://bugzilla.gnome.org/show_bug.cgi?id=745740
Diffstat (limited to 'gst/camerabin2')
-rw-r--r-- | gst/camerabin2/gstcamerabin2.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index e4926446f..5e8681f51 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -1338,10 +1338,18 @@ static void gst_camera_bin_src_notify_max_zoom_cb (GObject * self, GParamSpec * pspec, gpointer user_data) { + GParamSpecFloat *zoom_pspec; GstCameraBin2 *camera = (GstCameraBin2 *) user_data; g_object_get (self, "max-zoom", &camera->max_zoom, NULL); GST_DEBUG_OBJECT (camera, "Max zoom updated to %f", camera->max_zoom); + + /* update zoom pspec */ + zoom_pspec = + G_PARAM_SPEC_FLOAT (g_object_class_find_property (G_OBJECT_GET_CLASS + (G_OBJECT (camera)), "zoom")); + zoom_pspec->maximum = camera->max_zoom; + g_object_notify (G_OBJECT (camera), "max-zoom"); } |