From 9551b293504f772cbcbd0e67714a30149738118b Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Fri, 29 Jun 2012 09:56:26 +0200 Subject: Fix LU-15: Broken ROI image This fix contains two changes: 1. We check that passed ROI requests are multiples of possible ROI steps as provided by the camera. If this is not the case, the request is ignored and a warning issued. 2. We added two new base properties ROI_WIDTH_MULTIPLIER and ROI_HEIGHT_MULTIPLIER that expose this information to client programs. --- src/uca-camera.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/uca-camera.c') diff --git a/src/uca-camera.c b/src/uca-camera.c index 9fa1c2c..1bf4e75 100644 --- a/src/uca-camera.c +++ b/src/uca-camera.c @@ -97,6 +97,8 @@ const gchar *uca_camera_props[N_BASE_PROPERTIES] = { "roi-y0", "roi-width", "roi-height", + "roi-width-multiplier", + "roi-height-multiplier", "has-streaming", "has-camram-recording", "transfer-asynchronously", @@ -262,6 +264,20 @@ static void uca_camera_class_init(UcaCameraClass *klass) 1, G_MAXUINT, 1, G_PARAM_READWRITE); + camera_properties[PROP_ROI_WIDTH_MULTIPLIER] = + g_param_spec_uint(uca_camera_props[PROP_ROI_WIDTH_MULTIPLIER], + "Horizontal ROI multiplier", + "Minimum possible step size of horizontal ROI", + 1, G_MAXUINT, 1, + G_PARAM_READABLE); + + camera_properties[PROP_ROI_HEIGHT_MULTIPLIER] = + g_param_spec_uint(uca_camera_props[PROP_ROI_HEIGHT_MULTIPLIER], + "Vertical ROI multiplier", + "Minimum possible step size of vertical ROI", + 1, G_MAXUINT, 1, + G_PARAM_READABLE); + camera_properties[PROP_EXPOSURE_TIME] = g_param_spec_double(uca_camera_props[PROP_EXPOSURE_TIME], "Exposure time in seconds", -- cgit v1.2.3