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
isFFMPEGPlatform
()
48
{
49
return
QPlatformMediaIntegration::instance()->name() ==
"ffmpeg"_L1
;
50
}
51
52
inline
bool
isWindowsPlatform
()
53
{
54
return
QPlatformMediaIntegration::instance()->name() ==
"windows"_L1
;
55
}
56
57
inline
bool
isRhiRenderingSupported
()
58
{
59
return
QGuiApplicationPrivate::platformIntegration()->hasCapability(
60
QPlatformIntegration::RhiBasedRendering);
61
}
62
63
inline
bool
isOpenGLSupported
()
64
{
65
return
QGuiApplicationPrivate::platformIntegration()->hasCapability(
66
QPlatformIntegration::OpenGL);
67
}
68
69
inline
bool
isCI
()
70
{
71
return
qEnvironmentVariable(
"QTEST_ENVIRONMENT"
).toLower().split(u' ').contains(u"ci"_s);
72
}
73
74
}
// namespace BackendUtilsImpl
75
76
using
namespace
BackendUtilsImpl
;
77
78
#
define
QSKIP_IF
(
checker
,
defaultMessage
,
/*messageOpt*/
...
)
79
do
{
80
if
(
checker
)
81
QSKIP
(
strlen
(
__VA_ARGS__
""
)
?
__VA_ARGS__
""
:
defaultMessage
)
;
82
}
while
(
0
)
83
84
#
define
QSKIP_GSTREAMER
(
/*messageOpt*/
...
)
85
QSKIP_IF
(
isGStreamerPlatform
(
)
,
"The feature is not supported on GStreamer"
,
__VA_ARGS__
)
86
87
#
define
QSKIP_IF_NOT_FFMPEG
(
/*messageOpt*/
...
)
88
QSKIP_IF
(
!
isFFMPEGPlatform
(
)
,
"The feature is only supported on FFmpeg"
,
__VA_ARGS__
)
89
90
#
define
QSKIP_FFMPEG
(
/*messageOpt*/
...
)
91
QSKIP_IF
(
isFFMPEGPlatform
(
)
,
"The feature is not supported on FFmpeg"
,
__VA_ARGS__
)
92
93
#
define
QEXPECT_FAIL_GSTREAMER
(
dataIndex
,
comment
,
mode
)
94
do
{
95
if
(
isGStreamerPlatform
(
)
)
96
QEXPECT_FAIL
(
dataIndex
,
comment
,
mode
)
;
97
}
while
(
0
)
98
99
#
endif
// MEDIABACKENDUTILS_H
QSKIP_IF
#define QSKIP_IF(checker, defaultMessage,...)
Definition
mediabackendutils_p.h:78
BackendUtilsImpl
Definition
mediabackendutils_p.h:23
BackendUtilsImpl::isFFMPEGPlatform
bool isFFMPEGPlatform()
Definition
mediabackendutils_p.h:47
BackendUtilsImpl::isDarwinPlatform
bool isDarwinPlatform()
Definition
mediabackendutils_p.h:37
BackendUtilsImpl::isCI
bool isCI()
Definition
mediabackendutils_p.h:69
BackendUtilsImpl::isQNXPlatform
bool isQNXPlatform()
Definition
mediabackendutils_p.h:32
BackendUtilsImpl::isWindowsPlatform
bool isWindowsPlatform()
Definition
mediabackendutils_p.h:52
BackendUtilsImpl::isGStreamerPlatform
bool isGStreamerPlatform()
Definition
mediabackendutils_p.h:27
BackendUtilsImpl::isOpenGLSupported
bool isOpenGLSupported()
Definition
mediabackendutils_p.h:63
BackendUtilsImpl::isAndroidPlatform
bool isAndroidPlatform()
Definition
mediabackendutils_p.h:42
BackendUtilsImpl::isRhiRenderingSupported
bool isRhiRenderingSupported()
Definition
mediabackendutils_p.h:57
qtmultimedia
src
multimediatestlib
mediabackendutils_p.h
Generated on
for Qt by
1.14.0