validate:launcher: Use fakevideosink everywhere it makes sense.

This commit is contained in:
Thibault Saunier 2018-08-01 21:05:32 -04:00
parent 8c06862e80
commit f0cfdf9d14
2 changed files with 21 additions and 16 deletions

View file

@ -217,11 +217,8 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator):
continue
if self.test_manager.options.mute:
if scenario and scenario.needs_clock_sync():
audiosink = "fakesink sync=true"
videosink = "fakesink sync=true qos=true max-lateness=20000000"
else:
audiosink = videosink = "fakesink"
audiosink = self.get_fakesink_for_media_type("audio", needs_clock)
videosink = self.get_fakesink_for_media_type("video", needs_clock)
else:
audiosink = 'autoaudiosink'
videosink = 'autovideosink'
@ -257,14 +254,11 @@ class GstValidatePlaybinTestsGenerator(GstValidatePipelineTestsGenerator):
def _set_sinks(self, minfo, pipe_str, scenario):
if self.test_manager.options.mute:
if scenario.needs_clock_sync() or \
minfo.media_descriptor.need_clock_sync():
afakesink = "'fakesink sync=true'"
vfakesink = "'fakesink sync=true qos=true max-lateness=20000000'"
else:
vfakesink = afakesink = "'fakesink'"
needs_clock = scenario.needs_clock_sync() or minfo.media_descriptor.need_clock_sync()
pipe_str += " audio-sink=%s video-sink=%s" % (
afakesink = self.get_fakesink_for_media_type("audio", needs_clock)
vfakesink = self.get_fakesink_for_media_type("video", needs_clock)
pipe_str += " audio-sink='%s' video-sink='%s'" % (
afakesink, vfakesink)
return pipe_str
@ -403,10 +397,8 @@ class GstValidateMixerTestsGenerator(GstValidatePipelineTestsGenerator):
self.debug("Adding: %s", fname)
if self.test_manager.options.mute:
if scenario.needs_clock_sync():
pipe_arguments["sink"] = "fakesink sync=true"
else:
pipe_arguments["sink"] = "'fakesink'"
pipe_arguments["sink"] = self.get_fakesink_for_media_type(self.media_type,
scenario.needs_clock_sync())
else:
pipe_arguments["sink"] = "auto%ssink" % self.media_type

View file

@ -1370,6 +1370,19 @@ class GstValidateTestsGenerator(TestsGenerator):
def populate_tests(self, uri_minfo_special_scenarios, scenarios):
pass
@staticmethod
def get_fakesink_for_media_type(media_type, needs_clock=False):
if media_type == "video":
if needs_clock:
return 'fakevideosink qos=true max-lateness=20000000'
return "fakevideosink sync=false"
if needs_clock:
return "fakesink sync=true"
return "fakesink"
def generate_tests(self, uri_minfo_special_scenarios, scenarios):
self.populate_tests(uri_minfo_special_scenarios, scenarios)
return super(GstValidateTestsGenerator, self).generate_tests()