From 8a9e9a7fd72c6f3483f0e02488698f00692d339a Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 13 Sep 2013 11:43:33 -0300 Subject: [PATCH] data: Port remaning scenario files to new format And add support to user declared timestamps -1.0 as GST_CLOCK_TIME_NONE --- validate/data/seek_forward_backward.scenario | 93 ++----------------- validate/data/simple_backward.scenario | 15 +-- validate/gst/validate/gst-validate-scenario.c | 13 ++- 3 files changed, 19 insertions(+), 102 deletions(-) diff --git a/validate/data/seek_forward_backward.scenario b/validate/data/seek_forward_backward.scenario index b4f12dffa1..2ee693bf91 100644 --- a/validate/data/seek_forward_backward.scenario +++ b/validate/data/seek_forward_backward.scenario @@ -1,85 +1,8 @@ - - - - - - - - - - - - - - - - - - - - - +seek, name=Forward-seek, playback_time=0.0, rate=1.0, start=5.0 +seek, name=Backward-seek, playback_time=10.0, rate=1.0, start=0.0 +seek, name=Backward-seek, playback_time=5.0, rate=1.0, start=25.0, stop=-1 +seek, name=Backward-seek, playback_time=30.0, rate=1.0, start=0.0 +seek, name=Forward-seek, playback_time=5.0, rate=1.0, start=15.0 +seek, name=Forward-seek, playback_time=20.0, rate=1.0, start=35.0 +seek, name=Backward-seek, playback_time=40.0, rate=1.0, start=25.0 +seek, name=Last-backward-seek, playback_time=3.0, rate=1.0, start=5.0, stop=10.0 diff --git a/validate/data/simple_backward.scenario b/validate/data/simple_backward.scenario index 9a9a1c86fe..5687ef8c88 100644 --- a/validate/data/simple_backward.scenario +++ b/validate/data/simple_backward.scenario @@ -1,14 +1 @@ - - - - - - +seek, name=Backward-seek, playback_time=0.0, rate=-1.0, start=0.0, stop=30.0 diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index db9927c474..b5a6ec2fa2 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -132,7 +132,10 @@ _execute_seek (GstValidateScenario * scenario, GstValidateAction * action) GST_WARNING_OBJECT (scenario, "Could not find start for a seek, FAILED"); return FALSE; } - start = dstart * GST_SECOND; + if (dstart == -1.0) + start = GST_CLOCK_TIME_NONE; + else + start = dstart * GST_SECOND; gst_structure_get_double (action->structure, "rate", &rate); if ((str_format = gst_structure_get_string (action->structure, "format"))) @@ -149,8 +152,12 @@ _execute_seek (GstValidateScenario * scenario, GstValidateAction * action) if ((str_flags = gst_structure_get_string (action->structure, "flags"))) flags = get_flags_from_string (GST_TYPE_SEEK_FLAGS, str_flags); - if (gst_structure_get_double (action->structure, "stop", &dstop)) - stop = dstop * GST_SECOND; + if (gst_structure_get_double (action->structure, "stop", &dstop)) { + if (dstop == -1.0) + stop = GST_CLOCK_TIME_NONE; + else + stop = dstop * GST_SECOND; + } g_print ("%s (num %u), seeking to: %" GST_TIME_FORMAT " stop: %" GST_TIME_FORMAT " Rate %lf\n", action->name,