Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
mediabackendutils_p.h
Go to the documentation of this file.
1
// Copyright (C) 2024 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4
#
ifndef
MEDIABACKENDUTILS_H
5
#
define
MEDIABACKENDUTILS_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
<
QtTest
/
qtestcase
.
h
>
19
#
include
<
private
/
qplatformmediaintegration_p
.
h
>
20
#
include
<
QtGui
/
private
/
qguiapplication_p
.
h
>
21
#
include
<
QtGui
/
qpa
/
qplatformintegration
.
h
>
22
23
namespace
BackendUtilsImpl
{
24
25
using
namespace
Qt
::
Literals
;
26
27
inline
bool
isGStreamerPlatform
()
28
{
29
return
QPlatformMediaIntegration::instance()->name() ==
"gstreamer"_L1
;
30
}
31
32
inline
bool
isQNXPlatform
()
33
{
34
return
QPlatformMediaIntegration::instance()->name() ==
"qnx"_L1
;
35
}
36
37
inline
bool
isDarwinPlatform
()
38
{
39
return
QPlatformMediaIntegration::instance()->name() ==
"darwin"_L1
;
40
}
41
42
inline
bool
isAndroidPlatform
()
43
{
44
return
QPlatformMediaIntegration::instance()->name() ==
"android"_L1
;
45
}
46
47
inline
bool
isOhosPlatform
()
48
{
49
return
QPlatformMediaIntegration::instance()->name() ==
"ohos"_L1
;
50
}
51
52
inline
bool
isFFMPEGPlatform
()
53
{
54
return
QPlatformMediaIntegration::instance()->name() ==
"ffmpeg"_L1
;
55
}
56
57
inline
bool
isWindowsPlatform
()
58
{
59
return
QPlatformMediaIntegration::instance()->name() ==
"windows"_L1
;
60
}
61
62
inline
bool
isRhiRenderingSupported
()
63
{
64
return
QGuiApplicationPrivate::platformIntegration()->hasCapability(
65
QPlatformIntegration::RhiBasedRendering);
66
}
67
68
inline
bool
isOpenGLSupported
()
69
{
70
return
QGuiApplicationPrivate::platformIntegration()->hasCapability(
71
QPlatformIntegration::OpenGL);
72
}
73
74
inline
bool
isCI
()
75
{
76
return
qEnvironmentVariable(
"QTEST_ENVIRONMENT"
).toLower().split(u' ').contains(u"ci"_s);
77
}
78
79
}
// namespace BackendUtilsImpl
80
81
using
namespace
BackendUtilsImpl
;
82
83
#
define
QSKIP_IF
(
checker
,
defaultMessage
,
/*messageOpt*/
...
)
84
do
{
85
if
(
checker
)
86
QSKIP
(
strlen
(
__VA_ARGS__
""
)
?
__VA_ARGS__
""
:
defaultMessage
)
;
87
}
while
(
0
)
88
89
#
define
QSKIP_GSTREAMER
(
/*messageOpt*/
...
)
90
QSKIP_IF
(
isGStreamerPlatform
(
)
,
"The feature is not supported on GStreamer"
,
__VA_ARGS__
)
91
92
#
define
QSKIP_IF_NOT_FFMPEG
(
/*messageOpt*/
...
)
93
QSKIP_IF
(
!
isFFMPEGPlatform
(
)
,
"The feature is only supported on FFmpeg"
,
__VA_ARGS__
)
94
95
#
define
QSKIP_FFMPEG
(
/*messageOpt*/
...
)
96
QSKIP_IF
(
isFFMPEGPlatform
(
)
,
"The feature is not supported on FFmpeg"
,
__VA_ARGS__
)
97
98
#
define
QSKIP_DARWIN
(
/*messageOpt*/
...
)
99
QSKIP_IF
(
isDarwinPlatform
(
)
,
"The feature is not supported on Darwin"
,
__VA_ARGS__
)
100
101
#
define
QSKIP_OHOS
(
/*messageOpt*/
...
)
102
QSKIP_IF
(
isOhosPlatform
(
)
,
"The feature is not supported on HarmonyOS"
,
__VA_ARGS__
)
103
104
#
define
QEXPECT_FAIL_GSTREAMER
(
dataIndex
,
comment
,
mode
)
105
do
{
106
if
(
isGStreamerPlatform
(
)
)
107
QEXPECT_FAIL
(
dataIndex
,
comment
,
mode
)
;
108
}
while
(
0
)
109
110
#
endif
// MEDIABACKENDUTILS_H
QSKIP_IF
#define QSKIP_IF(checker, defaultMessage,...)
Definition
mediabackendutils_p.h:83
BackendUtilsImpl
Definition
mediabackendutils_p.h:23
BackendUtilsImpl::isFFMPEGPlatform
bool isFFMPEGPlatform()
Definition
mediabackendutils_p.h:52
BackendUtilsImpl::isDarwinPlatform
bool isDarwinPlatform()
Definition
mediabackendutils_p.h:37
BackendUtilsImpl::isCI
bool isCI()
Definition
mediabackendutils_p.h:74
BackendUtilsImpl::isQNXPlatform
bool isQNXPlatform()
Definition
mediabackendutils_p.h:32
BackendUtilsImpl::isWindowsPlatform
bool isWindowsPlatform()
Definition
mediabackendutils_p.h:57
BackendUtilsImpl::isGStreamerPlatform
bool isGStreamerPlatform()
Definition
mediabackendutils_p.h:27
BackendUtilsImpl::isOhosPlatform
bool isOhosPlatform()
Definition
mediabackendutils_p.h:47
BackendUtilsImpl::isOpenGLSupported
bool isOpenGLSupported()
Definition
mediabackendutils_p.h:68
BackendUtilsImpl::isAndroidPlatform
bool isAndroidPlatform()
Definition
mediabackendutils_p.h:42
BackendUtilsImpl::isRhiRenderingSupported
bool isRhiRenderingSupported()
Definition
mediabackendutils_p.h:62
qtmultimedia
src
multimediatestlib
mediabackendutils_p.h
Generated on
for Qt by
1.16.1