mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
validate:launcher: Allow informing minimum media duration in scenarios
Allowing the launcher to avoid running tests on medias that are not long enough
This commit is contained in:
parent
24fe345f73
commit
1aa0d4eb4a
4 changed files with 15 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
description, duration=0, summary="Set state to NULL->PLAYING->NULL 20 times", need-clock-sync=true
|
||||
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"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
description, duration=30.0, minfo-media-duration=310.0, seek=true, reverse-playback=true, need-clock-sync=true
|
||||
description, duration=30.0, minfo-media-duration=310.0, seek=true, reverse-playback=true, need-clock-sync=true, min-media-duration=310.0
|
||||
seek, name=Fast-backward-seek, playback_time=0.0, rate=-2.0, start=0.0, stop=310.0, flags=accurate+flush
|
||||
seek, name=Fast-backward-seek, playback_time=300.0, rate=-4.0, start=0.0, stop=300.0, flags=accurate+flush
|
||||
seek, name=Fast-backward-seek, playback_time=280.0, rate=-8.0, start=0.0, stop=280.0, flags=accurate+flush
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
description, duration=35.0, seek=true, need-clock-sync=true
|
||||
description, duration=35.0, seek=true, need-clock-sync=true, min-media-duration=5.0
|
||||
seek, name=Fast-forward-seek, playback_time=0.0, rate=2.0, start=0.0, flags=accurate+flush
|
||||
seek, name=Fast-forward-seek, playback_time="min(10.0, duration*0.25)", rate=4.0, start=0.0, flags=accurate+flush
|
||||
seek, name=Fast-forward-seek, playback_time="min(20.0, duration*0.50)", rate=8.0, start=0.0, flags=accurate+flush
|
||||
|
|
|
@ -855,6 +855,12 @@ class Scenario(object):
|
|||
|
||||
return False
|
||||
|
||||
def get_min_media_duration(self):
|
||||
if hasattr(self, "min_media_duration"):
|
||||
return long(self.min_media_duration)
|
||||
|
||||
return 0
|
||||
|
||||
def does_reverse_playback(self):
|
||||
if hasattr(self, "reverse_playback"):
|
||||
return bool(self.seek)
|
||||
|
@ -1043,6 +1049,12 @@ class MediaDescriptor(Loggable):
|
|||
scenario, self.get_uri())
|
||||
return False
|
||||
|
||||
if self.get_duration() / GST_SECOND < scenario.get_min_media_duration():
|
||||
self.debug("Do not run %s as %s is too short (%i < min media duation : %i",
|
||||
scenario, self.get_uri(), self.get_duration() / GST_SECOND,
|
||||
scenario.get_min_media_duration())
|
||||
return False
|
||||
|
||||
for track_type in ['audio', 'subtitle']:
|
||||
if self.get_num_tracks(track_type) < scenario.get_min_tracks(track_type):
|
||||
self.debug("%s -- %s | At least %s %s track needed < %s"
|
||||
|
|
Loading…
Reference in a new issue