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
This commit is contained in:
Mohammed Hassan 2015-03-06 14:49:20 +02:00 committed by Thiago Santos
parent 160df421ea
commit d49dbefd6c

View file

@ -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");
}