summaryrefslogtreecommitdiffstats
path: root/src/cameras/pco.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-28 17:48:55 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-28 17:48:55 +0100
commit28873ccf3f3f32486049eb40cd639bbab86e09dc (patch)
tree1411086a03efeee7ce8051a362bc2f83ac2a929b /src/cameras/pco.c
parentf6f2bafe19fd57c56201e79be6b7692f16f16099 (diff)
downloadlibuca-28873ccf3f3f32486049eb40cd639bbab86e09dc.tar.gz
libuca-28873ccf3f3f32486049eb40cd639bbab86e09dc.tar.bz2
libuca-28873ccf3f3f32486049eb40cd639bbab86e09dc.tar.xz
libuca-28873ccf3f3f32486049eb40cd639bbab86e09dc.zip
Start grab interface
Diffstat (limited to 'src/cameras/pco.c')
-rw-r--r--src/cameras/pco.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/cameras/pco.c b/src/cameras/pco.c
index 2547387..f65eb14 100644
--- a/src/cameras/pco.c
+++ b/src/cameras/pco.c
@@ -83,6 +83,9 @@ static uint32_t uca_pco_set_property(struct uca_camera_t *cam, enum uca_property
case UCA_PROP_DELAY:
return uca_pco_set_delay(cam, (uint32_t *) data);
+ case UCA_PROP_TIMESTAMP_MODE:
+ return pco_set_timestamp_mode(GET_PCO(cam), *((uint16_t *) data));
+
default:
return UCA_ERR_PROP_INVALID;
}
@@ -173,6 +176,23 @@ 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)
+{
+ struct pco_edge_t *pco = GET_PCO(cam);
+ pco_arm_camera(pco);
+ pco_set_rec_state(pco, 1);
+ cam->grabber->acquire(cam->grabber, -1, true);
+}
+
+uint32_t uca_pco_stop_recording(struct uca_camera_t *cam)
+{
+ pco_set_rec_state(GET_PCO(cam), 0);
+}
+
+uint32_t uca_pco_grab(struct uca_camera_t *cam, char *buffer, size_t n_bytes)
+{
+ cam->grabber->grab(cam->grabber, buffer, n_bytes);
+}
uint32_t uca_pco_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
{
@@ -195,7 +215,9 @@ uint32_t uca_pco_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber)
uca->destroy = &uca_pco_destroy;
uca->set_property = &uca_pco_set_property;
uca->get_property = &uca_pco_get_property;
- uca->acquire_image = &uca_pco_acquire_image;
+ uca->start_recording = &uca_pco_start_recording;
+ uca->stop_recording = &uca_pco_stop_recording;
+ uca->grab = &uca_pco_grab;
/* Prepare camera for recording */
pco_set_rec_state(pco, 0);