summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-28 11:32:44 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-28 11:32:44 +0100
commit49cf589ca2fdcbd9ff55ae70040d6d52c57a3fb1 (patch)
tree589601f08f4b0fff66786f14cc60ed17dfaa096b
parentcdca4954a292dc53b67fa616bad94ad9c2f31e54 (diff)
downloaduca-49cf589ca2fdcbd9ff55ae70040d6d52c57a3fb1.tar.gz
uca-49cf589ca2fdcbd9ff55ae70040d6d52c57a3fb1.tar.bz2
uca-49cf589ca2fdcbd9ff55ae70040d6d52c57a3fb1.tar.xz
uca-49cf589ca2fdcbd9ff55ae70040d6d52c57a3fb1.zip
Add camera state and accessor function
-rw-r--r--src/uca.c5
-rw-r--r--src/uca.h13
2 files changed, 18 insertions, 0 deletions
diff --git a/src/uca.c b/src/uca.c
index cf9d9ed..17a7ae2 100644
--- a/src/uca.c
+++ b/src/uca.c
@@ -79,6 +79,11 @@ void uca_destroy(struct uca_t *uca)
}
}
+enum uca_cam_state uca_get_camera_state(struct uca_camera_t *cam)
+{
+ return cam->state;
+}
+
static struct uca_property_t property_map[UCA_PROP_LAST+1] = {
{ "name", uca_na, uca_string },
{ "width", uca_pixel, uca_uint32t },
diff --git a/src/uca.h b/src/uca.h
index c067d9f..3f31bdb 100644
--- a/src/uca.h
+++ b/src/uca.h
@@ -17,6 +17,8 @@ struct uca_t;
struct uca_camera_t;
struct uca_property_t;
+enum uca_camera_state;
+
/**
* \brief Camera probing and initialization
* \return UCA_ERR_INIT_NOT_FOUND if camera is not found or could not be initialized
@@ -65,6 +67,9 @@ struct uca_t *uca_init(void);
*/
void uca_destroy(struct uca_t *uca);
+enum uca_cam_state uca_get_camera_state(struct uca_camera_t *cam);
+
+
/**
* \brief Convert a property string to the corresponding ID
*/
@@ -154,6 +159,13 @@ struct uca_property_t {
} type;
};
+enum uca_cam_state {
+ UCA_CAM_ERROR,
+ UCA_CAM_CONFIGURABLE,
+ UCA_CAM_ARMED,
+ UCA_CAM_RECORDING,
+};
+
struct uca_camera_t {
struct uca_camera_t *next;
@@ -165,6 +177,7 @@ struct uca_camera_t {
/* Private */
uca_cam_destroy destroy;
+ enum uca_cam_state state;
void *user; /**< private user data to be used by the camera driver */
};