From 5e24887e06c306552dfd5f48f7ad94cc170bca30 Mon Sep 17 00:00:00 2001 From: Timo Dritschler Date: Wed, 13 May 2015 17:06:33 +0200 Subject: UcaCamera base class: Changed properties Changed sensor-width, sensor-height and sensor-bitdepth to construct only Added uca_camera_pspec_set_writable mock: allow characterization at construction time Its now possible to set sensor-width, sensor-height and sensor-bitdepth at construction time Creation of random data is now controlled by a property and can be set while recording --- src/uca-camera.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'src/uca-camera.c') diff --git a/src/uca-camera.c b/src/uca-camera.c index a312a39..c36451c 100644 --- a/src/uca-camera.c +++ b/src/uca-camera.c @@ -372,15 +372,15 @@ uca_camera_class_init (UcaCameraClass *klass) g_param_spec_uint(uca_camera_props[PROP_SENSOR_WIDTH], "Width of sensor", "Width of the sensor in pixels", - 1, G_MAXUINT, 1, - G_PARAM_READABLE); + 1, G_MAXUINT, 512, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); camera_properties[PROP_SENSOR_HEIGHT] = g_param_spec_uint(uca_camera_props[PROP_SENSOR_HEIGHT], "Height of sensor", "Height of the sensor in pixels", - 1, G_MAXUINT, 1, - G_PARAM_READABLE); + 1, G_MAXUINT, 512, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); camera_properties[PROP_SENSOR_PIXEL_WIDTH] = g_param_spec_double (uca_camera_props[PROP_SENSOR_PIXEL_WIDTH], @@ -400,8 +400,8 @@ uca_camera_class_init (UcaCameraClass *klass) g_param_spec_uint(uca_camera_props[PROP_SENSOR_BITDEPTH], "Number of bits per pixel", "Number of bits per pixel", - 1, 32, 1, - G_PARAM_READABLE); + 1, 32, 8, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); camera_properties[PROP_SENSOR_HORIZONTAL_BINNING] = g_param_spec_uint(uca_camera_props[PROP_SENSOR_HORIZONTAL_BINNING], @@ -1154,7 +1154,24 @@ uca_camera_set_writable (UcaCamera *camera, GParamSpec *pspec; pspec = get_param_spec_by_name (camera, prop_name); + uca_camera_pspec_set_writable (pspec, writable); +} +/** + * uca_camera_pspec_set_writable: (skip) + * @pspec: A #GParamSpec + * @writable: %TRUE if property can be written during acquisition + * + * Sets a flag that defines if the property defined by @pspec can be written + * during an acquisition. This can be used during UcaCamera class + * initialization. + * + * Since: 2.1 + */ +void +uca_camera_pspec_set_writable (GParamSpec *pspec, + gboolean writable) +{ if (pspec != NULL) { if (g_param_spec_get_qdata (pspec, UCA_WRITABLE_QUARK) != NULL) g_warning ("::%s is already fixed", pspec->name); -- cgit v1.2.3