summaryrefslogtreecommitdiffstats
path: root/src/cameras
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-25 11:31:57 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-25 11:31:57 +0100
commitb32564991609717631b2b3926dccd9db21c28f46 (patch)
tree8ab917c014ddcea753c8b2bd2cf37c712d314dd8 /src/cameras
parent754c7d8ecc74513dc3e4765964dc9ff210e6f7af (diff)
downloaduca-b32564991609717631b2b3926dccd9db21c28f46.tar.gz
uca-b32564991609717631b2b3926dccd9db21c28f46.tar.bz2
uca-b32564991609717631b2b3926dccd9db21c28f46.tar.xz
uca-b32564991609717631b2b3926dccd9db21c28f46.zip
Update property names
Diffstat (limited to 'src/cameras')
-rw-r--r--src/cameras/uca_pco.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/src/cameras/uca_pco.c b/src/cameras/uca_pco.c
index 3effde4..93d50f6 100644
--- a/src/cameras/uca_pco.c
+++ b/src/cameras/uca_pco.c
@@ -60,11 +60,23 @@ static uint32_t uca_pco_set_property(struct uca_t *uca, int32_t property, void *
{
switch (property) {
case UCA_PROP_WIDTH:
- Fg_setParameter(GET_FG(uca), FG_WIDTH, (uint32_t *) data, PORT_A);
+ if (Fg_setParameter(GET_FG(uca), FG_WIDTH, (uint32_t *) data, PORT_A) != FG_OK)
+ return UCA_ERR_PROP_VALUE_OUT_OF_RANGE;
break;
case UCA_PROP_HEIGHT:
- Fg_setParameter(GET_FG(uca), FG_HEIGHT, (uint32_t *) data, PORT_A);
+ if (Fg_setParameter(GET_FG(uca), FG_HEIGHT, (uint32_t *) data, PORT_A) != FG_OK)
+ return UCA_ERR_PROP_VALUE_OUT_OF_RANGE;
+ break;
+
+ case UCA_PROP_X_OFFSET:
+ if (Fg_setParameter(GET_FG(uca), FG_XOFFSET, (uint32_t *) data, PORT_A) != FG_OK)
+ return UCA_ERR_PROP_VALUE_OUT_OF_RANGE;
+ break;
+
+ case UCA_PROP_Y_OFFSET:
+ if (Fg_setParameter(GET_FG(uca), FG_YOFFSET, (uint32_t *) data, PORT_A) != FG_OK)
+ return UCA_ERR_PROP_VALUE_OUT_OF_RANGE;
break;
case UCA_PROP_EXPOSURE:
@@ -93,6 +105,26 @@ static uint32_t uca_pco_get_property(struct uca_t *uca, int32_t property, void *
}
break;
+ case UCA_PROP_WIDTH:
+ if (Fg_getParameter(GET_FG(uca), FG_WIDTH, (uint32_t *) data, PORT_A) != FG_OK)
+ return UCA_ERR_PROP_GENERAL;
+ break;
+
+ case UCA_PROP_HEIGHT:
+ if (Fg_getParameter(GET_FG(uca), FG_HEIGHT, (uint32_t *) data, PORT_A) != FG_OK)
+ return UCA_ERR_PROP_GENERAL;
+ break;
+
+ case UCA_PROP_X_OFFSET:
+ if (Fg_getParameter(GET_FG(uca), FG_XOFFSET, (uint32_t *) data, PORT_A) != FG_OK)
+ return UCA_ERR_PROP_GENERAL;
+ break;
+
+ case UCA_PROP_Y_OFFSET:
+ if (Fg_getParameter(GET_FG(uca), FG_YOFFSET, (uint32_t *) data, PORT_A) != FG_OK)
+ return UCA_ERR_PROP_GENERAL;
+ break;
+
case UCA_PROP_MAX_WIDTH:
{
uint32_t w, h;
@@ -113,6 +145,11 @@ static uint32_t uca_pco_get_property(struct uca_t *uca, int32_t property, void *
return UCA_NO_ERROR;
}
+uint32_t uca_pco_alloc(struct uca_t *uca, uint32_t n_buffers)
+{
+
+}
+
uint32_t uca_pco_init(struct uca_t *uca)
{
uca->user = (struct pco_cam_t *) malloc(sizeof(struct pco_cam_t));
@@ -133,6 +170,7 @@ uint32_t uca_pco_init(struct uca_t *uca)
uca->cam_destroy = &uca_pco_destroy;
uca->cam_set_property = &uca_pco_set_property;
uca->cam_get_property = &uca_pco_get_property;
+ uca->cam_alloc = &uca_pco_alloc;
uca->cam_acquire_image = &uca_pco_acquire_image;
/* Prepare camera for recording */
@@ -160,7 +198,6 @@ uint32_t uca_pco_init(struct uca_t *uca)
/* Yes, we really have to take an image twice as large because we set the
* CameraLink interface to 8-bit 10 Taps, but are actually using 5x16 bits. */
width *= 2;
- height *= 2;
Fg_setParameter(fg, FG_WIDTH, &width, PORT_A);
Fg_setParameter(fg, FG_HEIGHT, &height, PORT_A);