validate: launcher: Simplify fakesink handling

Now the function returns either a fakeaudiosink or a fakevideosink, depending on
the media type.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/246>
This commit is contained in:
Philippe Normand 2021-05-20 16:43:25 +01:00 committed by GStreamer Marge Bot
parent 34a88d95c6
commit ac88851587

View file

@ -658,16 +658,11 @@ def format_config_template(extra_data, config_text, test_name):
def get_fakesink_for_media_type(media_type, needs_clock=False): def get_fakesink_for_media_type(media_type, needs_clock=False):
if media_type == "video": extra = ""
if needs_clock: if media_type == "video" and needs_clock:
return 'fakevideosink qos=true max-lateness=20000000' extra = 'max-lateness=20000000'
return "fakevideosink sync=false" return f"fake{media_type}sink sync={needs_clock} {extra}"
if needs_clock:
return "fakesink sync=true"
return "fakesink"
class InvalidValueError(ValueError): class InvalidValueError(ValueError):