description, duration=0, summary="Set state to NULL->PLAYING->NULL 20 times", need-clock-sync=true, min-media-duration=1.0
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
-set-state, state="null"
-set-state, state="playing"
+set-state, state="null", sub-action="set-state, state=playing", repeat=40
stop;
act->name = "";
}
+ if (act->main_structure)
+ copy->main_structure = gst_structure_copy (act->main_structure);
+
copy->action_number = act->action_number;
copy->playback_time = act->playback_time;
if (action->structure)
gst_structure_free (action->structure);
+ if (action->main_structure)
+ gst_structure_free (action->main_structure);
+
g_slice_free1 (_find_action_type (action->type)->action_struct_size, action);
}
gst_validate_action_init (action);
action->playback_time = GST_CLOCK_TIME_NONE;
action->type = action_type->name;
+ action->repeat = -1;
action->scenario = scenario;
if (scenario)
return TRUE;
}
+static GstValidateExecuteActionReturn
+_execute_action (GstValidateActionType * action_type,
+ GstValidateAction * action)
+{
+ GstValidateExecuteActionReturn res =
+ action_type->execute (action->scenario, action);
+
+ if (!gst_structure_has_field (action->structure, "sub-action")) {
+ gst_structure_free (action->structure);
+
+ action->structure = gst_structure_copy (action->main_structure);
+ }
+
+ return res;
+}
+
static gboolean
get_position (GstValidateScenario * scenario)
{
GST_DEBUG_OBJECT (scenario, "Executing %" GST_PTR_FORMAT
" at %" GST_TIME_FORMAT, act->structure, GST_TIME_ARGS (position));
priv->seeked_in_pause = FALSE;
- act->state = type->execute (scenario, act);
+
+ act->state = _execute_action (type, act);
if (act->state == GST_VALIDATE_EXECUTE_ACTION_ERROR) {
gchar *str = gst_structure_to_string (act->structure);
g_free (str);
}
- if (act->repeat > 0) {
+ if (act->repeat > 0 && gst_structure_is_equal (act->structure,
+ act->main_structure)) {
act->repeat--;
} else if (act->state != GST_VALIDATE_EXECUTE_ACTION_ASYNC) {
tmp = priv->actions;
return GST_VALIDATE_EXECUTE_ACTION_ERROR;
}
- action->repeat = -1;
if (gst_structure_get_double (structure, "playback-time", &playback_time) ||
gst_structure_get_double (structure, "playback_time", &playback_time)) {
action->playback_time = playback_time * GST_SECOND;
structure, TRUE) == GST_VALIDATE_EXECUTE_ACTION_ERROR)
goto failed;
+ action->main_structure = gst_structure_copy (structure);
action->action_number = priv->num_actions++;
}
}
if (!GST_CLOCK_TIME_IS_VALID (action->playback_time)) {
+ GstValidateExecuteActionReturn res;
GstValidateActionType *action_type = _find_action_type (action->type);
gst_validate_printf (action->scenario, "Executing sub action of type %s",
action->type);
- return action_type->execute (action->scenario, action);
- }
+ res = _execute_action (action_type, action);
+ return res;
+ }
}
return GST_VALIDATE_EXECUTE_ACTION_OK;