validate: launcher: Simplify fakesink handling
authorPhilippe Normand <philn@igalia.com>
Thu, 20 May 2021 15:43:25 +0000 (16:43 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 25 May 2021 10:46:47 +0000 (10:46 +0000)
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>

validate/launcher/utils.py

index 26dca49c4ca98e04ca290a2d3daedf53c19ac8b4..09166bd5b96016009edd3937a5eca629a480b970 100644 (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):
-    if media_type == "video":
-        if needs_clock:
-            return 'fakevideosink qos=true max-lateness=20000000'
+    extra = ""
+    if media_type == "video" and needs_clock:
+        extra = 'max-lateness=20000000'
 
-        return "fakevideosink sync=false"
-
-    if needs_clock:
-        return "fakesink sync=true"
-
-    return "fakesink"
+    return f"fake{media_type}sink sync={needs_clock} {extra}"
 
 
 class InvalidValueError(ValueError):