validate:scenario: Add a way to ignore EOS

And ignore then in seek_forward/backward to avoid cases where the pipeline EOS
before we have the chance to launch the following seek, see:

https://ci.gstreamer.net/job/GStreamer-master-meson-validate/3483/testReport/junit/(root)/gst-validate-launcher/validate_rtsp_playback_seek_backward_raw_h264_1_mp4/
This commit is contained in:
Thibault Saunier 2019-03-16 18:05:56 -03:00 committed by Thibault Saunier
parent ad28bffa20
commit fca2411e77
6 changed files with 26 additions and 7 deletions

View file

@ -1,3 +1,3 @@
description, duration=0, summary="Set state to NULL->PLAYING->NULL 20 times", need-clock-sync=true, min-media-duration=1.0, live_content_compatible=True, handles-states=true
description, duration=0, summary="Set state to NULL->PLAYING->NULL 20 times", need-clock-sync=true, min-media-duration=1.0, live_content_compatible=True, handles-states=true, ignore-eos=true
set-state, state="playing", sub-action="set-state, state=null", repeat=40
stop;

View file

@ -1,7 +1,9 @@
description, duration=30.0, minfo-media-duration=310.0, seek=true, reverse-playback=true, need-clock-sync=true, min-media-duration=310.0
description, duration=30.0, minfo-media-duration=310.0, seek=true, reverse-playback=true, need-clock-sync=true, min-media-duration=310.0, ignore-eos=true
include,location=includes/default-seek-flags.scenario
seek, name=Fast-backward-seek, playback-time=0.0, rate=-2.0, start=0.0, stop=310.0, flags="$(default_flags)"
seek, name=Fast-backward-seek, playback-time=300.0, rate=-4.0, start=0.0, stop=300.0, flags="$(default_flags)"
seek, name=Fast-backward-seek, playback-time=280.0, rate=-8.0, start=0.0, stop=280.0, flags="$(default_flags)"
seek, name=Fast-backward-seek, playback-time=240.0, rate=-16.0, start=0.0, stop=240.0, flags="$(default_flags)"
seek, name=Fast-backward-seek, playback-time=160.0, rate=-32.0, start=0.0, stop=160.0, flags="$(default_flags)"
wait, message-type=eos
stop

View file

@ -1,8 +1,9 @@
description, duration=25.0, seek=true, need-clock-sync=true, min-media-duration=5.0
description, duration=25.0, seek=true, need-clock-sync=true, min-media-duration=5.0, ignore-eos=true
include,location=includes/default-seek-flags.scenario
seek, name=Fast-forward-seek, playback-time=0.0, rate=2.0, start=0.0, flags="$(default_flags)"
seek, name=Fast-forward-seek, playback-time="min(10.0, $(duration) * 0.0625)", rate=4.0, start=0.0, flags="$(default_flags)"
seek, name=Fast-forward-seek, playback-time="min(20.0, $(duration) * 0.125)", rate=8.0, start=0.0, flags="$(default_flags)"
seek, name=Fast-forward-seek, playback-time="min(40.0, $(duration) * 0.25)", rate=16.0, start=0.0, flags="$(default_flags)"
seek, name=Fast-forward-seek, playback-time="min(80.0, $(duration) * 0.50)", rate=32.0, start=0.0, flags="$(default_flags)"
stop, playback-time="min($(duration) - 0.3, 160.0)"
wait, message-type=eos
stop

View file

@ -1,4 +1,4 @@
description, seek=true, duration=30, need-clock-sync=true
description, seek=true, duration=30, need-clock-sync=true, ignore-eos=true
include,location=includes/default-seek-flags.scenario
seek, name=Backward-seek, playback-time="min(5.0, ($(duration) / 4))", rate=1.0, start=0.0, flags="$(default_flags)"
seek, name=Backward-seek, playback-time="min(10.0, 2*($(duration) / 4))", rate=1.0, start="min(5.0, $(duration) / 4)", flags="$(default_flags)"

View file

@ -1,6 +1,6 @@
description, seek=true, duration=20, need-clock-sync=true
description, seek=true, duration=20, need-clock-sync=true, ignore-eos=true
include,location=includes/default-seek-flags.scenario
seek, name=First-forward-seek, playback-time="min(5.0, ($(duration)/8))", start="min(10, 2*($(duration)/8))", flags="$(default_flags)"
seek, name=Second-forward-seek, playback-time="min(15.0, 3*($(duration)/8))", start="min(20, 4*($(duration)/8))", flags="$(default_flags)"
seek, name=Third-forward-seek, playback-time="min(25, 5*($(duration)/8))", start="min(30.0, 6*($(duration)/8))", flags="$(default_flags)"
stop, playback-time=35.0
stop, playback-time="min($(duration) - 1, 35)"

View file

@ -158,6 +158,7 @@ struct _GstValidateScenarioPrivate
gboolean got_eos;
gboolean changing_state;
gboolean needs_async_done;
gboolean ignore_eos;
GstState target_state;
GList *overrides;
@ -3135,6 +3136,11 @@ message_cb (GstBus * bus, GstMessage * message, GstValidateScenario * scenario)
GstValidateActionType *stop_action_type;
GstStructure *s;
if (!is_error && scenario->priv->ignore_eos) {
GST_INFO_OBJECT (scenario, "Got EOS but ignoring it!");
goto done;
}
GST_VALIDATE_SCENARIO_EOS_HANDLING_LOCK (scenario);
{
/* gst_validate_action_set_done() does not finish the action
@ -3376,6 +3382,7 @@ _load_scenario_file (GstValidateScenario * scenario,
gst_structure_get_boolean (structure, "is-config", is_config);
gst_structure_get_boolean (structure, "handles-states",
&priv->handles_state);
gst_structure_get_boolean (structure, "ignore-eos", &priv->ignore_eos);
if (!priv->handles_state)
priv->target_state = GST_STATE_PLAYING;
@ -4733,6 +4740,15 @@ init_scenarios (void)
.possible_variables = NULL,
.def = "infinite (-1)"
},
{
.name = "ignore-eos",
.description = "Ignore EOS and keep executing the scenario when it happens.\n By default "
"a 'stop' action is generated one EOS",
.mandatory = FALSE,
.types = "boolean",
.possible_variables = NULL,
.def = "false"
},
{NULL}
}),
"Allows to describe the scenario in various ways",