blob: b1fa30bb2d95858046fc929e77918d6ef2d736fb (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef MEDIABACKENDUTILS_H
#define MEDIABACKENDUTILS_H
#include <QtTest/qtestcase.h>
#include <private/qplatformmediaintegration_p.h>
inline bool isGStreamerPlatform()
{
return QPlatformMediaIntegration::instance()->name() == "gstreamer";
}
inline bool isQNXPlatform()
{
return QPlatformMediaIntegration::instance()->name() == "qnx";
}
inline bool isDarwinPlatform()
{
return QPlatformMediaIntegration::instance()->name() == "darwin";
}
inline bool isAndroidPlatform()
{
return QPlatformMediaIntegration::instance()->name() == "android";
}
inline bool isFFMPEGPlatform()
{
return QPlatformMediaIntegration::instance()->name() == "ffmpeg";
}
inline bool isWindowsPlatform()
{
return QPlatformMediaIntegration::instance()->name() == "windows";
}
inline bool isCI()
{
return qEnvironmentVariable("QTEST_ENVIRONMENT").toLower() == "ci";
}
#define QSKIP_GSTREAMER(message) \
do { \
if (isGStreamerPlatform()) \
QSKIP(message); \
} while (0)
#define QSKIP_IF_NOT_FFMPEG() \
do { \
if (!isFFMPEGPlatform()) \
QSKIP("Feature is only supported on FFmpeg"); \
} while (0)
#define QSKIP_FFMPEG(message) \
do { \
if (isFFMPEGPlatform()) \
QSKIP(message); \
} while (0)
#define QEXPECT_FAIL_GSTREAMER(dataIndex, comment, mode) \
do { \
if (isGStreamerPlatform()) \
QEXPECT_FAIL(dataIndex, comment, mode); \
} while (0)
#endif // MEDIABACKENDUTILS_H
|