[aravis] camera: don't apply workarounds in arv_camera_new
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] camera: don't apply workarounds in arv_camera_new
- Date: Thu, 31 Oct 2013 22:25:47 +0000 (UTC)
commit 198ddf8bfae3485b9a56465497c5d2e068c1c9d9
Author: John Stowers <john stowers gmail com>
Date: Thu Oct 31 09:12:39 2013 +0100
camera: don't apply workarounds in arv_camera_new
It breaks users who construct camera objects using g_object_new,
which includes but is not limited to introspection users. Move
use_gain_raw to arv_camera_constructor
https://bugzilla.gnome.org/show_bug.cgi?id=711192
src/arvcamera.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/arvcamera.c b/src/arvcamera.c
index cbe64a1..726216e 100644
--- a/src/arvcamera.c
+++ b/src/arvcamera.c
@@ -1304,9 +1304,10 @@ arv_camera_new (const char *name)
camera = g_object_new (ARV_TYPE_CAMERA, "device", device, NULL);
- camera->priv->use_gain_raw = !ARV_IS_GC_FLOAT (arv_device_get_feature (device, "Gain"));
- camera->priv->use_exposure_time_abs = !ARV_IS_GC_FLOAT (arv_device_get_feature (device,
"ExposureTime"));
- camera->priv->use_acquisition_frame_rate_abs = !ARV_IS_GC_FLOAT (arv_device_get_feature (device,
"AcquisitionFrameRate"));
+ /* if you need to apply or test for fixups based on the camera model
+ please do so in arv_camera_constructor and not here, as this breaks
+ objects created with g_object_new, which includes but is not limited to
+ introspection users */
return camera;
}
@@ -1378,6 +1379,10 @@ arv_camera_constructor (GType gtype, guint n_properties, GObjectConstructParam *
camera->priv->vendor = vendor;
camera->priv->series = series;
+ camera->priv->use_gain_raw = !ARV_IS_GC_FLOAT (arv_device_get_feature (camera->priv->device, "Gain"));
+ camera->priv->use_exposure_time_abs = !ARV_IS_GC_FLOAT (arv_device_get_feature (camera->priv->device,
"ExposureTime"));
+ camera->priv->use_acquisition_frame_rate_abs = !ARV_IS_GC_FLOAT (arv_device_get_feature
(camera->priv->device, "AcquisitionFrameRate"));
+
return object;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]