diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2011-04-26 17:20:03 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2011-04-26 17:20:03 +0200 |
commit | bf265341fea65c31992497338eccfab5bfdf217f (patch) | |
tree | 6937b7e1383a44014256833545e7b79a22a878a2 /src/cameras | |
parent | 56d716f47fac506ccaca0cdd934dc2bc1ee6644a (diff) | |
download | uca-bf265341fea65c31992497338eccfab5bfdf217f.tar.gz uca-bf265341fea65c31992497338eccfab5bfdf217f.tar.bz2 uca-bf265341fea65c31992497338eccfab5bfdf217f.tar.xz uca-bf265341fea65c31992497338eccfab5bfdf217f.zip |
Make uca_camera really private and thus breaks API
Diffstat (limited to 'src/cameras')
-rw-r--r-- | src/cameras/dummy.c | 24 | ||||
-rw-r--r-- | src/cameras/dummy.h | 2 | ||||
-rw-r--r-- | src/cameras/ipe.c | 18 | ||||
-rw-r--r-- | src/cameras/ipe.h | 2 | ||||
-rw-r--r-- | src/cameras/pco.c | 28 | ||||
-rw-r--r-- | src/cameras/pco.h | 2 | ||||
-rw-r--r-- | src/cameras/pf.c | 22 | ||||
-rw-r--r-- | src/cameras/pf.h | 2 |
8 files changed, 50 insertions, 50 deletions
diff --git a/src/cameras/dummy.c b/src/cameras/dummy.c index 2bb0400..0283989 100644 --- a/src/cameras/dummy.c +++ b/src/cameras/dummy.c @@ -106,7 +106,7 @@ static void uca_dummy_print_number(char *buffer, int number, int x, int y, int w } } -static void uca_dummy_memcpy(struct uca_camera *cam, char *buffer) +static void uca_dummy_memcpy(struct uca_camera_priv *cam, char *buffer) { /* print current frame number */ unsigned int number = cam->current_frame; @@ -127,7 +127,7 @@ static __suseconds_t uca_dummy_time_diff(struct timeval *start, struct timeval * static void *uca_dummy_grab_thread(void *arg) { - struct uca_camera *cam = ((struct uca_camera *) arg); + struct uca_camera_priv *cam = ((struct uca_camera_priv *) arg); struct dummy_cam *dc = GET_DUMMY(cam); assert(dc->frame_rate > 0); @@ -156,7 +156,7 @@ static void *uca_dummy_grab_thread(void *arg) /* * --- interface implementations ---------------------------------------------- */ -static uint32_t uca_dummy_set_property(struct uca_camera *cam, enum uca_property_ids property, void *data) +static uint32_t uca_dummy_set_property(struct uca_camera_priv *cam, enum uca_property_ids property, void *data) { uint32_t err = UCA_ERR_CAMERA | UCA_ERR_PROP; if (cam->state == UCA_CAM_RECORDING) @@ -182,7 +182,7 @@ static uint32_t uca_dummy_set_property(struct uca_camera *cam, enum uca_property return UCA_NO_ERROR; } -static uint32_t uca_dummy_get_property(struct uca_camera *cam, enum uca_property_ids property, void *data, size_t num) +static uint32_t uca_dummy_get_property(struct uca_camera_priv *cam, enum uca_property_ids property, void *data, size_t num) { switch (property) { case UCA_PROP_NAME: @@ -223,7 +223,7 @@ static uint32_t uca_dummy_get_property(struct uca_camera *cam, enum uca_property return UCA_NO_ERROR; } -static uint32_t uca_dummy_start_recording(struct uca_camera *cam) +static uint32_t uca_dummy_start_recording(struct uca_camera_priv *cam) { if (cam->callback != NULL) { #ifdef HAVE_PTHREADS @@ -239,7 +239,7 @@ static uint32_t uca_dummy_start_recording(struct uca_camera *cam) return UCA_NO_ERROR; } -static uint32_t uca_dummy_stop_recording(struct uca_camera *cam) +static uint32_t uca_dummy_stop_recording(struct uca_camera_priv *cam) { struct dummy_cam *dc = GET_DUMMY(cam); if (cam->callback != NULL) { @@ -251,7 +251,7 @@ static uint32_t uca_dummy_stop_recording(struct uca_camera *cam) return UCA_NO_ERROR; } -static uint32_t uca_dummy_register_callback(struct uca_camera *cam, uca_cam_grab_callback cb, void *user) +static uint32_t uca_dummy_register_callback(struct uca_camera_priv *cam, uca_cam_grab_callback cb, void *user) { if (cam->callback == NULL) { cam->callback = cb; @@ -263,7 +263,7 @@ static uint32_t uca_dummy_register_callback(struct uca_camera *cam, uca_cam_grab return UCA_NO_ERROR; } -static uint32_t uca_dummy_grab(struct uca_camera *cam, char *buffer, void *meta_data) +static uint32_t uca_dummy_grab(struct uca_camera_priv *cam, char *buffer, void *meta_data) { if (cam->callback != NULL) return UCA_ERR_CAMERA | UCA_ERR_CALLBACK | UCA_ERR_ALREADY_REGISTERED; @@ -273,7 +273,7 @@ static uint32_t uca_dummy_grab(struct uca_camera *cam, char *buffer, void *meta_ return UCA_NO_ERROR; } -static uint32_t uca_dummy_destroy(struct uca_camera *cam) +static uint32_t uca_dummy_destroy(struct uca_camera_priv *cam) { struct dummy_cam *dc = GET_DUMMY(cam); free(dc->buffer); @@ -281,14 +281,14 @@ static uint32_t uca_dummy_destroy(struct uca_camera *cam) return UCA_NO_ERROR; } -static uint32_t uca_dummy_ignore(struct uca_camera *cam) +static uint32_t uca_dummy_ignore(struct uca_camera_priv *cam) { return UCA_NO_ERROR; } -uint32_t uca_dummy_init(struct uca_camera **cam, struct uca_grabber *grabber) +uint32_t uca_dummy_init(struct uca_camera_priv **cam, struct uca_grabber_priv *grabber) { - struct uca_camera *uca = uca_cam_new(); + struct uca_camera_priv *uca = uca_cam_new(); 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 ebd2d48..afc6af4 100644 --- a/src/cameras/dummy.h +++ b/src/cameras/dummy.h @@ -1,6 +1,6 @@ #ifndef __UNIFIED_CAMERA_ACCESS_DUMMY_H #define __UNIFIED_CAMERA_ACCESS_DUMMY_H -uint32_t uca_dummy_init(struct uca_camera **uca, struct uca_grabber *grabber); +uint32_t uca_dummy_init(struct uca_camera_priv **uca, struct uca_grabber_priv *grabber); #endif diff --git a/src/cameras/ipe.c b/src/cameras/ipe.c index 1032f54..a2fa6f6 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 *cam, enum uca_property_ids property, void *data) +static uint32_t uca_ipe_set_property(struct uca_camera_priv *cam, enum uca_property_ids property, void *data) { return UCA_NO_ERROR; } -static uint32_t uca_ipe_get_property(struct uca_camera *cam, enum uca_property_ids property, void *data, size_t num) +static uint32_t uca_ipe_get_property(struct uca_camera_priv *cam, enum uca_property_ids property, void *data, size_t num) { pcilib_t *handle = GET_HANDLE(cam); pcilib_register_value_t value = 0; @@ -78,22 +78,22 @@ static uint32_t uca_ipe_get_property(struct uca_camera *cam, enum uca_property_i return UCA_NO_ERROR; } -static uint32_t uca_ipe_start_recording(struct uca_camera *cam) +static uint32_t uca_ipe_start_recording(struct uca_camera_priv *cam) { return UCA_NO_ERROR; } -static uint32_t uca_ipe_stop_recording(struct uca_camera *cam) +static uint32_t uca_ipe_stop_recording(struct uca_camera_priv *cam) { return UCA_NO_ERROR; } -static uint32_t uca_ipe_grab(struct uca_camera *cam, char *buffer, void *meta_data) +static uint32_t uca_ipe_grab(struct uca_camera_priv *cam, char *buffer, void *meta_data) { return UCA_NO_ERROR; } -static uint32_t uca_ipe_register_callback(struct uca_camera *cam, uca_cam_grab_callback cb, void *user) +static uint32_t uca_ipe_register_callback(struct uca_camera_priv *cam, uca_cam_grab_callback cb, void *user) { if (cam->callback == NULL) { cam->callback = cb; @@ -103,13 +103,13 @@ static uint32_t uca_ipe_register_callback(struct uca_camera *cam, uca_cam_grab_c return UCA_ERR_CAMERA | UCA_ERR_CALLBACK | UCA_ERR_ALREADY_REGISTERED; } -static uint32_t uca_ipe_destroy(struct uca_camera *cam) +static uint32_t uca_ipe_destroy(struct uca_camera_priv *cam) { pcilib_close(GET_HANDLE(cam)); return UCA_NO_ERROR; } -uint32_t uca_ipe_init(struct uca_camera **cam, struct uca_grabber *grabber) +uint32_t uca_ipe_init(struct uca_camera_priv **cam, struct uca_grabber_priv *grabber) { pcilib_model_t model = PCILIB_MODEL_DETECT; pcilib_t *handle = pcilib_open("/dev/fpga0", model); @@ -119,7 +119,7 @@ uint32_t uca_ipe_init(struct uca_camera **cam, struct uca_grabber *grabber) pcilib_set_error_handler(&uca_ipe_handle_error, &uca_ipe_handle_error); model = pcilib_get_model(handle); - struct uca_camera *uca = uca_cam_new(); + struct uca_camera_priv *uca = uca_cam_new(); /* Camera found, set function pointers... */ uca->destroy = &uca_ipe_destroy; diff --git a/src/cameras/ipe.h b/src/cameras/ipe.h index 4fc39bd..c911402 100644 --- a/src/cameras/ipe.h +++ b/src/cameras/ipe.h @@ -1,6 +1,6 @@ #ifndef __UNIFIED_CAMERA_ACCESS_IPE_H #define __UNIFIED_CAMERA_ACCESS_IPE_H -uint32_t uca_ipe_init(struct uca_camera **uca, struct uca_grabber *grabber); +uint32_t uca_ipe_init(struct uca_camera_priv **uca, struct uca_grabber_priv *grabber); #endif diff --git a/src/cameras/pco.c b/src/cameras/pco.c index f6efd81..9de6467 100644 --- a/src/cameras/pco.c +++ b/src/cameras/pco.c @@ -18,7 +18,7 @@ typedef struct pco_desc { #define uca_set_void(p, type, value) { *((type *) p) = (type) value; } -static uint32_t uca_pco_set_exposure(struct uca_camera *cam, uint32_t *exposure) +static uint32_t uca_pco_set_exposure(struct uca_camera_priv *cam, uint32_t *exposure) { uint32_t err = UCA_ERR_CAMERA | UCA_ERR_PROP; uint32_t e, d; @@ -29,7 +29,7 @@ static uint32_t uca_pco_set_exposure(struct uca_camera *cam, uint32_t *exposure) return UCA_NO_ERROR; } -static uint32_t uca_pco_set_delay(struct uca_camera *cam, uint32_t *delay) +static uint32_t uca_pco_set_delay(struct uca_camera_priv *cam, uint32_t *delay) { uint32_t err = UCA_ERR_CAMERA | UCA_ERR_PROP; uint32_t e, d; @@ -40,7 +40,7 @@ static uint32_t uca_pco_set_delay(struct uca_camera *cam, uint32_t *delay) return UCA_NO_ERROR; } -static uint32_t uca_pco_destroy(struct uca_camera *cam) +static uint32_t uca_pco_destroy(struct uca_camera_priv *cam) { pco_set_rec_state(GET_PCO(cam), 0); pco_destroy(GET_PCO(cam)); @@ -48,9 +48,9 @@ static uint32_t uca_pco_destroy(struct uca_camera *cam) return UCA_NO_ERROR; } -static uint32_t uca_pco_set_property(struct uca_camera *cam, enum uca_property_ids property, void *data) +static uint32_t uca_pco_set_property(struct uca_camera_priv *cam, enum uca_property_ids property, void *data) { - struct uca_grabber *grabber = cam->grabber; + struct uca_grabber_priv *grabber = cam->grabber; struct pco_desc *pco_d = GET_PCO_DESC(cam); uint32_t err = UCA_ERR_CAMERA | UCA_ERR_PROP; @@ -97,10 +97,10 @@ static uint32_t uca_pco_set_property(struct uca_camera *cam, enum uca_property_i } -static uint32_t uca_pco_get_property(struct uca_camera *cam, enum uca_property_ids property, void *data, size_t num) +static uint32_t uca_pco_get_property(struct uca_camera_priv *cam, enum uca_property_ids property, void *data, size_t num) { struct pco_edge *pco = GET_PCO(cam); - struct uca_grabber *grabber = cam->grabber; + struct uca_grabber_priv *grabber = cam->grabber; switch (property) { case UCA_PROP_NAME: @@ -225,7 +225,7 @@ static uint32_t uca_pco_get_property(struct uca_camera *cam, enum uca_property_i return UCA_NO_ERROR; } -static uint32_t uca_pco_start_recording(struct uca_camera *cam) +static uint32_t uca_pco_start_recording(struct uca_camera_priv *cam) { uint32_t err = UCA_ERR_CAMERA | UCA_ERR_INIT; if (cam->state == UCA_CAM_RECORDING) @@ -241,7 +241,7 @@ static uint32_t uca_pco_start_recording(struct uca_camera *cam) return cam->grabber->acquire(cam->grabber, -1); } -static uint32_t uca_pco_stop_recording(struct uca_camera *cam) +static uint32_t uca_pco_stop_recording(struct uca_camera_priv *cam) { if ((cam->state == UCA_CAM_RECORDING) && (pco_set_rec_state(GET_PCO(cam), 0) != PCO_NOERROR)) return UCA_ERR_CAMERA | UCA_ERR_INIT | UCA_ERR_UNCLASSIFIED; @@ -250,7 +250,7 @@ static uint32_t uca_pco_stop_recording(struct uca_camera *cam) return UCA_NO_ERROR; } -static uint32_t uca_pco_trigger(struct uca_camera *cam) +static uint32_t uca_pco_trigger(struct uca_camera_priv *cam) { if (cam->state != UCA_CAM_RECORDING) return UCA_ERR_CAMERA | UCA_ERR_TRIGGER | UCA_ERR_NOT_RECORDING; @@ -258,7 +258,7 @@ static uint32_t uca_pco_trigger(struct uca_camera *cam) return cam->grabber->trigger(cam->grabber); } -static uint32_t uca_pco_grab(struct uca_camera *cam, char *buffer, void *meta_data) +static uint32_t uca_pco_grab(struct uca_camera_priv *cam, char *buffer, void *meta_data) { if (cam->state != UCA_CAM_RECORDING) return UCA_ERR_CAMERA | UCA_ERR_NOT_RECORDING; @@ -272,7 +272,7 @@ static uint32_t uca_pco_grab(struct uca_camera *cam, char *buffer, void *meta_da return UCA_NO_ERROR; } -static uint32_t uca_pco_register_callback(struct uca_camera *cam, uca_cam_grab_callback callback, void *user) +static uint32_t uca_pco_register_callback(struct uca_camera_priv *cam, uca_cam_grab_callback callback, void *user) { if (cam->callback == NULL) { cam->callback = callback; @@ -282,7 +282,7 @@ static uint32_t uca_pco_register_callback(struct uca_camera *cam, uca_cam_grab_c return UCA_ERR_CAMERA | UCA_ERR_CALLBACK | UCA_ERR_ALREADY_REGISTERED; } -uint32_t uca_pco_init(struct uca_camera **cam, struct uca_grabber *grabber) +uint32_t uca_pco_init(struct uca_camera_priv **cam, struct uca_grabber_priv *grabber) { uint32_t err = UCA_ERR_CAMERA | UCA_ERR_INIT; if (grabber == NULL) @@ -297,7 +297,7 @@ uint32_t uca_pco_init(struct uca_camera **cam, struct uca_grabber *grabber) return err | UCA_ERR_NOT_FOUND; } - struct uca_camera *uca = uca_cam_new(); + struct uca_camera_priv *uca = uca_cam_new(); uca->grabber = grabber; uca->grabber->synchronous = false; diff --git a/src/cameras/pco.h b/src/cameras/pco.h index d8c2b07..194ea6c 100644 --- a/src/cameras/pco.h +++ b/src/cameras/pco.h @@ -1,6 +1,6 @@ #ifndef __UNIFIED_CAMERA_ACCESS_PCO_H #define __UNIFIED_CAMERA_ACCESS_PCO_H -uint32_t uca_pco_init(struct uca_camera **uca, struct uca_grabber *grabber); +uint32_t uca_pco_init(struct uca_camera_priv **uca, struct uca_grabber_priv *grabber); #endif diff --git a/src/cameras/pf.c b/src/cameras/pf.c index 5a87380..32ca834 100644 --- a/src/cameras/pf.c +++ b/src/cameras/pf.c @@ -47,9 +47,9 @@ static int uca_pf_set_uint32_property(TOKEN token, void *data, uint32_t *update_ return pfDevice_SetProperty(0, token, &value); } -static uint32_t uca_pf_set_property(struct uca_camera *cam, enum uca_property_ids property, void *data) +static uint32_t uca_pf_set_property(struct uca_camera_priv *cam, enum uca_property_ids property, void *data) { - struct uca_grabber *grabber = cam->grabber; + struct uca_grabber_priv *grabber = cam->grabber; TOKEN token = INVALID_TOKEN; int i = 0; int err = UCA_NO_ERROR; @@ -105,7 +105,7 @@ static uint32_t uca_pf_set_property(struct uca_camera *cam, enum uca_property_id } -static uint32_t uca_pf_get_property(struct uca_camera *cam, enum uca_property_ids property, void *data, size_t num) +static uint32_t uca_pf_get_property(struct uca_camera_priv *cam, enum uca_property_ids property, void *data, size_t num) { TOKEN t; /* You gotta love developers who name types capitalized... */ PFValue value; @@ -161,22 +161,22 @@ static uint32_t uca_pf_get_property(struct uca_camera *cam, enum uca_property_id return cam->grabber->get_property(cam->grabber, property, data); } -static uint32_t uca_pf_start_recording(struct uca_camera *cam) +static uint32_t uca_pf_start_recording(struct uca_camera_priv *cam) { return cam->grabber->acquire(cam->grabber, -1); } -static uint32_t uca_pf_stop_recording(struct uca_camera *cam) +static uint32_t uca_pf_stop_recording(struct uca_camera_priv *cam) { return cam->grabber->stop_acquire(cam->grabber); } -static uint32_t uca_pf_trigger(struct uca_camera *cam) +static uint32_t uca_pf_trigger(struct uca_camera_priv *cam) { return cam->grabber->trigger(cam->grabber); } -static uint32_t uca_pf_grab(struct uca_camera *cam, char *buffer, void *metadata) +static uint32_t uca_pf_grab(struct uca_camera_priv *cam, char *buffer, void *metadata) { uint16_t *frame; uint32_t err = cam->grabber->grab(cam->grabber, (void **) &frame, &cam->current_frame); @@ -187,7 +187,7 @@ static uint32_t uca_pf_grab(struct uca_camera *cam, char *buffer, void *metadata return UCA_NO_ERROR; } -static uint32_t uca_pf_register_callback(struct uca_camera *cam, uca_cam_grab_callback callback, void *user) +static uint32_t uca_pf_register_callback(struct uca_camera_priv *cam, uca_cam_grab_callback callback, void *user) { if (cam->callback == NULL) { cam->callback = callback; @@ -197,13 +197,13 @@ static uint32_t uca_pf_register_callback(struct uca_camera *cam, uca_cam_grab_ca return UCA_ERR_CAMERA | UCA_ERR_CALLBACK | UCA_ERR_ALREADY_REGISTERED; } -static uint32_t uca_pf_destroy(struct uca_camera *cam) +static uint32_t uca_pf_destroy(struct uca_camera_priv *cam) { pfDeviceClose(0); return UCA_NO_ERROR; } -uint32_t uca_pf_init(struct uca_camera **cam, struct uca_grabber *grabber) +uint32_t uca_pf_init(struct uca_camera_priv **cam, struct uca_grabber_priv *grabber) { int num_ports; if ((grabber == NULL) || (pfPortInit(&num_ports) < 0) || (pfDeviceOpen(0) < 0)) @@ -212,7 +212,7 @@ uint32_t uca_pf_init(struct uca_camera **cam, struct uca_grabber *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 *uca = uca_cam_new(); + struct uca_camera_priv *uca = uca_cam_new(); uca->grabber = grabber; uca->grabber->synchronous = false; diff --git a/src/cameras/pf.h b/src/cameras/pf.h index d7bf85b..c5d4918 100644 --- a/src/cameras/pf.h +++ b/src/cameras/pf.h @@ -1,6 +1,6 @@ #ifndef __UNIFIED_CAMERA_ACCESS_PHOTON_H #define __UNIFIED_CAMERA_ACCESS_PHOTON_H -uint32_t uca_pf_init(struct uca_camera **uca, struct uca_grabber *grabber); +uint32_t uca_pf_init(struct uca_camera_priv **uca, struct uca_grabber_priv *grabber); #endif |