From 432d6083dd9cbe50579780c88206733776898e9d Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 9 Mar 2011 12:25:11 +0100 Subject: =?UTF-8?q?Set=20correct=20exposure.=20Use=20=C2=B5s=20for=20all?= =?UTF-8?q?=20time-related=20units.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cameras/pf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/cameras/pf.c') 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: -- cgit v1.2.3