From d98e009ad120d77ed0c782b36a09fcf366e299e1 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 9 Aug 2011 18:12:18 +0200 Subject: Some adjustments for IPE camera --- src/cameras/ipe.c | 9 ++++++++- test/grab.c | 2 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cameras/ipe.c b/src/cameras/ipe.c index 2993409..c398350 100644 --- a/src/cameras/ipe.c +++ b/src/cameras/ipe.c @@ -29,6 +29,10 @@ static uint32_t uca_ipe_get_property(struct uca_camera_priv *cam, enum uca_prope strncpy((char *) data, "IPE PCIe based on CMOSIS CMV2000", num); break; + case UCA_PROP_BITDEPTH: + set_void(data, uint32_t, 16); + break; + case UCA_PROP_WIDTH: set_void(data, uint32_t, 2048); break; @@ -91,11 +95,12 @@ static uint32_t uca_ipe_stop_recording(struct uca_camera_priv *cam) static uint32_t uca_ipe_grab(struct uca_camera_priv *cam, char *buffer, void *meta_data) { pcilib_t *handle = cam->user; - size_t size = 0; + size_t size = cam->frame_width * cam->frame_height * sizeof(uint16_t); void *data = NULL; if (pcilib_grab(handle, PCILIB_EVENTS_ALL, &size, &data, PCILIB_TIMEOUT_TRIGGER)) return UCA_ERR_CAMERA; memcpy(buffer, data, size); + free(data); return UCA_NO_ERROR; } @@ -139,6 +144,8 @@ uint32_t uca_ipe_init(struct uca_camera_priv **cam, struct uca_grabber_priv *gra uca->grab = &uca_ipe_grab; uca->register_callback = &uca_ipe_register_callback; + uca->frame_width = 2048; + uca->frame_height = 1088; uca->user = handle; *cam = uca; diff --git a/test/grab.c b/test/grab.c index e614e03..9f86069 100644 --- a/test/grab.c +++ b/test/grab.c @@ -25,8 +25,6 @@ int main(int argc, char *argv[]) val = 1; handle_error(uca_cam_set_property(cam, UCA_PROP_GRAB_SYNCHRONOUS, &val)); - val = 0; - handle_error(uca_cam_set_property(cam, UCA_PROP_HOTPIXEL_CORRECTION, &val)); uint32_t width, height, bits; handle_error(uca_cam_get_property(cam, UCA_PROP_WIDTH, &width, 0)); -- cgit v1.2.3