summaryrefslogtreecommitdiffstats
path: root/src/uca-camera.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-10-09 15:43:10 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-10-09 15:43:10 +0200
commit4a27a2e95aa1a2312ad17404d7ab236b2fa6f1b7 (patch)
tree1016f4721a740d18dcb44e471c393531ef814232 /src/uca-camera.c
parent805129cf7452e37c6d1042a87fadd297098fac9c (diff)
downloaduca-4a27a2e95aa1a2312ad17404d7ab236b2fa6f1b7.tar.gz
uca-4a27a2e95aa1a2312ad17404d7ab236b2fa6f1b7.tar.bz2
uca-4a27a2e95aa1a2312ad17404d7ab236b2fa6f1b7.tar.xz
uca-4a27a2e95aa1a2312ad17404d7ab236b2fa6f1b7.zip
Fix #150: Add "frames-per-second" property
Right now, there is only information for the DIMAX camera about the actual inherent system delay. For all other cameras fps = 1. / t_exp.
Diffstat (limited to 'src/uca-camera.c')
-rw-r--r--src/uca-camera.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/uca-camera.c b/src/uca-camera.c
index f973355..14da820 100644
--- a/src/uca-camera.c
+++ b/src/uca-camera.c
@@ -66,6 +66,7 @@ const gchar *uca_camera_props[N_BASE_PROPERTIES] = {
"sensor-max-frame-rate",
"trigger-mode",
"exposure-time",
+ "frames-per-second",
"roi-x0",
"roi-y0",
"roi-width",
@@ -102,6 +103,15 @@ uca_camera_set_property (GObject *object, guint property_id, const GValue *value
priv->transfer_async = g_value_get_boolean(value);
break;
+ case PROP_FRAMES_PER_SECOND:
+ {
+ gdouble frames_per_second;
+
+ frames_per_second = g_value_get_double (value);
+ g_object_set (object, "exposure-time", 1. / frames_per_second, NULL);
+ }
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
}
@@ -125,6 +135,15 @@ uca_camera_get_property(GObject *object, guint property_id, GValue *value, GPara
g_value_set_boolean(value, priv->transfer_async);
break;
+ case PROP_FRAMES_PER_SECOND:
+ {
+ gdouble exposure_time;
+
+ g_object_get (object, "exposure-time", &exposure_time, NULL);
+ g_value_set_double (value, 1. / exposure_time);
+ }
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
}
@@ -267,6 +286,13 @@ uca_camera_class_init(UcaCameraClass *klass)
0.0, G_MAXDOUBLE, 1.0,
G_PARAM_READWRITE);
+ camera_properties[PROP_FRAMES_PER_SECOND] =
+ g_param_spec_double(uca_camera_props[PROP_FRAMES_PER_SECOND],
+ "Frames per second",
+ "Frames per second",
+ 0.0, G_MAXDOUBLE, 1.0,
+ G_PARAM_READWRITE);
+
camera_properties[PROP_HAS_STREAMING] =
g_param_spec_boolean(uca_camera_props[PROP_HAS_STREAMING],
"Streaming capability",