From 0badb165733c0e12db79c00cc569786354ffe455 Mon Sep 17 00:00:00 2001 From: Yeoh Ee Peng Date: Fri, 20 Mar 2020 17:02:28 +0800 Subject: runtime/intel_mediasdk: Enable sanity test Sanity test for: - using intel media driver (iHD) - validate intel msdk encode was working through gstreamer - validate intel msdk decode was working through gstreamer Signed-off-by: Yeoh Ee Peng Signed-off-by: Anuj Mittal --- lib/oeqa/runtime/cases/intel_mediasdk.py | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/oeqa/runtime/cases/intel_mediasdk.py (limited to 'lib/oeqa') diff --git a/lib/oeqa/runtime/cases/intel_mediasdk.py b/lib/oeqa/runtime/cases/intel_mediasdk.py new file mode 100644 index 00000000..4ae7d580 --- /dev/null +++ b/lib/oeqa/runtime/cases/intel_mediasdk.py @@ -0,0 +1,34 @@ +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.runtime.decorator.package import OEHasPackage +from oeqa.core.decorator.depends import OETestDepends + +class MsdkTest(OERuntimeTestCase): + + @classmethod + def tearDownClass(cls): + cls.tc.target.run("rm /tmp/mtest_h264.mp4") + + @OEHasPackage(['gstreamer1.0-plugins-base']) + @OEHasPackage(['gstreamer1.0-plugins-good']) + @OEHasPackage(['gstreamer1.0-plugins-bad']) + @OEHasPackage(['intel-mediasdk']) + @OEHasPackage(['intel-media-driver', 'libigfxcmrt7']) + def test_gstreamer_can_encode_with_msdk_and_intel_media_driver(self): + (status, output) = self.target.run('gst-inspect-1.0 msdk') + self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) + + (status, output) = self.target.run('export LIBVA_DRIVER_NAME=iHD; ' + 'gst-launch-1.0 -ev videotestsrc num-buffers=120 ! timeoverlay ! ' + 'msdkh264enc ! video/x-h264,profile=main ! h264parse ! ' + 'filesink location=/tmp/mtest_h264.mp4') + self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) + + @OETestDepends(['intel_mediasdk.MsdkTest.test_gstreamer_can_encode_with_msdk_and_intel_media_driver']) + def test_gstreamer_can_decode_with_msdk_and_intel_media_driver(self): + (status, output) = self.target.run('export LIBVA_DRIVER_NAME=iHD; ' + 'gst-launch-1.0 filesrc location=/tmp/mtest_h264.mp4 ! ' + 'h264parse ! msdkh264dec ! ' + 'msdkh265enc rate-control=cbr bitrate=5000 gop-size=30 b-frames=2 ! ' + 'video/x-h265,profile=main ! h265parse ! fakesink') + self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output)) + -- cgit v1.2.3-54-g00ecf