summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-09 12:25:11 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-09 12:25:11 +0100
commit432d6083dd9cbe50579780c88206733776898e9d (patch)
treedad91a6469dfbe7d39cf946b57244fed602743ec /src
parentcd7590bac56800586c4aadef077d1effe03b00c4 (diff)
downloadlibuca-432d6083dd9cbe50579780c88206733776898e9d.tar.gz
libuca-432d6083dd9cbe50579780c88206733776898e9d.tar.bz2
libuca-432d6083dd9cbe50579780c88206733776898e9d.tar.xz
libuca-432d6083dd9cbe50579780c88206733776898e9d.zip
Set correct exposure. Use µs for all time-related units.
Diffstat (limited to 'src')
-rw-r--r--src/cameras/pf.c12
-rw-r--r--src/uca.c8
2 files changed, 10 insertions, 10 deletions
diff --git a/src/cameras/pf.c b/src/cameras/pf.c
index 65b7b6c..d32f62f 100644
--- a/src/cameras/pf.c
+++ b/src/cameras/pf.c
@@ -97,7 +97,7 @@ static uint32_t uca_pf_set_property(struct uca_camera_t *cam, enum uca_property_
if (pfDevice_SetProperty(0, t, &value) < 0)
return UCA_ERR_PROP_VALUE_OUT_OF_RANGE;
- cam->frame_height = *((uint32_t *) data);
+ cam->frame_height = value.value.i;
break;
case UCA_PROP_X_OFFSET:
@@ -111,10 +111,10 @@ static uint32_t uca_pf_set_property(struct uca_camera_t *cam, enum uca_property_
break;
case UCA_PROP_EXPOSURE:
- if (grabber->set_property(grabber, FG_EXPOSURE, (uint32_t *) data) != UCA_NO_ERROR)
- return UCA_ERR_PROP_VALUE_OUT_OF_RANGE;
-
- value.value.f = (float) *((uint32_t *) data);
+ /* I haven't found a specification but it looks like PF uses milli
+ * seconds. We also by-pass the frame grabber... */
+ value.type = PF_FLOAT;
+ value.value.f = (float) *((uint32_t *) data) / 1000.0;
if (pfDevice_SetProperty(0, t, &value) < 0)
return UCA_ERR_PROP_VALUE_OUT_OF_RANGE;
break;
@@ -145,7 +145,7 @@ static uint32_t uca_pf_get_property(struct uca_camera_t *cam, enum uca_property_
break;
case PF_FLOAT:
- set_void(data, uint32_t, (uint32_t) floor(value.value.f+0.5));
+ set_void(data, uint32_t, (uint32_t) floor((value.value.f * 1000.0)+0.5));
break;
case PF_STRING:
diff --git a/src/uca.c b/src/uca.c
index 8b33d08..3e016d1 100644
--- a/src/uca.c
+++ b/src/uca.c
@@ -54,11 +54,11 @@ static struct uca_property_t property_map[UCA_PROP_LAST+1] = {
{ "Image.Offset.y.Max", uca_pixel, uca_uint32t, uca_read },
{ "Image.Bitdepth", uca_bits, uca_uint32t, uca_read},
{ "Time.Exposure", uca_us, uca_uint32t, uca_readwrite },
- { "Time.Exposure.Min", uca_ns, uca_uint32t, uca_read },
- { "Time.Exposure.Max", uca_ms, uca_uint32t, uca_read },
+ { "Time.Exposure.Min", uca_us, uca_uint32t, uca_read },
+ { "Time.Exposure.Max", uca_us, uca_uint32t, uca_read },
{ "Time.Delay", uca_us, uca_uint32t, uca_readwrite },
- { "Time.Delay.Min", uca_ns, uca_uint32t, uca_read },
- { "Time.Delay.Max", uca_ms, uca_uint32t, uca_read },
+ { "Time.Delay.Min", uca_us, uca_uint32t, uca_read },
+ { "Time.Delay.Max", uca_us, uca_uint32t, uca_read },
{ "Time.Framerate", uca_fps, uca_uint32t, uca_read },
{ "Temperature.Sensor", uca_dc, uca_uint32t, uca_read },
{ "Temperature.Camera", uca_dc, uca_uint32t, uca_read },