kumquat-buildroot/support/testing/tests/package/test_gst1_python.py

32 lines
1002 B
Python
Raw Normal View History

import os
from tests.package.test_python import TestPythonPackageBase
class TestGst1Python(TestPythonPackageBase):
__test__ = True
config = \
"""
BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM=y
BR2_PACKAGE_GSTREAMER1=y
support/testing: fix test_gst1_python The config is missing the following packages: - BR2_PACKAGE_GST1_PLUGINS_BASE This is needed for the videotestsrc plugin which provides videotestsrc. - BR2_PACKAGE_GST1_PLUGINS_BAD This is needed for the debugutils plugin which provides fakevideosink. - BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEOTESTSRC videotestsrcplugin used by the example pipeline. - BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_DEBUGUTILS fakevideosink plugin used by the example pipeline. The sample was also amended to fix: - no call to main. - using autovideosink instead of fakevideosink. Using Fakevideoskink is preferred because its primary purpose is for debugging and sample pipelines. Autovideosink does not work because there is no video output device. - No function on_message. Without this function, the script fails because of the missing function. - The script sets the pipeline to Gst.State.EOS instead of Gst.State.NULL which results in a failed pipeline state. When the state is set to NULL, gstreamer automatically calls EOS. Manually setting the pipeline state to EOS results in the following error: Trying to dispose element sink, but it is in PLAYING instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. A refcounting bug may also cause this problem in the application or some element. In addition, the default timeout is set too low and would result in a test failure, this has been changed to 200 seconds. These issues are now properly fixed, and the sample script passes. Signed-off-by: Adam Duskett <Aduskett@gmail.com> [yann.morin.1998@free.fr: - meld the two patches together - add the print() in the on_demand callback ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-24 18:38:53 +01:00
BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEOTESTSRC=y
BR2_PACKAGE_GST1_PLUGINS_BAD=y
support/testing: fix test_gst1_python The config is missing the following packages: - BR2_PACKAGE_GST1_PLUGINS_BASE This is needed for the videotestsrc plugin which provides videotestsrc. - BR2_PACKAGE_GST1_PLUGINS_BAD This is needed for the debugutils plugin which provides fakevideosink. - BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEOTESTSRC videotestsrcplugin used by the example pipeline. - BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_DEBUGUTILS fakevideosink plugin used by the example pipeline. The sample was also amended to fix: - no call to main. - using autovideosink instead of fakevideosink. Using Fakevideoskink is preferred because its primary purpose is for debugging and sample pipelines. Autovideosink does not work because there is no video output device. - No function on_message. Without this function, the script fails because of the missing function. - The script sets the pipeline to Gst.State.EOS instead of Gst.State.NULL which results in a failed pipeline state. When the state is set to NULL, gstreamer automatically calls EOS. Manually setting the pipeline state to EOS results in the following error: Trying to dispose element sink, but it is in PLAYING instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. A refcounting bug may also cause this problem in the application or some element. In addition, the default timeout is set too low and would result in a test failure, this has been changed to 200 seconds. These issues are now properly fixed, and the sample script passes. Signed-off-by: Adam Duskett <Aduskett@gmail.com> [yann.morin.1998@free.fr: - meld the two patches together - add the print() in the on_demand callback ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-24 18:38:53 +01:00
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_DEBUGUTILS=y
BR2_PACKAGE_GST1_PYTHON=y
BR2_PACKAGE_PYTHON3=y
BR2_TARGET_ROOTFS_CPIO=y
# BR2_TARGET_ROOTFS_TAR is not set
"""
def login(self):
cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
self.emulator.boot(arch="armv7",
kernel="builtin",
options=["-initrd", cpio_file])
self.emulator.login()
sample_scripts = ["tests/package/sample_gst1_python.py"]
support/testing: fix test_gst1_python The config is missing the following packages: - BR2_PACKAGE_GST1_PLUGINS_BASE This is needed for the videotestsrc plugin which provides videotestsrc. - BR2_PACKAGE_GST1_PLUGINS_BAD This is needed for the debugutils plugin which provides fakevideosink. - BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEOTESTSRC videotestsrcplugin used by the example pipeline. - BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_DEBUGUTILS fakevideosink plugin used by the example pipeline. The sample was also amended to fix: - no call to main. - using autovideosink instead of fakevideosink. Using Fakevideoskink is preferred because its primary purpose is for debugging and sample pipelines. Autovideosink does not work because there is no video output device. - No function on_message. Without this function, the script fails because of the missing function. - The script sets the pipeline to Gst.State.EOS instead of Gst.State.NULL which results in a failed pipeline state. When the state is set to NULL, gstreamer automatically calls EOS. Manually setting the pipeline state to EOS results in the following error: Trying to dispose element sink, but it is in PLAYING instead of the NULL state. You need to explicitly set elements to the NULL state before dropping the final reference, to allow them to clean up. A refcounting bug may also cause this problem in the application or some element. In addition, the default timeout is set too low and would result in a test failure, this has been changed to 200 seconds. These issues are now properly fixed, and the sample script passes. Signed-off-by: Adam Duskett <Aduskett@gmail.com> [yann.morin.1998@free.fr: - meld the two patches together - add the print() in the on_demand callback ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-24 18:38:53 +01:00
timeout = 200