[aravis] camera: allow frame rate setting.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] camera: allow frame rate setting.
- Date: Tue, 18 May 2010 18:57:45 +0000 (UTC)
commit 76b508c3e8a362b97f4ecfec97dec848a307eb47
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Tue May 18 20:56:58 2010 +0200
camera: allow frame rate setting.
src/arvcamera.c | 3 ++-
src/arvcameratest.c | 21 +++++++++++++++------
2 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/src/arvcamera.c b/src/arvcamera.c
index d0f5b72..605e251 100644
--- a/src/arvcamera.c
+++ b/src/arvcamera.c
@@ -196,7 +196,8 @@ arv_camera_set_acquisition_frame_rate (ArvCamera *camera, double frame_rate)
switch (camera->priv->vendor) {
case ARV_CAMERA_VENDOR_BASLER:
- /* Fixme: use Raw and Base for access to the full frame rate range. */
+ arv_device_set_integer_feature_value (camera->priv->device, "AcquisitionFrameRateEnable",
+ 1);
arv_device_set_float_feature_value (camera->priv->device, "AcquisitionFrameRateAbs",
frame_rate);
break;
diff --git a/src/arvcameratest.c b/src/arvcameratest.c
index 856962e..9ef6022 100644
--- a/src/arvcameratest.c
+++ b/src/arvcameratest.c
@@ -13,7 +13,8 @@ static char *arv_option_camera_name = NULL;
static char *arv_option_debug_domains = NULL;
static gboolean arv_option_snaphot = FALSE;
static gboolean arv_option_auto_buffer = FALSE;
-static gboolean arv_option_external_trigger = FALSE;
+static char *arv_option_trigger = NULL;
+static double arv_option_frequency = -1.0;
static int arv_option_width = -1;
static int arv_option_height = -1;
static int arv_option_horizontal_binning = -1;
@@ -27,8 +28,10 @@ static const GOptionEntry arv_option_entries[] =
&arv_option_snaphot, "Snapshot", NULL},
{ "auto", 'a', 0, G_OPTION_ARG_NONE,
&arv_option_auto_buffer, "Auto buffer size", NULL},
- { "external", 'e', 0, G_OPTION_ARG_NONE,
- &arv_option_external_trigger, "External trigger", NULL},
+ { "frequency", 'f', 0, G_OPTION_ARG_DOUBLE,
+ &arv_option_frequency, "Acquisition frequency", NULL },
+ { "trigger", 't', 0, G_OPTION_ARG_STRING,
+ &arv_option_trigger, "External trigger", NULL},
{ "width", 'w', 0, G_OPTION_ARG_INT,
&arv_option_width, "Width", NULL },
{ "height", 'h', 0, G_OPTION_ARG_INT,
@@ -112,11 +115,17 @@ main (int argc, char **argv)
arv_camera_set_acquisition_mode (camera, "Continuous");
- if (arv_option_external_trigger) {
- arv_camera_set_trigger_selector (camera, "AcquisitionStart");
+ if (arv_option_frequency > 0.0) {
+ arv_camera_set_trigger_selector (camera, "FrameStart");
+ arv_camera_set_trigger_mode (camera, "Off");
+ arv_camera_set_acquisition_frame_rate (camera, arv_option_frequency);
+ }
+
+ if (arv_option_trigger != NULL) {
+ arv_camera_set_trigger_selector (camera, "FrameStart");
arv_camera_set_trigger_mode (camera, "On");
arv_camera_set_trigger_activation (camera, "RisingEdge");
- arv_camera_set_trigger_source (camera, "Line1");
+ arv_camera_set_trigger_source (camera, arv_option_trigger);
}
g_print ("acquisition mode = %s\n", arv_camera_get_acquisition_mode (camera));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]