summaryrefslogtreecommitdiffstats
path: root/src/cameras
diff options
context:
space:
mode:
Diffstat (limited to 'src/cameras')
-rw-r--r--src/cameras/dummy.c16
-rw-r--r--src/cameras/dummy.h5
-rw-r--r--src/cameras/ipe.c16
-rw-r--r--src/cameras/ipe.h5
-rw-r--r--src/cameras/pco.c24
-rw-r--r--src/cameras/pco.h5
-rw-r--r--src/cameras/pf.c18
-rw-r--r--src/cameras/pf.h5
8 files changed, 41 insertions, 53 deletions
diff --git a/src/cameras/dummy.c b/src/cameras/dummy.c
index dd96688..d71940e 100644
--- a/src/cameras/dummy.c
+++ b/src/cameras/dummy.c
@@ -14,12 +14,12 @@ struct dummy_cam_t {
#define GET_DUMMY(uca) ((struct dummy_cam_t *)(uca->user))
#define set_void(p, type, value) { *((type *) p) = value; }
-static uint32_t uca_dummy_set_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data)
+static uint32_t uca_dummy_set_property(struct uca_camera *cam, enum uca_property_ids property, void *data)
{
return UCA_NO_ERROR;
}
-static uint32_t uca_dummy_get_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data, size_t num)
+static uint32_t uca_dummy_get_property(struct uca_camera *cam, enum uca_property_ids property, void *data, size_t num)
{
switch (property) {
case UCA_PROP_NAME:
@@ -60,13 +60,13 @@ static uint32_t uca_dummy_get_property(struct uca_camera_t *cam, enum uca_proper
return UCA_NO_ERROR;
}
-uint32_t uca_dummy_start_recording(struct uca_camera_t *cam)
+uint32_t uca_dummy_start_recording(struct uca_camera *cam)
{
cam->current_frame = 0;
return UCA_NO_ERROR;
}
-uint32_t uca_dummy_stop_recording(struct uca_camera_t *cam)
+uint32_t uca_dummy_stop_recording(struct uca_camera *cam)
{
return UCA_NO_ERROR;
}
@@ -146,7 +146,7 @@ static void uca_dummy_print_number(struct dummy_cam_t *dummy, int number, int x,
}
}
-uint32_t uca_dummy_grab(struct uca_camera_t *cam, char *buffer)
+uint32_t uca_dummy_grab(struct uca_camera *cam, char *buffer)
{
struct dummy_cam_t *dummy = GET_DUMMY(cam);
dummy->buffer = buffer;
@@ -165,14 +165,14 @@ uint32_t uca_dummy_grab(struct uca_camera_t *cam, char *buffer)
return UCA_NO_ERROR;
}
-static uint32_t uca_dummy_destroy(struct uca_camera_t *cam)
+static uint32_t uca_dummy_destroy(struct uca_camera *cam)
{
return UCA_NO_ERROR;
}
-uint32_t uca_dummy_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
+uint32_t uca_dummy_init(struct uca_camera **cam, struct uca_grabber *grabber)
{
- struct uca_camera_t *uca = (struct uca_camera_t *) malloc(sizeof(struct uca_camera_t));
+ struct uca_camera *uca = (struct uca_camera *) malloc(sizeof(struct uca_camera));
uca->destroy = &uca_dummy_destroy;
uca->set_property = &uca_dummy_set_property;
diff --git a/src/cameras/dummy.h b/src/cameras/dummy.h
index 143bbd1..ebd2d48 100644
--- a/src/cameras/dummy.h
+++ b/src/cameras/dummy.h
@@ -1,9 +1,6 @@
#ifndef __UNIFIED_CAMERA_ACCESS_DUMMY_H
#define __UNIFIED_CAMERA_ACCESS_DUMMY_H
-struct uca_camera_t;
-struct uca_grabber_t;
-
-uint32_t uca_dummy_init(struct uca_camera_t **uca, struct uca_grabber_t *grabber);
+uint32_t uca_dummy_init(struct uca_camera **uca, struct uca_grabber *grabber);
#endif
diff --git a/src/cameras/ipe.c b/src/cameras/ipe.c
index 9f01767..4b3d021 100644
--- a/src/cameras/ipe.c
+++ b/src/cameras/ipe.c
@@ -14,12 +14,12 @@ static void uca_ipe_handle_error(const char *format, ...)
/* Do nothing, we just check errno. */
}
-static uint32_t uca_ipe_set_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data)
+static uint32_t uca_ipe_set_property(struct uca_camera *cam, enum uca_property_ids property, void *data)
{
return UCA_NO_ERROR;
}
-static uint32_t uca_ipe_get_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data, size_t num)
+static uint32_t uca_ipe_get_property(struct uca_camera *cam, enum uca_property_ids property, void *data, size_t num)
{
pcilib_t *handle = GET_HANDLE(cam);
pcilib_register_value_t value = 0;
@@ -78,28 +78,28 @@ static uint32_t uca_ipe_get_property(struct uca_camera_t *cam, enum uca_property
return UCA_NO_ERROR;
}
-static uint32_t uca_ipe_start_recording(struct uca_camera_t *cam)
+static uint32_t uca_ipe_start_recording(struct uca_camera *cam)
{
return UCA_NO_ERROR;
}
-static uint32_t uca_ipe_stop_recording(struct uca_camera_t *cam)
+static uint32_t uca_ipe_stop_recording(struct uca_camera *cam)
{
return UCA_NO_ERROR;
}
-static uint32_t uca_ipe_grab(struct uca_camera_t *cam, char *buffer)
+static uint32_t uca_ipe_grab(struct uca_camera *cam, char *buffer)
{
return UCA_NO_ERROR;
}
-static uint32_t uca_ipe_destroy(struct uca_camera_t *cam)
+static uint32_t uca_ipe_destroy(struct uca_camera *cam)
{
pcilib_close(GET_HANDLE(cam));
return UCA_NO_ERROR;
}
-uint32_t uca_ipe_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
+uint32_t uca_ipe_init(struct uca_camera **cam, struct uca_grabber *grabber)
{
pcilib_model_t model = PCILIB_MODEL_DETECT;
pcilib_t *handle = pcilib_open("/dev/fpga0", model);
@@ -109,7 +109,7 @@ uint32_t uca_ipe_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
pcilib_set_error_handler(&uca_ipe_handle_error, &uca_ipe_handle_error);
model = pcilib_get_model(handle);
- struct uca_camera_t *uca = (struct uca_camera_t *) malloc(sizeof(struct uca_camera_t));
+ struct uca_camera *uca = (struct uca_camera *) malloc(sizeof(struct uca_camera));
/* Camera found, set function pointers... */
uca->destroy = &uca_ipe_destroy;
diff --git a/src/cameras/ipe.h b/src/cameras/ipe.h
index 15ebdea..4fc39bd 100644
--- a/src/cameras/ipe.h
+++ b/src/cameras/ipe.h
@@ -1,9 +1,6 @@
#ifndef __UNIFIED_CAMERA_ACCESS_IPE_H
#define __UNIFIED_CAMERA_ACCESS_IPE_H
-struct uca_camera_t;
-struct uca_grabber_t;
-
-uint32_t uca_ipe_init(struct uca_camera_t **uca, struct uca_grabber_t *grabber);
+uint32_t uca_ipe_init(struct uca_camera **uca, struct uca_grabber *grabber);
#endif
diff --git a/src/cameras/pco.c b/src/cameras/pco.c
index 0c13ca6..1ca16f4 100644
--- a/src/cameras/pco.c
+++ b/src/cameras/pco.c
@@ -12,7 +12,7 @@
#define set_void(p, type, value) { *((type *) p) = (type) value; }
-static uint32_t uca_pco_set_exposure(struct uca_camera_t *cam, uint32_t *exposure)
+static uint32_t uca_pco_set_exposure(struct uca_camera *cam, uint32_t *exposure)
{
uint32_t e, d;
if (pco_get_delay_exposure(GET_PCO(cam), &d, &e) != PCO_NOERROR)
@@ -22,7 +22,7 @@ static uint32_t uca_pco_set_exposure(struct uca_camera_t *cam, uint32_t *exposur
return UCA_NO_ERROR;
}
-static uint32_t uca_pco_set_delay(struct uca_camera_t *cam, uint32_t *delay)
+static uint32_t uca_pco_set_delay(struct uca_camera *cam, uint32_t *delay)
{
uint32_t e, d;
if (pco_get_delay_exposure(GET_PCO(cam), &d, &e) != PCO_NOERROR)
@@ -32,16 +32,16 @@ static uint32_t uca_pco_set_delay(struct uca_camera_t *cam, uint32_t *delay)
return UCA_NO_ERROR;
}
-static uint32_t uca_pco_destroy(struct uca_camera_t *cam)
+static uint32_t uca_pco_destroy(struct uca_camera *cam)
{
pco_set_rec_state(GET_PCO(cam), 0);
pco_destroy(GET_PCO(cam));
return UCA_NO_ERROR;
}
-static uint32_t uca_pco_set_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data)
+static uint32_t uca_pco_set_property(struct uca_camera *cam, enum uca_property_ids property, void *data)
{
- struct uca_grabber_t *grabber = cam->grabber;
+ struct uca_grabber *grabber = cam->grabber;
switch (property) {
case UCA_PROP_WIDTH:
@@ -82,10 +82,10 @@ static uint32_t uca_pco_set_property(struct uca_camera_t *cam, enum uca_property
}
-static uint32_t uca_pco_get_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data, size_t num)
+static uint32_t uca_pco_get_property(struct uca_camera *cam, enum uca_property_ids property, void *data, size_t num)
{
struct pco_edge_t *pco = GET_PCO(cam);
- struct uca_grabber_t *grabber = cam->grabber;
+ struct uca_grabber *grabber = cam->grabber;
switch (property) {
case UCA_PROP_NAME:
@@ -195,7 +195,7 @@ static uint32_t uca_pco_get_property(struct uca_camera_t *cam, enum uca_property
return UCA_NO_ERROR;
}
-uint32_t uca_pco_start_recording(struct uca_camera_t *cam)
+uint32_t uca_pco_start_recording(struct uca_camera *cam)
{
struct pco_edge_t *pco = GET_PCO(cam);
if (pco_arm_camera(pco) != PCO_NOERROR)
@@ -205,14 +205,14 @@ uint32_t uca_pco_start_recording(struct uca_camera_t *cam)
return cam->grabber->acquire(cam->grabber, -1);
}
-uint32_t uca_pco_stop_recording(struct uca_camera_t *cam)
+uint32_t uca_pco_stop_recording(struct uca_camera *cam)
{
if (pco_set_rec_state(GET_PCO(cam), 0) != PCO_NOERROR)
return UCA_ERR_PROP_GENERAL;
return UCA_NO_ERROR;
}
-uint32_t uca_pco_grab(struct uca_camera_t *cam, char *buffer)
+uint32_t uca_pco_grab(struct uca_camera *cam, char *buffer)
{
uint16_t *frame;
uint32_t err = cam->grabber->grab(cam->grabber, (void **) &frame, &cam->current_frame);
@@ -224,7 +224,7 @@ uint32_t uca_pco_grab(struct uca_camera_t *cam, char *buffer)
return UCA_NO_ERROR;
}
-uint32_t uca_pco_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
+uint32_t uca_pco_init(struct uca_camera **cam, struct uca_grabber *grabber)
{
if (grabber == NULL)
return UCA_ERR_CAM_NOT_FOUND;
@@ -239,7 +239,7 @@ uint32_t uca_pco_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
return UCA_ERR_CAM_NOT_FOUND;
}
- struct uca_camera_t *uca = (struct uca_camera_t *) malloc(sizeof(struct uca_camera_t));
+ struct uca_camera *uca = (struct uca_camera *) malloc(sizeof(struct uca_camera));
uca->user = pco;
uca->grabber = grabber;
uca->grabber->asynchronous = true;
diff --git a/src/cameras/pco.h b/src/cameras/pco.h
index 4025002..d8c2b07 100644
--- a/src/cameras/pco.h
+++ b/src/cameras/pco.h
@@ -1,9 +1,6 @@
#ifndef __UNIFIED_CAMERA_ACCESS_PCO_H
#define __UNIFIED_CAMERA_ACCESS_PCO_H
-struct uca_camera_t;
-struct uca_grabber_t;
-
-uint32_t uca_pco_init(struct uca_camera_t **uca, struct uca_grabber_t *grabber);
+uint32_t uca_pco_init(struct uca_camera **uca, struct uca_grabber *grabber);
#endif
diff --git a/src/cameras/pf.c b/src/cameras/pf.c
index 1ea3d3c..7f6ad0f 100644
--- a/src/cameras/pf.c
+++ b/src/cameras/pf.c
@@ -39,9 +39,9 @@ static struct uca_pf_map uca_to_pf[] = {
{ -1, NULL }
};
-static uint32_t uca_pf_set_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data)
+static uint32_t uca_pf_set_property(struct uca_camera *cam, enum uca_property_ids property, void *data)
{
- struct uca_grabber_t *grabber = cam->grabber;
+ struct uca_grabber *grabber = cam->grabber;
TOKEN t = INVALID_TOKEN;
int i = 0;
@@ -107,7 +107,7 @@ static uint32_t uca_pf_set_property(struct uca_camera_t *cam, enum uca_property_
}
-static uint32_t uca_pf_get_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data, size_t num)
+static uint32_t uca_pf_get_property(struct uca_camera *cam, enum uca_property_ids property, void *data, size_t num)
{
TOKEN t; /* You gotta love developers who name types capitalized... */
PFValue value;
@@ -161,17 +161,17 @@ static uint32_t uca_pf_get_property(struct uca_camera_t *cam, enum uca_property_
return UCA_NO_ERROR;
}
-uint32_t uca_pf_start_recording(struct uca_camera_t *cam)
+uint32_t uca_pf_start_recording(struct uca_camera *cam)
{
return cam->grabber->acquire(cam->grabber, -1);
}
-uint32_t uca_pf_stop_recording(struct uca_camera_t *cam)
+uint32_t uca_pf_stop_recording(struct uca_camera *cam)
{
return UCA_NO_ERROR;
}
-uint32_t uca_pf_grab(struct uca_camera_t *cam, char *buffer)
+uint32_t uca_pf_grab(struct uca_camera *cam, char *buffer)
{
uint16_t *frame;
uint32_t err = cam->grabber->grab(cam->grabber, (void **) &frame, &cam->current_frame);
@@ -182,13 +182,13 @@ uint32_t uca_pf_grab(struct uca_camera_t *cam, char *buffer)
return UCA_NO_ERROR;
}
-static uint32_t uca_pf_destroy(struct uca_camera_t *cam)
+static uint32_t uca_pf_destroy(struct uca_camera *cam)
{
pfDeviceClose(0);
return UCA_NO_ERROR;
}
-uint32_t uca_pf_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
+uint32_t uca_pf_init(struct uca_camera **cam, struct uca_grabber *grabber)
{
int num_ports;
if ((grabber == NULL) || (pfPortInit(&num_ports) < 0) || (pfDeviceOpen(0) < 0))
@@ -197,7 +197,7 @@ uint32_t uca_pf_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
/* We could check if a higher baud rate is supported, but... forget about
* it. We don't need high speed configuration. */
- struct uca_camera_t *uca = (struct uca_camera_t *) malloc(sizeof(struct uca_camera_t));
+ struct uca_camera *uca = (struct uca_camera *) malloc(sizeof(struct uca_camera));
uca->grabber = grabber;
uca->grabber->asynchronous = true;
diff --git a/src/cameras/pf.h b/src/cameras/pf.h
index c2cf7ac..d7bf85b 100644
--- a/src/cameras/pf.h
+++ b/src/cameras/pf.h
@@ -1,9 +1,6 @@
#ifndef __UNIFIED_CAMERA_ACCESS_PHOTON_H
#define __UNIFIED_CAMERA_ACCESS_PHOTON_H
-struct uca_camera_t;
-struct uca_grabber_t;
-
-uint32_t uca_pf_init(struct uca_camera_t **uca, struct uca_grabber_t *grabber);
+uint32_t uca_pf_init(struct uca_camera **uca, struct uca_grabber *grabber);
#endif