diff options
author | Dave Robillard <dave@drobilla.net> | 2009-06-22 17:04:22 -0400 |
---|---|---|
committer | Dave Robillard <dave@drobilla.net> | 2009-06-22 17:04:22 -0400 |
commit | 7a7083ba1f8e38b0b51820d4a37f279c6b2c73bd (patch) | |
tree | 5fb2f44346d722fa2c707854a187cb2ab8dff1af /tests/check/elements/camerabin.c | |
parent | a6389f9a9220e11110778ec46b6c12abeb058d94 (diff) | |
parent | 218878de5ea48b5acdf36070a73a50fd71f41741 (diff) | |
download | gst-plugins-bad-7a7083ba1f8e38b0b51820d4a37f279c6b2c73bd.tar.gz gst-plugins-bad-7a7083ba1f8e38b0b51820d4a37f279c6b2c73bd.tar.bz2 gst-plugins-bad-7a7083ba1f8e38b0b51820d4a37f279c6b2c73bd.zip |
Merge branch 'fdo' into lv2
Diffstat (limited to 'tests/check/elements/camerabin.c')
-rw-r--r-- | tests/check/elements/camerabin.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/check/elements/camerabin.c b/tests/check/elements/camerabin.c index 795fb4f0..cc08f50d 100644 --- a/tests/check/elements/camerabin.c +++ b/tests/check/elements/camerabin.c @@ -38,8 +38,6 @@ #define PHOTO_SETTING_DELAY_US 0 static GstElement *camera; -static GCond *cam_cond; -static GMutex *cam_mutex; static GMainLoop *main_loop; static guint cycle_count = 0; @@ -52,7 +50,7 @@ make_test_file_name (const gchar * base_name) g_snprintf (file_name, 999, "%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir (), base_name); - GST_INFO ("capturing to: %s (cycle_count=%d)", file_name, cycle_count); + GST_INFO ("capturing to: %s (cycle: %d)", file_name, cycle_count); return file_name; } @@ -79,6 +77,7 @@ handle_image_captured_cb (gpointer data) GST_DEBUG ("handle_image_captured_cb, cycle: %d", cycle_count); if (cycle_count == 0) { + GST_DEBUG ("all cycles done"); g_main_loop_quit (loop); } else { /* Set video recording mode */ @@ -97,7 +96,7 @@ handle_image_captured_cb (gpointer data) g_signal_emit_by_name (camera, "user-start", NULL); cycle_count--; - GST_DEBUG ("next cycle"); + GST_DEBUG ("next cycle: %d", cycle_count); } GST_DEBUG ("handle_image_captured_cb done"); return FALSE; @@ -110,7 +109,7 @@ capture_done (GstElement * elem, const gchar * filename, gpointer user_data) g_idle_add ((GSourceFunc) handle_image_captured_cb, loop); - GST_DEBUG ("image saved"); + GST_INFO ("image saved"); return FALSE; } @@ -160,6 +159,10 @@ capture_bus_cb (GstBus * bus, GstMessage * message, gpointer data) GST_WARNING ("ERROR: %s [%s]", err->message, debug); g_error_free (err); g_free (debug); + /* Write debug graph to file */ + GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (camera), + GST_DEBUG_GRAPH_SHOW_ALL, "camerabin.error"); + fail_if (TRUE, "error while capturing"); g_main_loop_quit (loop); break; @@ -172,6 +175,9 @@ capture_bus_cb (GstBus * bus, GstMessage * message, gpointer data) GST_WARNING ("WARNING: %s [%s]", err->message, debug); g_error_free (err); g_free (debug); + /* Write debug graph to file */ + GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (camera), + GST_DEBUG_GRAPH_SHOW_ALL, "camerabin.warning"); break; } case GST_MESSAGE_EOS: @@ -181,7 +187,7 @@ capture_bus_cb (GstBus * bus, GstMessage * message, gpointer data) default: st = gst_message_get_structure (message); if (st && gst_structure_has_name (st, "image-captured")) { - GST_INFO ("image-captured"); + GST_INFO ("image captured"); } break; } @@ -200,9 +206,6 @@ setup (void) main_loop = g_main_loop_new (NULL, TRUE); - cam_cond = g_cond_new (); - cam_mutex = g_mutex_new (); - camera = gst_check_setup_element ("camerabin"); setup_camerabin_elements (camera); @@ -242,8 +245,6 @@ setup (void) static void teardown (void) { - g_mutex_free (cam_mutex); - g_cond_free (cam_cond); if (camera) gst_check_teardown_element (camera); |