[aravis] camera: ignore set_gain and set_exposure with obviously invalid parameters.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] camera: ignore set_gain and set_exposure with obviously invalid parameters.
- Date: Tue, 31 Aug 2010 09:42:03 +0000 (UTC)
commit 5c08269741c802166b2cbaa83bd9af4ddf6dc8f3
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Tue Aug 31 11:40:03 2010 +0200
camera: ignore set_gain and set_exposure with obviously invalid parameters.
That's now consitent with the behaviour of set_region and set_binning.
src/arvcamera.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/arvcamera.c b/src/arvcamera.c
index b08c416..01ee8b3 100644
--- a/src/arvcamera.c
+++ b/src/arvcamera.c
@@ -342,6 +342,9 @@ arv_camera_set_frame_rate (ArvCamera *camera, double frame_rate)
{
g_return_if_fail (ARV_IS_CAMERA (camera));
+ if (frame_rate <= 0.0)
+ return;
+
switch (camera->priv->vendor) {
case ARV_CAMERA_VENDOR_BASLER:
arv_device_set_string_feature_value (camera->priv->device, "TriggerSelector",
@@ -454,6 +457,9 @@ arv_camera_set_exposure_time (ArvCamera *camera, double exposure_time_us)
{
g_return_if_fail (ARV_IS_CAMERA (camera));
+ if (exposure_time_us <= 0)
+ return;
+
arv_device_set_float_feature_value (camera->priv->device, "ExposureTimeAbs", exposure_time_us);
}
@@ -486,6 +492,9 @@ arv_camera_set_gain (ArvCamera *camera, gint64 gain)
{
g_return_if_fail (ARV_IS_CAMERA (camera));
+ if (gain < 0)
+ return;
+
arv_device_set_integer_feature_value (camera->priv->device, "GainRaw", gain);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]