aboutsummaryrefslogtreecommitdiffstats
path: root/lib/oeqa/runtime/cases/intel_vaapi_driver.py
blob: b78b28592c1f03ad4a430ea93a428495960c003f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.runtime.decorator.package import OEHasPackage
from oeqa.core.decorator.depends import OETestDepends

class VaapiDriverTest(OERuntimeTestCase):

    @classmethod
    def tearDownClass(cls):
        cls.tc.target.run("rm /tmp/vtest_h264.mp4")

    @OEHasPackage(['gstreamer1.0-plugins-base'])
    @OEHasPackage(['gstreamer1.0-plugins-good'])
    @OEHasPackage(['gstreamer1.0-vaapi'])
    @OEHasPackage(['intel-vaapi-driver'])
    def test_gstreamer_can_encode_with_intel_vaapi_driver(self):
        (status, output) = self.target.run('gst-inspect-1.0 vaapi')
        self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))

        (status, output) = self.target.run('export GST_VAAPI_ALL_DRIVERS=1; '
                                          'gst-launch-1.0 -ev videotestsrc num-buffers=60 ! '
                                          'vaapih264enc ! mp4mux ! filesink location=/tmp/vtest_h264.mp4')
        self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))

    @OETestDepends(['intel_vaapi_driver.VaapiDriverTest.test_gstreamer_can_encode_with_intel_vaapi_driver'])
    def test_gstreamer_can_decode_with_intel_vaapi_driver(self):
        (status, output) = self.target.run('export GST_VAAPI_ALL_DRIVERS=1; '
                                           'gst-launch-1.0 filesrc location=/tmp/vtest_h264.mp4 ! '
                                           'qtdemux ! h264parse ! vaapih264dec ! vaapisink')
        self.assertEqual(status, 0, msg='status and output: %s and %s' % (status, output))