Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwasmmediadevices_p.h
Go to the documentation of this file.
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 QWASMMEDIADEVICES_H
5#define QWASMMEDIADEVICES_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/qplatformmediadevices_p.h>
19
20#include <private/qplatformvideodevices_p.h>
21
22#include <QtCore/private/qstdweb_p.h>
23#include <qaudio.h>
24#include <qaudiodevice.h>
25#include <qcameradevice.h>
26#include <qset.h>
27#include <QtCore/qloggingcategory.h>
28
29#include <emscripten.h>
30#include <emscripten/val.h>
31#include <emscripten/bind.h>
32#include <QMapIterator>
34
35Q_DECLARE_LOGGING_CATEGORY(qWasmMediaDevices)
36
37class QWasmAudioEngine;
38
40{
42public:
44
45 QList<QCameraDevice> videoDevices() const override;
46private:
47 // weak
48 QPlatformMediaDevices *m_mediaDevices;
49};
50
52{
53public:
55
56 QList<QAudioDevice> audioInputs() const override;
57 QList<QAudioDevice> audioOutputs() const override;
58 QList<QCameraDevice> videoInputs() const;
59
61 QObject *parent) override;
63 QObject *parent) override;
64 void initDevices();
65
66private:
67 void updateCameraDevices();
68 void getMediaDevices();
69 void getOpenALAudioDevices();
70 void parseDevices(emscripten::val devices);
71
72 QMap <std::string, QAudioDevice> m_audioOutputs;
73 QMap <std::string, QAudioDevice> m_audioInputs;
74 QMap <std::string, QCameraDevice> m_cameraDevices;
75
76
77 std::unique_ptr<qstdweb::EventCallback> m_deviceChangedCallback;
78
79 bool m_videoInputsAdded = false;
80 bool m_audioInputsAdded = false;
81 bool m_audioOutputsAdded = false;
82 emscripten::val m_jsMediaDevicesInterface = emscripten::val::undefined();
83 bool m_initDone = false;
84 bool m_firstInit = false;
85};
86
88
89#endif
The QAudioDevice class provides an information about audio devices and their functionality.
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
QWasmCameraDevices(QPlatformMediaIntegration *integration)
QList< QCameraDevice > videoDevices() const override
QList< QAudioDevice > audioInputs() const override
QList< QAudioDevice > audioOutputs() const override
QList< QCameraDevice > videoInputs() const
QPlatformAudioSource * createAudioSource(const QAudioDevice &deviceInfo, QObject *parent) override
QPlatformAudioSink * createAudioSink(const QAudioDevice &deviceInfo, QObject *parent) override
Combined button and popup list for selecting options.
EGLDeviceEXT * devices
#define Q_DECLARE_LOGGING_CATEGORY(name)
#define Q_OBJECT