summaryrefslogtreecommitdiffstats
path: root/tools/benchmark.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/benchmark.c')
-rw-r--r--tools/benchmark.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/benchmark.c b/tools/benchmark.c
index bff8b50..170a96c 100644
--- a/tools/benchmark.c
+++ b/tools/benchmark.c
@@ -115,8 +115,12 @@ grab_frames_sync (UcaCamera *camera, gpointer buffer, guint n_frames)
static void
grab_callback (gpointer data, gpointer user_data)
{
+ static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
guint *n_acquired_frames = user_data;
+
+ g_static_mutex_lock (&mutex);
*n_acquired_frames += 1;
+ g_static_mutex_unlock (&mutex);
}
static void
@@ -136,7 +140,6 @@ grab_frames_async (UcaCamera *camera, gpointer buffer, guint n_frames)
;
uca_camera_stop_recording (camera, &error);
-
}
static void
@@ -204,6 +207,7 @@ benchmark (UcaCamera *camera)
g_print ("# Sensor size: %ix%i\n", sensor_width, sensor_height);
g_print ("# ROI size: %ix%i\n", roi_width, roi_height);
g_print ("# Exposure time: %fs\n", exposure);
+ g_print ("# Bits: %i\n", bits);
/* Synchronous frame acquisition */
g_print ("# %-10s%-10s%-10s%-16s%-16s\n", "type", "n_frames", "n_runs", "frames/s", "MiB/s");
@@ -250,7 +254,7 @@ main (int argc, char *argv[])
g_log_set_handler (NULL, G_LOG_LEVEL_MASK, log_handler, log_channel);
manager = uca_plugin_manager_new ();
- camera = uca_plugin_manager_get_camera (manager, argv[1], &error);
+ camera = uca_plugin_manager_get_camera (manager, argv[1], &error, NULL);
if (camera == NULL) {
g_error ("Initialization: %s", error->message);