validate:launcher: Do not run scenarios that need prerolling on RTSP stream

This commit is contained in:
Thibault Saunier 2017-05-10 08:12:18 -03:00
parent b9774b14b5
commit 37de89e6db
6 changed files with 14 additions and 5 deletions

View file

@ -1,4 +1,4 @@
description, seek=true, handles-states=true
description, seek=true, handles-states=true, needs_preroll=true
pause, playback-time=0.0
seek, playback-time=0.0, start="duration - 0.5", flags=accurate+flush
seek, playback-time=0.0, start=position-0.1, repeat="min(10, (duration - 0.6))/0.1", flags=accurate+flush

View file

@ -1,4 +1,4 @@
description, seek=true, handles-states=true
description, seek=true, handles-states=true, needs_preroll=true
pause, playback-time=0.0
seek, playback-time=0.0, start="duration - 0.5", flags=accurate+flush
seek, playback-time=0.0, start=position-0.1, repeat="(duration - 0.6)/0.1", flags=accurate+flush

View file

@ -1,4 +1,4 @@
description, seek=true, handles-states=true
description, seek=true, handles-states=true, needs_preroll=true
pause, playback-time=0.0
seek, playback-time=0.0, start=position+0.1, repeat="min(10, (duration - 0.5))/0.1", flags=accurate+flush
play, playback-time=0.0

View file

@ -1,4 +1,4 @@
description, seek=true, handles-states=true
description, seek=true, handles-states=true, needs_preroll=true
pause, playback-time=0.0
seek, playback-time=0.0, start=position+0.1, repeat="(duration - 0.5)/0.1", flags=accurate+flush
play, playback-time=0.0

View file

@ -698,6 +698,9 @@ class GstValidateRTSPMediaDesciptor(GstValidateMediaDescriptor):
def get_protocol(self):
return Protocols.RTSP
def prerrols(self):
return False
class GstValidateTestManager(GstValidateBaseTestManager):

View file

@ -1695,7 +1695,7 @@ class Scenario(object):
def does_reverse_playback(self):
if hasattr(self, "reverse_playback"):
return bool(self.seek)
return bool(self.reverse_playback)
return False
@ -1901,6 +1901,9 @@ class MediaDescriptor(Loggable):
def can_play_reverse(self):
raise NotImplemented
def prerrols(self):
return True
def is_compatible(self, scenario):
if scenario is None:
return True
@ -1927,6 +1930,9 @@ class MediaDescriptor(Loggable):
self.debug("Do not run %s as %s is a live content", scenario, self.get_uri())
return False
if not self.prerrols() and getattr(scenario, 'needs_preroll', False):
return False
if self.get_duration() and 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",