validate:scenario: Add a debug category and add some debug
authorThibault Saunier <tsaunier@gnome.org>
Wed, 18 Jun 2014 11:02:29 +0000 (13:02 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Mon, 7 Jul 2014 09:27:34 +0000 (11:27 +0200)
validate/gst/validate/gst-validate-scenario.c

index 48a77a5..b7231a0 100644 (file)
 
 #define DEFAULT_SEEK_TOLERANCE (1 * GST_MSECOND)        /* tolerance seek interval
                                                            TODO make it overridable  */
+
+GST_DEBUG_CATEGORY_STATIC (gst_validate_scenario_debug);
+#undef GST_CAT_DEFAULT
+#define GST_CAT_DEFAULT gst_validate_scenario_debug
+
 enum
 {
   PROP_0,
@@ -704,8 +709,10 @@ get_position (GstValidateScenario * scenario)
 
     /* TODO what about non flushing seeks? */
     /* TODO why is this inside the action time if ? */
-    if (priv->last_seek)
+    if (priv->last_seek) {
+      GST_INFO_OBJECT (scenario, "Still seeking -- not executing action");
       return TRUE;
+    }
 
     type = g_hash_table_lookup (action_types_table, act->type);
 
@@ -1633,6 +1640,9 @@ init_scenarios (void)
   const gchar *wait_mandatory_fields[] = { "duration", NULL };
   const gchar *set_state_mandatory_fields[] = { "state", NULL };
 
+  GST_DEBUG_CATEGORY_INIT (gst_validate_scenario_debug, "gstvalidatescenario",
+      GST_DEBUG_FG_YELLOW, "Gst validate scenarios");
+
   _gst_validate_action_type = gst_validate_action_get_type ();
 
   clean_action_str = g_regex_new ("\\\\\n|#.*\n", G_REGEX_CASELESS, 0, NULL);