Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
mediabackendutils.cpp
Go to the documentation of this file.
1
// Copyright (C) 2026 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4
#
include
"mediabackendutils_p.h"
5
6
#
include
<
QtCore
/
qbytearray
.
h
>
7
#
include
<
QtCore
/
qlist
.
h
>
8
9
namespace
BackendUtilsImpl
{
10
11
void
addMediaBackendToTestEnvironment
(
const
QString &backend)
12
{
13
const
QByteArray backendName = backend.toLower().toUtf8();
14
const
QByteArray backendKey = backendName +
"-mediabackend"
;
15
QByteArray testEnvironment = qgetenv(
"QTEST_ENVIRONMENT"
);
16
bool
hasBackendKey =
false
;
17
const
QList<QByteArray> keys = testEnvironment.split(
' '
);
18
for
(
const
QByteArray &key : keys) {
19
if
(!key.endsWith(
"-mediabackend"
))
20
continue
;
21
if
(key != backendKey) {
22
qFatal(
23
"QTEST_ENVIRONMENT contains '%s', but the media backend in use is '%s'"
,
24
key.constData(),
25
backendName.constData());
26
}
27
hasBackendKey =
true
;
28
}
29
if
(!hasBackendKey) {
30
if
(!testEnvironment.isEmpty())
31
testEnvironment +=
' '
;
32
testEnvironment += backendKey;
33
qputenv(
"QTEST_ENVIRONMENT"
, testEnvironment);
34
}
35
}
36
37
}
// namespace BackendUtilsImpl
BackendUtilsImpl
Definition
mediabackendutils.cpp:9
BackendUtilsImpl::addMediaBackendToTestEnvironment
void addMediaBackendToTestEnvironment(const QString &backend)
Definition
mediabackendutils.cpp:11
qtmultimedia
src
multimediatestlib
mediabackendutils.cpp
Generated on
for Qt by
1.18.0