1 | // Copyright (C) 2021 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 QPLATFORMMEDIADEVICES_H |
5 | #define QPLATFORMMEDIADEVICES_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 <private/qtmultimediaglobal_p.h> |
19 | #include <qlist.h> |
20 | #include <qobject.h> |
21 | #include <mutex> |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | class QMediaDevices; |
26 | class QAudioDevice; |
27 | class QCameraDevice; |
28 | class QPlatformAudioSource; |
29 | class QPlatformAudioSink; |
30 | class QAudioFormat; |
31 | class QPlatformMediaIntegration; |
32 | |
33 | class Q_MULTIMEDIA_EXPORT QPlatformMediaDevices : public QObject |
34 | { |
35 | Q_OBJECT |
36 | public: |
37 | QPlatformMediaDevices(); |
38 | ~QPlatformMediaDevices() override; |
39 | |
40 | static void setDevices(QPlatformMediaDevices *); |
41 | static QPlatformMediaDevices *instance(); |
42 | |
43 | virtual QList<QAudioDevice> audioInputs() const; |
44 | virtual QList<QAudioDevice> audioOutputs() const; |
45 | |
46 | virtual QPlatformAudioSource *createAudioSource(const QAudioDevice &, QObject *parent); |
47 | virtual QPlatformAudioSink *createAudioSink(const QAudioDevice &, QObject *parent); |
48 | |
49 | QPlatformAudioSource *audioInputDevice(const QAudioFormat &format, |
50 | const QAudioDevice &deviceInfo, QObject *parent); |
51 | QPlatformAudioSink *audioOutputDevice(const QAudioFormat &format, |
52 | const QAudioDevice &deviceInfo, QObject *parent); |
53 | |
54 | virtual void prepareAudio(); |
55 | |
56 | void initVideoDevicesConnection(); |
57 | |
58 | Q_SIGNALS: |
59 | void audioInputsChanged(); |
60 | void audioOutputsChanged(); |
61 | void videoInputsChanged(); |
62 | |
63 | private: |
64 | std::once_flag m_videoDevicesConnectionFlag; |
65 | }; |
66 | |
67 | QT_END_NAMESPACE |
68 | |
69 | |
70 | #endif // QPLATFORMMEDIADEVICES_H |
71 |