summaryrefslogtreecommitdiffstats
path: root/src/cameras
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-21 15:06:42 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-21 15:06:42 +0100
commit28619821bc90ed4c15844b2e6b6a5a2971ef5f2e (patch)
treec313b5b77087c18027d152c4c69c49b8ea0254d9 /src/cameras
downloaduca-28619821bc90ed4c15844b2e6b6a5a2971ef5f2e.tar.gz
uca-28619821bc90ed4c15844b2e6b6a5a2971ef5f2e.tar.bz2
uca-28619821bc90ed4c15844b2e6b6a5a2971ef5f2e.tar.xz
uca-28619821bc90ed4c15844b2e6b6a5a2971ef5f2e.zip
Initial commit
Diffstat (limited to 'src/cameras')
-rw-r--r--src/cameras/uca_pco.c30
-rw-r--r--src/cameras/uca_pco.h8
2 files changed, 38 insertions, 0 deletions
diff --git a/src/cameras/uca_pco.c b/src/cameras/uca_pco.c
new file mode 100644
index 0000000..daba6f6
--- /dev/null
+++ b/src/cameras/uca_pco.c
@@ -0,0 +1,30 @@
+
+#include <clser.h>
+#include <libpco/libpco.h>
+#include "uca.h"
+#include "uca_pco.h"
+
+struct pco_edge_t *pco;
+
+static void uca_pco_destroy(struct uca_t *uca)
+{
+ pco_destroy(pco);
+}
+
+uint8_t uca_pco_init(struct uca_t *uca)
+{
+ pco = pco_init();
+ if (!pco_active(pco)) {
+ pco_destroy(pco);
+ return 0;
+ }
+
+ pco_scan_and_set_baud_rate(pco);
+
+ /* Camera found, set function pointers... */
+ uca->cam_destroy = &uca_pco_destroy;
+
+ /* ... and some properties */
+ pco_get_actual_size(pco, &uca->image_width, &uca->image_height);
+ return 1;
+}
diff --git a/src/cameras/uca_pco.h b/src/cameras/uca_pco.h
new file mode 100644
index 0000000..c314ffe
--- /dev/null
+++ b/src/cameras/uca_pco.h
@@ -0,0 +1,8 @@
+#ifndef __UNIFIED_CAMERA_ACCESS_PCO_H
+#define __UNIFIED_CAMERA_ACCESS_PCO_H
+
+struct uca_t;
+
+uint8_t uca_pco_init(struct uca_t *uca);
+
+#endif