aboutsummaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorGeorge Kiagiadakis2011-08-25 05:49:38 -0500
committerNikhil Devshatwar2013-05-15 07:30:06 -0500
commit116fd94475bb94f2de402c94335588f27249fc7e (patch)
treeaab721870266f427a578f56537dba74dd74ecee0 /gst
parent5593eea44003021fc0d7cdb61e67241455c657f2 (diff)
downloadgst-plugins-bad0-10-116fd94475bb94f2de402c94335588f27249fc7e.tar.gz
gst-plugins-bad0-10-116fd94475bb94f2de402c94335588f27249fc7e.tar.xz
gst-plugins-bad0-10-116fd94475bb94f2de402c94335588f27249fc7e.zip
camerabin2: Add a timer to measure shot-to-save delay.
Diffstat (limited to 'gst')
-rw-r--r--gst/camerabin2/gstcamerabin2.c11
-rw-r--r--gst/camerabin2/gstcamerabin2.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c
index 2d2259bcf..b9c9e4d15 100644
--- a/gst/camerabin2/gstcamerabin2.c
+++ b/gst/camerabin2/gstcamerabin2.c
@@ -369,6 +369,10 @@ gst_camera_bin_start_capture (GstCameraBin2 * camerabin)
369 gchar *location = NULL; 369 gchar *location = NULL;
370 GST_DEBUG_OBJECT (camerabin, "Received start-capture"); 370 GST_DEBUG_OBJECT (camerabin, "Received start-capture");
371 371
372 if (camerabin->mode == MODE_IMAGE) {
373 g_timer_start (camerabin->shot_to_save_timer);
374 }
375
372 /* check that we have a valid location */ 376 /* check that we have a valid location */
373 if (camerabin->mode == MODE_VIDEO) { 377 if (camerabin->mode == MODE_VIDEO) {
374 if (camerabin->location == NULL) { 378 if (camerabin->location == NULL) {
@@ -628,6 +632,8 @@ gst_camera_bin_dispose (GObject * object)
628 camerabin->preview_filter = NULL; 632 camerabin->preview_filter = NULL;
629 } 633 }
630 634
635 g_timer_destroy (camerabin->shot_to_save_timer);
636
631 G_OBJECT_CLASS (parent_class)->dispose (object); 637 G_OBJECT_CLASS (parent_class)->dispose (object);
632} 638}
633 639
@@ -928,6 +934,8 @@ gst_camera_bin_init (GstCameraBin2 * camera)
928 camera->audio_capsfilter = gst_element_factory_make ("capsfilter", 934 camera->audio_capsfilter = gst_element_factory_make ("capsfilter",
929 "audio-capsfilter"); 935 "audio-capsfilter");
930 camera->audio_volume = gst_element_factory_make ("volume", "audio-volume"); 936 camera->audio_volume = gst_element_factory_make ("volume", "audio-volume");
937
938 camera->shot_to_save_timer = g_timer_new ();
931} 939}
932 940
933static void 941static void
@@ -938,6 +946,9 @@ gst_image_capture_bin_post_image_done (GstCameraBin2 * camera,
938 946
939 g_return_if_fail (filename != NULL); 947 g_return_if_fail (filename != NULL);
940 948
949 printf ("*** Shot-to-save delay: %lf\n",
950 g_timer_elapsed (camera->shot_to_save_timer, NULL));
951
941 msg = gst_message_new_element (GST_OBJECT_CAST (camera), 952 msg = gst_message_new_element (GST_OBJECT_CAST (camera),
942 gst_structure_new ("image-done", "filename", G_TYPE_STRING, 953 gst_structure_new ("image-done", "filename", G_TYPE_STRING,
943 filename, NULL)); 954 filename, NULL));
diff --git a/gst/camerabin2/gstcamerabin2.h b/gst/camerabin2/gstcamerabin2.h
index 29e1c9a58..86e5db32d 100644
--- a/gst/camerabin2/gstcamerabin2.h
+++ b/gst/camerabin2/gstcamerabin2.h
@@ -145,6 +145,8 @@ struct _GstCameraBin2
145 GstCamFlags flags; 145 GstCamFlags flags;
146 146
147 gboolean elements_created; 147 gboolean elements_created;
148
149 GTimer *shot_to_save_timer;
148}; 150};
149 151
150struct _GstCameraBin2Class 152struct _GstCameraBin2Class