diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2011-03-23 11:44:02 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2011-03-23 11:44:02 +0100 |
commit | 6c822e1dedff95eeb64733e8ae0f7554b01bcd17 (patch) | |
tree | 19af6ae5c84a06e400caf7323b94c2882a6baa1d /src/cameras | |
parent | 8c48a8ad1c6153770c24ae2e8a9b0f9efedfc4af (diff) | |
download | uca-6c822e1dedff95eeb64733e8ae0f7554b01bcd17.tar.gz uca-6c822e1dedff95eeb64733e8ae0f7554b01bcd17.tar.bz2 uca-6c822e1dedff95eeb64733e8ae0f7554b01bcd17.tar.xz uca-6c822e1dedff95eeb64733e8ae0f7554b01bcd17.zip |
Implement grab timeout
Diffstat (limited to 'src/cameras')
-rw-r--r-- | src/cameras/pco.c | 13 | ||||
-rw-r--r-- | src/cameras/pf.c | 21 |
2 files changed, 30 insertions, 4 deletions
diff --git a/src/cameras/pco.c b/src/cameras/pco.c index ac2e950..1cad698 100644 --- a/src/cameras/pco.c +++ b/src/cameras/pco.c @@ -75,6 +75,11 @@ static uint32_t uca_pco_set_property(struct uca_camera *cam, enum uca_property_i case UCA_PROP_TIMESTAMP_MODE: return pco_set_timestamp_mode(GET_PCO(cam), *((uint16_t *) data)); + case UCA_PROP_GRAB_TIMEOUT: + if (grabber->set_property(grabber, UCA_GRABBER_TIMEOUT, data) != UCA_NO_ERROR) + return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; + break; + default: return UCA_ERR_PROP_INVALID; } @@ -188,6 +193,14 @@ static uint32_t uca_pco_get_property(struct uca_camera *cam, enum uca_property_i set_void(data, uint32_t, 16); break; + case UCA_PROP_GRAB_TIMEOUT: + { + uint32_t timeout; + cam->grabber->get_property(cam->grabber, UCA_GRABBER_TIMEOUT, &timeout); + set_void(data, uint32_t, timeout); + } + break; + default: return UCA_ERR_PROP_INVALID; } diff --git a/src/cameras/pf.c b/src/cameras/pf.c index 48f2192..0bcf674 100644 --- a/src/cameras/pf.c +++ b/src/cameras/pf.c @@ -70,26 +70,26 @@ static uint32_t uca_pf_set_property(struct uca_camera *cam, enum uca_property_id switch (property) { case UCA_PROP_WIDTH: - if (grabber->set_property(grabber, UCA_GRABBER_WIDTH, (uint32_t *) data) != UCA_NO_ERROR) + if (grabber->set_property(grabber, UCA_GRABBER_WIDTH, data) != UCA_NO_ERROR) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; if (uca_pf_set_uint32_property(token, data, &cam->frame_width) < 0) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; case UCA_PROP_HEIGHT: - if (grabber->set_property(grabber, UCA_GRABBER_HEIGHT, (uint32_t *) data) != UCA_NO_ERROR) + if (grabber->set_property(grabber, UCA_GRABBER_HEIGHT, data) != UCA_NO_ERROR) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; if (uca_pf_set_uint32_property(token, data, &cam->frame_height) < 0) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; case UCA_PROP_X_OFFSET: - if (grabber->set_property(grabber, UCA_GRABBER_OFFSET_X, (uint32_t *) data) != UCA_NO_ERROR) + if (grabber->set_property(grabber, UCA_GRABBER_OFFSET_X, data) != UCA_NO_ERROR) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; case UCA_PROP_Y_OFFSET: - if (grabber->set_property(grabber, UCA_GRABBER_OFFSET_Y, (uint32_t *) data) != UCA_NO_ERROR) + if (grabber->set_property(grabber, UCA_GRABBER_OFFSET_Y, data) != UCA_NO_ERROR) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; @@ -102,6 +102,11 @@ static uint32_t uca_pf_set_property(struct uca_camera *cam, enum uca_property_id return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; + case UCA_PROP_GRAB_TIMEOUT: + if (grabber->set_property(grabber, UCA_GRABBER_TIMEOUT, data) != UCA_NO_ERROR) + return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; + break; + default: return UCA_ERR_PROP_INVALID; } @@ -157,6 +162,14 @@ static uint32_t uca_pf_get_property(struct uca_camera *cam, enum uca_property_id set_void(data, uint32_t, 8); break; + case UCA_PROP_GRAB_TIMEOUT: + { + uint32_t timeout; + cam->grabber->get_property(cam->grabber, UCA_GRABBER_TIMEOUT, &timeout); + set_void(data, uint32_t, timeout); + } + break; + default: return UCA_ERR_PROP_INVALID; } |