summaryrefslogtreecommitdiffstats
path: root/src/cameras/pf.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-03-24 15:09:01 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-03-24 15:09:01 +0100
commit922c36f1b6e7fc08abd5fc073c16cc9bad114880 (patch)
tree4d3e0c80ebf976e98c4749e289e328a6ce7204fe /src/cameras/pf.c
parentf7801334cc8e261aec976cc146251ddf6d9592fa (diff)
downloaduca-922c36f1b6e7fc08abd5fc073c16cc9bad114880.tar.gz
uca-922c36f1b6e7fc08abd5fc073c16cc9bad114880.tar.bz2
uca-922c36f1b6e7fc08abd5fc073c16cc9bad114880.tar.xz
uca-922c36f1b6e7fc08abd5fc073c16cc9bad114880.zip
Minor cleanups like sharing of uca_set_void and making non-exported functions
static
Diffstat (limited to 'src/cameras/pf.c')
-rw-r--r--src/cameras/pf.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/cameras/pf.c b/src/cameras/pf.c
index 86fe5e6..b787f5c 100644
--- a/src/cameras/pf.c
+++ b/src/cameras/pf.c
@@ -7,8 +7,6 @@
#include "uca-cam.h"
#include "uca-grabber.h"
-#define set_void(p, type, value) { *((type *) p) = value; }
-
struct uca_pf_map {
enum uca_property_ids uca_prop;
const char *pf_prop;
@@ -115,7 +113,7 @@ static uint32_t uca_pf_get_property(struct uca_camera *cam, enum uca_property_id
/* Handle all special cases */
switch (property) {
case UCA_PROP_BITDEPTH:
- set_void(data, uint32_t, 8);
+ uca_set_void(data, uint32_t, 8);
return UCA_NO_ERROR;
default:
@@ -131,16 +129,16 @@ static uint32_t uca_pf_get_property(struct uca_camera *cam, enum uca_property_id
switch (value.type) {
case PF_INT:
- set_void(data, uint32_t, value.value.i);
+ uca_set_void(data, uint32_t, value.value.i);
break;
case PF_FLOAT:
- set_void(data, uint32_t, (uint32_t) floor((value.value.f * 1000.0)+0.5));
+ uca_set_void(data, uint32_t, (uint32_t) floor((value.value.f * 1000.0)+0.5));
break;
case PF_STRING:
if (property == UCA_PROP_FRAMERATE) {
- set_void(data, uint32_t, (uint32_t) floor(atof(value.value.p)+0.5));
+ uca_set_void(data, uint32_t, (uint32_t) floor(atof(value.value.p)+0.5));
}
else {
strncpy((char *) data, value.value.p, num);
@@ -148,7 +146,7 @@ static uint32_t uca_pf_get_property(struct uca_camera *cam, enum uca_property_id
break;
case PF_MODE:
- set_void(data, uint32_t, (uint32_t) value.value.i);
+ uca_set_void(data, uint32_t, (uint32_t) value.value.i);
break;
default:
@@ -163,17 +161,17 @@ static uint32_t uca_pf_get_property(struct uca_camera *cam, enum uca_property_id
return cam->grabber->get_property(cam->grabber, property, data);
}
-uint32_t uca_pf_start_recording(struct uca_camera *cam)
+static 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 *cam)
+static uint32_t uca_pf_stop_recording(struct uca_camera *cam)
{
return cam->grabber->stop_acquire(cam->grabber);
}
-uint32_t uca_pf_grab(struct uca_camera *cam, char *buffer, void *metadata)
+static uint32_t uca_pf_grab(struct uca_camera *cam, char *buffer, void *metadata)
{
uint16_t *frame;
uint32_t err = cam->grabber->grab(cam->grabber, (void **) &frame, &cam->current_frame);
@@ -184,7 +182,7 @@ uint32_t uca_pf_grab(struct uca_camera *cam, char *buffer, void *metadata)
return UCA_NO_ERROR;
}
-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 *cam, uca_cam_grab_callback callback, void *user)
{
if (cam->callback == NULL) {
cam->callback = callback;