diff --git a/support/testing/tests/package/sample_gst1_python.py b/support/testing/tests/package/sample_gst1_python.py index 39107616ed..d8cd3fb422 100644 --- a/support/testing/tests/package/sample_gst1_python.py +++ b/support/testing/tests/package/sample_gst1_python.py @@ -1,20 +1,32 @@ #!/usr/bin/env python -"""A simple test that uses gst1-python to run a fake videotestsrc for 100 frames""" +"""A simple test that uses gst1-python to run a fake videotestsrc for 100 +frames +""" import sys import gi gi.require_version('Gst', '1.0') from gi.repository import Gst, GLib # noqa: E402 +def on_message(bus: Gst.Bus, message: Gst.Message, loop: GLib.MainLoop): + print('Received Gst.Message.type: {}'.format(message.type)) + if message.type == Gst.MessageType.EOS: + loop.quit() + return True + + def main(): # Initializes Gstreamer Gst.init(sys.argv) - pipeline = Gst.parse_launch("videotestsrc num-buffers=100 ! autovideosink") + pipeline = Gst.parse_launch("videotestsrc num-buffers=100 ! fakevideosink") bus = pipeline.get_bus() bus.add_signal_watch() pipeline.set_state(Gst.State.PLAYING) loop = GLib.MainLoop() bus.connect("message", on_message, loop) loop.run() - pipeline.set_state(Gst.State.EOS) - exit(0) + pipeline.set_state(Gst.State.NULL) + + +if __name__ == '__main__': + main() diff --git a/support/testing/tests/package/test_gst1_python.py b/support/testing/tests/package/test_gst1_python.py index 469e0f392d..c6b337dd04 100644 --- a/support/testing/tests/package/test_gst1_python.py +++ b/support/testing/tests/package/test_gst1_python.py @@ -14,6 +14,10 @@ class TestGst1Python(TestPythonPackageBase): BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM=y BR2_PACKAGE_GOBJECT_INTROSPECTION=y BR2_PACKAGE_GSTREAMER1=y + BR2_PACKAGE_GST1_PLUGINS_BASE=y + BR2_PACKAGE_GST1_PLUGINS_BAD=y + BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEOTESTSRC=y + BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_DEBUGUTILS=y BR2_PACKAGE_GST1_PYTHON=y BR2_PACKAGE_PYTHON3=y BR2_PACKAGE_PYTHON_GOBJECT=y @@ -26,3 +30,4 @@ class TestGst1Python(TestPythonPackageBase): options=["-initrd", cpio_file]) self.emulator.login() sample_scripts = ["tests/package/sample_gst1_python.py"] + timeout = 200