summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-25 16:57:45 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-25 16:57:45 +0100
commite99970e82e665cb5668584827af320bc49e27300 (patch)
treed47e8d5ca687a83e02bdf6aa9f858e93e43585ae /src
parent1aa8b1f672dd0d8ac8bbaa97eb7a763cdaa114b3 (diff)
downloaduca-e99970e82e665cb5668584827af320bc49e27300.tar.gz
uca-e99970e82e665cb5668584827af320bc49e27300.tar.bz2
uca-e99970e82e665cb5668584827af320bc49e27300.tar.xz
uca-e99970e82e665cb5668584827af320bc49e27300.zip
Use camera rather than frame grabber to determine dimensions
Diffstat (limited to 'src')
-rw-r--r--src/cameras/uca_pco.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/cameras/uca_pco.c b/src/cameras/uca_pco.c
index 1c189b7..33b09d6 100644
--- a/src/cameras/uca_pco.c
+++ b/src/cameras/uca_pco.c
@@ -99,9 +99,9 @@ static uint32_t uca_pco_get_property(struct uca_t *uca, int32_t property, void *
struct pco_edge_t *pco = GET_PCO(uca);
switch (property) {
- /* FIXME: how to ensure, that data is large enough? */
case UCA_PROP_NAME:
{
+ /* FIXME: how to ensure, that buffer is large enough? */
SC2_Camera_Name_Response name;
if (pco_read_property(pco, GET_CAMERA_NAME, &name, sizeof(name)) == PCO_NOERROR)
strcpy((char *) data, name.szName);
@@ -109,8 +109,11 @@ 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;
+ {
+ int w, h;
+ if (pco_get_actual_size(pco, &w, &h) == PCO_NOERROR)
+ set_void(data, uint32_t, w);
+ }
break;
case UCA_PROP_WIDTH_MIN:
@@ -122,8 +125,11 @@ static uint32_t uca_pco_get_property(struct uca_t *uca, int32_t property, void *
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;
+ {
+ int w, h;
+ if (pco_get_actual_size(pco, &w, &h) == PCO_NOERROR)
+ set_void(data, uint32_t, h);
+ }
break;
case UCA_PROP_HEIGHT_MIN:
@@ -160,6 +166,10 @@ static uint32_t uca_pco_get_property(struct uca_t *uca, int32_t property, void *
set_void(data, uint32_t, pco->description.dwMaxExposureDESC);
break;
+ case UCA_PROP_BITDEPTH:
+ set_void(data, uint8_t, 16);
+ break;
+
default:
return UCA_ERR_PROP_INVALID;
}