summaryrefslogtreecommitdiffstats
path: root/src/uca-camera.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-06-29 09:56:26 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-06-29 10:09:06 +0200
commit9551b293504f772cbcbd0e67714a30149738118b (patch)
tree531faae7b7c22e5353c36a63a055a66d347a3bca /src/uca-camera.c
parenta94f1c1a38673a37093f6e3bae7e470807046cbd (diff)
downloaduca-9551b293504f772cbcbd0e67714a30149738118b.tar.gz
uca-9551b293504f772cbcbd0e67714a30149738118b.tar.bz2
uca-9551b293504f772cbcbd0e67714a30149738118b.tar.xz
uca-9551b293504f772cbcbd0e67714a30149738118b.zip
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.
Diffstat (limited to 'src/uca-camera.c')
-rw-r--r--src/uca-camera.c16
1 files changed, 16 insertions, 0 deletions
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",