1// Copyright (C) 2016 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 QMEDIADEVICES_H
5#define QMEDIADEVICES_H
6
7#include <QtMultimedia/qtmultimediaglobal.h>
8#include <QtCore/qobject.h>
9#include <QtCore/qstringlist.h>
10
11QT_BEGIN_NAMESPACE
12
13class QAudioDevice;
14class QCameraDevice;
15
16class QMediaDevicesPrivate;
17
18class Q_MULTIMEDIA_EXPORT QMediaDevices : public QObject
19{
20 Q_OBJECT
21 Q_PROPERTY(QList<QAudioDevice> audioInputs READ audioInputs NOTIFY audioInputsChanged)
22 Q_PROPERTY(QList<QAudioDevice> audioOutputs READ audioOutputs NOTIFY audioOutputsChanged)
23 Q_PROPERTY(QList<QCameraDevice> videoInputs READ videoInputs NOTIFY videoInputsChanged)
24 Q_PROPERTY(QAudioDevice defaultAudioInput READ defaultAudioInput NOTIFY audioInputsChanged)
25 Q_PROPERTY(QAudioDevice defaultAudioOutput READ defaultAudioOutput NOTIFY audioOutputsChanged)
26 Q_PROPERTY(QCameraDevice defaultVideoInput READ defaultVideoInput NOTIFY videoInputsChanged)
27
28public:
29 QMediaDevices(QObject *parent = nullptr);
30 ~QMediaDevices();
31
32 static QList<QAudioDevice> audioInputs();
33 static QList<QAudioDevice> audioOutputs();
34 static QList<QCameraDevice> videoInputs();
35
36 static QAudioDevice defaultAudioInput();
37 static QAudioDevice defaultAudioOutput();
38 static QCameraDevice defaultVideoInput();
39
40Q_SIGNALS:
41 void audioInputsChanged();
42 void audioOutputsChanged();
43 void videoInputsChanged();
44
45protected:
46 void connectNotify(const QMetaMethod &signal) override;
47
48private:
49 friend class QMediaDevicesPrivate;
50};
51
52QT_END_NAMESPACE
53
54
55#endif // QABSTRACTMEDIASERVICE_H
56
57

source code of qtmultimedia/src/multimedia/qmediadevices.h