From e99970e82e665cb5668584827af320bc49e27300 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Fri, 25 Feb 2011 16:57:45 +0100 Subject: Use camera rather than frame grabber to determine dimensions --- src/cameras/uca_pco.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3