validate:scenario: Stop scenario execution on stop action

And document it properly.

Summary:
The stop action was defined as "setting state to NULL" but
its actual goal is to stop the execution of the scenario. Make sure
that the scenario will not try to execute other actions when that
one has been executed.

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D103
This commit is contained in:
Thibault Saunier 2015-04-17 19:28:19 +02:00
parent 5d6fcb5727
commit 86efbffa32

View file

@ -646,8 +646,16 @@ _action_sets_state (GstValidateAction * action)
static gboolean
_execute_stop (GstValidateScenario * scenario, GstValidateAction * action)
{
GstValidateScenarioPrivate *priv = scenario->priv;
GstBus *bus = gst_element_get_bus (scenario->pipeline);
SCENARIO_LOCK (scenario);
if (priv->get_pos_id) {
g_source_remove (priv->get_pos_id);
priv->get_pos_id = 0;
}
SCENARIO_UNLOCK (scenario);
gst_bus_post (bus,
gst_message_new_request_state (GST_OBJECT_CAST (scenario),
GST_STATE_NULL));
@ -3026,7 +3034,10 @@ 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",
"Stops the execution of the scenario. It will post a 'request-state'"
" message on the bus with NULL as a requested state "
" and the application is responsible for stopping itself."
" if you override that action type, make sure to link up.",
GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL);
REGISTER_ACTION_TYPE ("eos", _execute_eos, NULL,