summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-08-09 18:12:18 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-08-09 18:12:18 +0200
commitd98e009ad120d77ed0c782b36a09fcf366e299e1 (patch)
tree1f2fde973b89b43c8a86a5b4b22eb10b3f8d32c3
parent5f1a2731f3d6ad16214bd83095f8e1511cf1d76b (diff)
downloaduca-d98e009ad120d77ed0c782b36a09fcf366e299e1.tar.gz
uca-d98e009ad120d77ed0c782b36a09fcf366e299e1.tar.bz2
uca-d98e009ad120d77ed0c782b36a09fcf366e299e1.tar.xz
uca-d98e009ad120d77ed0c782b36a09fcf366e299e1.zip
Some adjustments for IPE camera
-rw-r--r--src/cameras/ipe.c9
-rw-r--r--test/grab.c2
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));