diff --git a/validate/launcher/apps/gstvalidate.py b/validate/launcher/apps/gstvalidate.py index 212745bf62..b855eaf8d5 100644 --- a/validate/launcher/apps/gstvalidate.py +++ b/validate/launcher/apps/gstvalidate.py @@ -36,7 +36,7 @@ from launcher.baseclasses import GstValidateTest, Test, \ from launcher.utils import path2url, url2path, DEFAULT_TIMEOUT, which, \ GST_SECOND, Result, Protocols, mkdir, printc, Colors, get_data_file, \ - kill_subprocess, format_config_template + kill_subprocess, format_config_template, get_fakesink_for_media_type # # Private global variables # @@ -287,10 +287,8 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator): if self.test_manager.options.mute: needs_clock = scenario.needs_clock_sync() \ if scenario else False - audiosink = self.get_fakesink_for_media_type( - "audio", needs_clock) - videosink = self.get_fakesink_for_media_type( - "video", needs_clock) + audiosink = get_fakesink_for_media_type("audio", needs_clock) + videosink = get_fakesink_for_media_type("video", needs_clock) else: audiosink = 'autoaudiosink' videosink = 'autovideosink' @@ -330,8 +328,8 @@ class GstValidatePlaybinTestsGenerator(GstValidatePipelineTestsGenerator): if self.test_manager.options.mute: needs_clock = scenario.needs_clock_sync() or minfo.media_descriptor.need_clock_sync() - afakesink = self.get_fakesink_for_media_type("audio", needs_clock) - vfakesink = self.get_fakesink_for_media_type("video", needs_clock) + afakesink = get_fakesink_for_media_type("audio", needs_clock) + vfakesink = get_fakesink_for_media_type("video", needs_clock) pipe_str += " audio-sink='%s' video-sink='%s'" % ( afakesink, vfakesink) @@ -474,8 +472,8 @@ class GstValidateMixerTestsGenerator(GstValidatePipelineTestsGenerator): self.debug("Adding: %s", fname) if self.test_manager.options.mute: - pipe_arguments["sink"] = self.get_fakesink_for_media_type(self.media_type, - scenario.needs_clock_sync()) + pipe_arguments["sink"] = get_fakesink_for_media_type(self.media_type, + scenario.needs_clock_sync()) else: pipe_arguments["sink"] = "auto%ssink" % self.media_type diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py index 6a3ce4f68e..aa6dea185e 100644 --- a/validate/launcher/baseclasses.py +++ b/validate/launcher/baseclasses.py @@ -1562,19 +1562,6 @@ 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() diff --git a/validate/launcher/utils.py b/validate/launcher/utils.py index 96acb10e9c..9aacf987ae 100644 --- a/validate/launcher/utils.py +++ b/validate/launcher/utils.py @@ -640,3 +640,16 @@ def format_config_template(extra_data, config_text, test_name): extra_vars['validateflow'] = "validateflow, expectations-dir=\"%s\", actual-results-dir=\"%s\"" % (expectations_dir, actual_results_dir) return config_text % extra_vars + + +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"