diff options
author | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-02-24 09:50:34 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-02-24 09:50:34 +0100 |
commit | 4d49de7e136a80819740f6aaada9c5881b083a50 (patch) | |
tree | bf5951b49249c4c06ce9e14b5295e303040130aa | |
parent | 7f2740af499405f31313941758818d8191b3578f (diff) | |
download | uca-4d49de7e136a80819740f6aaada9c5881b083a50.tar.gz uca-4d49de7e136a80819740f6aaada9c5881b083a50.tar.bz2 uca-4d49de7e136a80819740f6aaada9c5881b083a50.tar.xz uca-4d49de7e136a80819740f6aaada9c5881b083a50.zip |
Handle properties correctly for pco.edge
-rw-r--r-- | src/cameras/uca_pco.c | 26 | ||||
-rw-r--r-- | src/uca.h | 4 |
2 files changed, 18 insertions, 12 deletions
diff --git a/src/cameras/uca_pco.c b/src/cameras/uca_pco.c index 3155376..3effde4 100644 --- a/src/cameras/uca_pco.c +++ b/src/cameras/uca_pco.c @@ -26,22 +26,26 @@ static uint32_t uca_pco_set_bitdepth(struct uca_t *uca, uint8_t *bitdepth) static uint32_t uca_pco_set_exposure(struct uca_t *uca, uint32_t *exposure) { uint32_t e, d; - pco_get_delay_exposure(GET_PCO(uca), &d, &e); - pco_set_delay_exposure(GET_PCO(uca), d, *exposure); - return 0; + if (pco_get_delay_exposure(GET_PCO(uca), &d, &e) != PCO_NOERROR) + return UCA_ERR_PROP_GENERAL; + if (pco_set_delay_exposure(GET_PCO(uca), d, *exposure) != PCO_NOERROR) + return UCA_ERR_PROP_GENERAL; + return UCA_NO_ERROR; } static uint32_t uca_pco_set_delay(struct uca_t *uca, uint32_t *delay) { uint32_t e, d; - pco_get_delay_exposure(GET_PCO(uca), &d, &e); - pco_set_delay_exposure(GET_PCO(uca), *delay, e); - return 0; + if (pco_get_delay_exposure(GET_PCO(uca), &d, &e) != PCO_NOERROR) + return UCA_ERR_PROP_GENERAL; + if (pco_set_delay_exposure(GET_PCO(uca), *delay, e) != PCO_NOERROR) + return UCA_ERR_PROP_GENERAL; + return UCA_NO_ERROR; } static uint32_t uca_pco_acquire_image(struct uca_t *uca, void *buffer) { - return 0; + return UCA_NO_ERROR; } static uint32_t uca_pco_destroy(struct uca_t *uca) @@ -49,6 +53,7 @@ static uint32_t uca_pco_destroy(struct uca_t *uca) Fg_FreeGrabber(GET_FG(uca)); pco_destroy(GET_PCO(uca)); free(uca->user); + return UCA_NO_ERROR; } static uint32_t uca_pco_set_property(struct uca_t *uca, int32_t property, void *data) @@ -63,11 +68,10 @@ static uint32_t uca_pco_set_property(struct uca_t *uca, int32_t property, void * break; case UCA_PROP_EXPOSURE: - uca_pco_set_exposure(uca, (uint32_t *) data); - break; + return uca_pco_set_exposure(uca, (uint32_t *) data); - case UCA_PROP_FRAMERATE: - break; + case UCA_PROP_DELAY: + return uca_pco_set_delay(uca, (uint32_t *) data); default: return UCA_ERR_PROP_INVALID; @@ -69,7 +69,9 @@ const char* uca_get_property_name(int32_t property_id); #define UCA_NO_ERROR 0 #define UCA_ERR_INIT_NOT_FOUND 1 /**< camera probing or initialization failed */ -#define UCA_ERR_PROP_INVALID 1 /**< the requested property is not supported by the camera */ +#define UCA_ERR_PROP_INVALID 2 /**< the requested property is not supported by the camera */ +#define UCA_ERR_PROP_GENERAL 3 /**< error occured reading/writing the property */ + /* The property IDs must start with 0 and must be continuous. Whenever this * library is released, the IDs must not change to guarantee binary compatibility! */ |