mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-02 02:03:54 +00:00
validate:launcher: Move get_fakesink_for_media_type to utils
So it can be reused in other apps like GES
This commit is contained in:
parent
1e1797ee3a
commit
3343f166da
3 changed files with 20 additions and 22 deletions
|
@ -36,7 +36,7 @@ from launcher.baseclasses import GstValidateTest, Test, \
|
||||||
|
|
||||||
from launcher.utils import path2url, url2path, DEFAULT_TIMEOUT, which, \
|
from launcher.utils import path2url, url2path, DEFAULT_TIMEOUT, which, \
|
||||||
GST_SECOND, Result, Protocols, mkdir, printc, Colors, get_data_file, \
|
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 #
|
# Private global variables #
|
||||||
|
@ -287,10 +287,8 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator):
|
||||||
if self.test_manager.options.mute:
|
if self.test_manager.options.mute:
|
||||||
needs_clock = scenario.needs_clock_sync() \
|
needs_clock = scenario.needs_clock_sync() \
|
||||||
if scenario else False
|
if scenario else False
|
||||||
audiosink = self.get_fakesink_for_media_type(
|
audiosink = get_fakesink_for_media_type("audio", needs_clock)
|
||||||
"audio", needs_clock)
|
videosink = get_fakesink_for_media_type("video", needs_clock)
|
||||||
videosink = self.get_fakesink_for_media_type(
|
|
||||||
"video", needs_clock)
|
|
||||||
else:
|
else:
|
||||||
audiosink = 'autoaudiosink'
|
audiosink = 'autoaudiosink'
|
||||||
videosink = 'autovideosink'
|
videosink = 'autovideosink'
|
||||||
|
@ -330,8 +328,8 @@ class GstValidatePlaybinTestsGenerator(GstValidatePipelineTestsGenerator):
|
||||||
if self.test_manager.options.mute:
|
if self.test_manager.options.mute:
|
||||||
needs_clock = scenario.needs_clock_sync() or minfo.media_descriptor.need_clock_sync()
|
needs_clock = scenario.needs_clock_sync() or minfo.media_descriptor.need_clock_sync()
|
||||||
|
|
||||||
afakesink = self.get_fakesink_for_media_type("audio", needs_clock)
|
afakesink = get_fakesink_for_media_type("audio", needs_clock)
|
||||||
vfakesink = self.get_fakesink_for_media_type("video", needs_clock)
|
vfakesink = get_fakesink_for_media_type("video", needs_clock)
|
||||||
pipe_str += " audio-sink='%s' video-sink='%s'" % (
|
pipe_str += " audio-sink='%s' video-sink='%s'" % (
|
||||||
afakesink, vfakesink)
|
afakesink, vfakesink)
|
||||||
|
|
||||||
|
@ -474,8 +472,8 @@ class GstValidateMixerTestsGenerator(GstValidatePipelineTestsGenerator):
|
||||||
self.debug("Adding: %s", fname)
|
self.debug("Adding: %s", fname)
|
||||||
|
|
||||||
if self.test_manager.options.mute:
|
if self.test_manager.options.mute:
|
||||||
pipe_arguments["sink"] = self.get_fakesink_for_media_type(self.media_type,
|
pipe_arguments["sink"] = get_fakesink_for_media_type(self.media_type,
|
||||||
scenario.needs_clock_sync())
|
scenario.needs_clock_sync())
|
||||||
else:
|
else:
|
||||||
pipe_arguments["sink"] = "auto%ssink" % self.media_type
|
pipe_arguments["sink"] = "auto%ssink" % self.media_type
|
||||||
|
|
||||||
|
|
|
@ -1562,19 +1562,6 @@ class GstValidateTestsGenerator(TestsGenerator):
|
||||||
def populate_tests(self, uri_minfo_special_scenarios, scenarios):
|
def populate_tests(self, uri_minfo_special_scenarios, scenarios):
|
||||||
pass
|
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):
|
def generate_tests(self, uri_minfo_special_scenarios, scenarios):
|
||||||
self.populate_tests(uri_minfo_special_scenarios, scenarios)
|
self.populate_tests(uri_minfo_special_scenarios, scenarios)
|
||||||
return super(GstValidateTestsGenerator, self).generate_tests()
|
return super(GstValidateTestsGenerator, self).generate_tests()
|
||||||
|
|
|
@ -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)
|
extra_vars['validateflow'] = "validateflow, expectations-dir=\"%s\", actual-results-dir=\"%s\"" % (expectations_dir, actual_results_dir)
|
||||||
|
|
||||||
return config_text % extra_vars
|
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"
|
||||||
|
|
Loading…
Reference in a new issue