validate:scenario: Add a method to retrieve all remaining actions
authorThibault Saunier <tsaunier@gnome.org>
Thu, 12 Feb 2015 15:23:49 +0000 (16:23 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Mon, 16 Feb 2015 16:18:31 +0000 (17:18 +0100)
Not only the next one as it was not making much sense!

API:
  - gst_validate_scenario_get_next_action
  + gst_validate_scenario_get_actions

validate/gst/validate/gst-validate-scenario.c
validate/gst/validate/gst-validate-scenario.h

index 5ec22e4..bb6e79d 100644 (file)
@@ -2487,13 +2487,20 @@ gst_validate_print_action_types (const gchar ** wanted_types,
   return TRUE;
 }
 
-GstValidateAction *
-gst_validate_scenario_get_next_action (GstValidateScenario * scenario)
+/**
+ * gst_validate_scenario_get_actions:
+ * @scenario: The scenario to retrieve remaining actions for
+ *
+ * Get remaining actions from @scenario.
+ *
+ * Returns: (transfer full) (element-type GstValidateAction): A list of #GstValidateAction.
+ */
+GList *
+gst_validate_scenario_get_actions (GstValidateScenario * scenario)
 {
   if (GPOINTER_TO_INT (g_private_get (&main_thread_priv))) {
-    if (scenario->priv->actions && scenario->priv->actions->next)
-      return (GstValidateAction *) gst_mini_object_ref ((GstMiniObject *)
-          scenario->priv->actions->next->data);
+    return g_list_copy_deep (scenario->priv->actions,
+        (GCopyFunc) gst_mini_object_ref, NULL);
   } else {
     GST_WARNING_OBJECT (scenario, "Trying to get next action from outside"
         " the 'main' thread");
index 025059b..243fc16 100644 (file)
@@ -273,8 +273,8 @@ gboolean gst_validate_scenario_execute_seek (GstValidateScenario *scenario,
                                              GstSeekType stop_type,
                                              GstClockTime stop);
 
-GstValidateAction *
-gst_validate_scenario_get_next_action       (GstValidateScenario *scenario);
+GList *
+gst_validate_scenario_get_actions          (GstValidateScenario *scenario);
 GstValidateExecuteActionReturn
 gst_validate_execute_action                 (GstValidateActionType * action_type,
                                              GstValidateAction * action);