summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-23 22:45:13 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-02-23 22:45:13 +0100
commitf6b63f4957c55107310d092dbf8eecce1e3d12b4 (patch)
treed08eadd4ef6228abbbfe8391a3849ab405fcabec /src
parenta6f255cb1dbeeed7e9b7c8f2a2b22de3a5c6028b (diff)
downloadlibuca-f6b63f4957c55107310d092dbf8eecce1e3d12b4.tar.gz
libuca-f6b63f4957c55107310d092dbf8eecce1e3d12b4.tar.bz2
libuca-f6b63f4957c55107310d092dbf8eecce1e3d12b4.tar.xz
libuca-f6b63f4957c55107310d092dbf8eecce1e3d12b4.zip
Add new properties and return PROP_INVALID if not available
Diffstat (limited to 'src')
-rw-r--r--src/cameras/uca_pco.c8
-rw-r--r--src/uca.c3
-rw-r--r--src/uca.h21
3 files changed, 21 insertions, 11 deletions
diff --git a/src/cameras/uca_pco.c b/src/cameras/uca_pco.c
index 44ecf95..3155376 100644
--- a/src/cameras/uca_pco.c
+++ b/src/cameras/uca_pco.c
@@ -70,9 +70,9 @@ static uint32_t uca_pco_set_property(struct uca_t *uca, int32_t property, void *
break;
default:
- break;
+ return UCA_ERR_PROP_INVALID;
}
- return 0;
+ return UCA_NO_ERROR;
}
static uint32_t uca_pco_get_property(struct uca_t *uca, int32_t property, void *data)
@@ -104,9 +104,9 @@ static uint32_t uca_pco_get_property(struct uca_t *uca, int32_t property, void *
}
default:
- break;
+ return UCA_ERR_PROP_INVALID;
}
- return 0;
+ return UCA_NO_ERROR;
}
uint32_t uca_pco_init(struct uca_t *uca)
diff --git a/src/uca.c b/src/uca.c
index cab02ec..ddf3e3d 100644
--- a/src/uca.c
+++ b/src/uca.c
@@ -59,10 +59,13 @@ static const char* property_map[] = {
"name",
"width",
"height",
+ "x-offset",
+ "y-offset",
"max-width",
"max-height",
"bit-depth",
"exposure",
+ "delay",
"frame-rate",
NULL
};
diff --git a/src/uca.h b/src/uca.h
index 180c8b9..2c8a888 100644
--- a/src/uca.h
+++ b/src/uca.h
@@ -29,12 +29,14 @@ typedef uint32_t (*uca_cam_destroy) (struct uca_t *uca);
/**
* \brief Set a property
* \param[in] property_name Name of the property as defined in XXX
+ * \return UCA_ERR_PROP_INVALID if property is not supported on the camera
*/
typedef uint32_t (*uca_cam_set_property) (struct uca_t *uca, int32_t property, void *data);
/**
* \brief Set a property
* \param[in] property_name Name of the property as defined in XXX
+ * \return UCA_ERR_PROP_INVALID if property is not supported on the camera
*/
typedef uint32_t (*uca_cam_get_property) (struct uca_t *uca, int32_t property, void *data);
@@ -67,18 +69,23 @@ const char* uca_get_property_name(int32_t property_id);
#define UCA_NO_ERROR 0
#define UCA_ERR_INIT_NOT_FOUND 1 /**< camera probing or initialization failed */
-#define UCA_ERR_PROP_INVALID 2
+#define UCA_ERR_PROP_INVALID 1 /**< the requested property is not supported by the camera */
-/* The property IDs must start with 0 and be continuous */
+/* The property IDs must start with 0 and must be continuous */
#define UCA_PROP_INVALID -1
#define UCA_PROP_NAME 0
#define UCA_PROP_WIDTH 1
#define UCA_PROP_HEIGHT 2
-#define UCA_PROP_MAX_WIDTH 3
-#define UCA_PROP_MAX_HEIGHT 4
-#define UCA_PROP_BITDEPTH 5
-#define UCA_PROP_EXPOSURE 6
-#define UCA_PROP_FRAMERATE 7
+#define UCA_PROP_X_OFFSET 3
+#define UCA_PROP_Y_OFFSET 4
+#define UCA_PROP_MAX_WIDTH 5
+#define UCA_PROP_MAX_HEIGHT 6
+#define UCA_PROP_BITDEPTH 7
+#define UCA_PROP_EXPOSURE 8
+#define UCA_PROP_DELAY 9
+#define UCA_PROP_FRAMERATE 10
+
+#define UCA_PROP_INTERLACE -1
struct uca_t {
/* Function pointers to camera-specific methods */