From 11f923fa525408054963ae1c55fa80b7a0fd3c86 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sat, 13 Dec 2014 23:23:11 +0100 Subject: [PATCH] validate: Fix the check of action that can be *not* executed The check was wrong and we ended up allowing seek actions to no be executed. API: GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL https://bugzilla.gnome.org/show_bug.cgi?id=743994 --- validate/gst/validate/gst-validate-scenario.c | 24 +++++++++++++++--------- validate/gst/validate/gst-validate-scenario.h | 3 +++ validate/launcher/apps/gstvalidate.py | 23 +++++++++++++---------- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index be27a28..69d9aec 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -1421,24 +1421,28 @@ message_cb (GstBus * bus, GstMessage * message, GstValidateScenario * scenario) scenario->priv->on_addition_actions) { guint nb_actions = 0; gchar *actions = g_strdup (""), *tmpconcat; - GList *tmp = g_list_concat (scenario->priv->actions, - scenario->priv->interlaced_actions); + GList *tmp; GList *all_actions = - g_list_concat (tmp, scenario->priv->on_addition_actions); + g_list_concat (g_list_concat (scenario->priv->actions, + scenario->priv->interlaced_actions), + scenario->priv->on_addition_actions); for (tmp = all_actions; tmp; tmp = tmp->next) { - GstValidateAction *action = ((GstValidateAction *) tmp->data); gchar *action_string; + GstValidateAction *action = ((GstValidateAction *) tmp->data); + GstValidateActionType *type = _find_action_type (action->type); + tmpconcat = actions; - action_string = gst_structure_to_string (action->structure); - if (g_regex_match_simple ("eos|stop", action_string, 0, 0)) { + if (type->flags & GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL) { gst_validate_action_unref (action); - g_free (action_string); + continue; } nb_actions++; + + action_string = gst_structure_to_string (action->structure); actions = g_strdup_printf ("%s\n%*s%s", actions, 20, "", action_string); gst_validate_action_unref (action); @@ -2457,10 +2461,12 @@ init_scenarios (void) "Sets the pipeline state to PLAYING", GST_VALIDATE_ACTION_TYPE_NONE); REGISTER_ACTION_TYPE ("stop", _execute_stop, NULL, - "Sets the pipeline state to NULL", GST_VALIDATE_ACTION_TYPE_NONE); + "Sets the pipeline state to NULL", + GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL); REGISTER_ACTION_TYPE ("eos", _execute_eos, NULL, - "Sends an EOS event to the pipeline", GST_VALIDATE_ACTION_TYPE_NONE); + "Sends an EOS event to the pipeline", + GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL); REGISTER_ACTION_TYPE ("switch-track", _execute_switch_track, ((GstValidateActionParameter []) { diff --git a/validate/gst/validate/gst-validate-scenario.h b/validate/gst/validate/gst-validate-scenario.h index 97f5fa4..8e64b55 100644 --- a/validate/gst/validate/gst-validate-scenario.h +++ b/validate/gst/validate/gst-validate-scenario.h @@ -118,6 +118,8 @@ typedef struct _GstValidateActionType GstValidateActionType; * is specified * @GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK: The pipeline will need to be synchronized with the clock * for that action type to be used. + * @GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL: Do not concider the non execution of the action + * as a fatal error. */ typedef enum { @@ -127,6 +129,7 @@ typedef enum GST_VALIDATE_ACTION_TYPE_INTERLACED = 1 << 3, GST_VALIDATE_ACTION_TYPE_CAN_EXECUTE_ON_ADDITION = 1 << 4, GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK = 1 << 5, + GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL = 1 << 6, } GstValidateActionTypeFlags; struct _GstValidateActionType diff --git a/validate/launcher/apps/gstvalidate.py b/validate/launcher/apps/gstvalidate.py index f272e88..c93341b 100644 --- a/validate/launcher/apps/gstvalidate.py +++ b/validate/launcher/apps/gstvalidate.py @@ -329,22 +329,25 @@ class GstValidateMixerTestsGenerator(GstValidatePipelineTestsGenerator): else: pipe_arguments = {"mixer": self.mixer} - if self.test_manager.options.mute: - pipe_arguments["sink"] = "'fakesink'" - else: - pipe_arguments["sink"] = "auto%ssink" % self.media_type - - pipe = self._pipeline_template % pipe_arguments - - for src in srcs: - pipe += "%s ! _mixer. " % src - for scenario in scenarios: fname = self.get_fname(scenario, Protocols.FILE) + "." fname += name self.debug("Adding: %s", fname) + if self.test_manager.options.mute: + if scenario.needs_clock_sync(): + pipe_arguments["sink"] = "fakesink sync=true" + else: + pipe_arguments["sink"] = "'fakesink'" + else: + pipe_arguments["sink"] = "auto%ssink" % self.media_type + + pipe = self._pipeline_template % pipe_arguments + + for src in srcs: + pipe += "%s ! _mixer. " % src + self.add_test(GstValidateLaunchTest(fname, self.test_manager.options, self.test_manager.reporter, -- 2.7.4