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
qavaudiosessionmanager_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QAVAUDIOSESSIONMANAGER_P_H
5#define QAVAUDIOSESSIONMANAGER_P_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 <QtMultimedia/qtmultimediaexports.h>
19
20#include <QtCore/qobject.h>
21#include <QtCore/qmutex.h>
22#include <QtCore/private/qcore_mac_p.h>
23
24#include <array>
25#include <cstdint>
26#include <memory>
27#include <utility>
28#include <vector>
29
30#import <AVFoundation/AVAudioSession.h>
31
32QT_BEGIN_NAMESPACE
33
34namespace QtMultimediaPrivate {
35
41
42// On iOS, this activates the single, process-wide shared AVAudioSession. Other code in
43// the same process that also manages AVAudioSession may conflict with this activation.
44class Q_MULTIMEDIA_EXPORT QAVAudioSessionManager final : public QObject
45{
47public:
49
52
53 enum class TokenId : std::uint64_t {};
54
76
78
79 // Reasserts activation of the shared AVAudioSession using the configuration derived from
80 // currently live ActivationTokens, without changing which tokens are live. Intended for use
81 // by QAVAudioSessionRecovery only, after the OS itself deactivated the session (e.g. an
82 // interruption or media services reset) while our own set of clients hasn't changed.
83 bool reassertActivation();
84
90
91private:
92 friend class ActivationToken;
93
96
100
102
103 const std::shared_ptr<bool> m_destroyed = std::make_shared<bool>(false);
104};
105
106} // namespace QtMultimediaPrivate
107
108QT_END_NAMESPACE
109
110#endif // QAVAUDIOSESSIONMANAGER_P_H
Combined button and popup list for selecting options.