Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwasmmediaintegration.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 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
5#include <QLoggingCategory>
6
7#include <QCamera>
8#include <QCameraDevice>
9
10#include <private/qplatformmediaformatinfo_p.h>
11#include <private/qplatformmediaplugin_p.h>
12#include <private/qplatformmediadevices_p.h>
13#include <private/qplatformvideodevices_p.h>
14
17#include "qwasmaudioinput_p.h"
19
25
27
28
30{
33
34public:
37 {}
38
40 {
41 if (name == QLatin1String("wasm"))
42 return new QWasmMediaIntegration;
43 return nullptr;
44 }
45};
46
48{
49 m_videoDevices = std::make_unique<QWasmCameraDevices>(this);
50}
51
53{
54 delete m_formatInfo;
55}
56
58{
59 return new QWasmMediaPlayer(player);
60}
61
63{
64 return new QWasmVideoSink(sink);
65}
66
68{
69 return new QWasmAudioInput(audioInput);
70}
71
73{
74 return new QWasmAudioOutput(q);
75}
76
78{
79 if (!m_formatInfo) {
81 }
82 return m_formatInfo;
83}
84
86{
87 return new QWasmMediaCaptureSession();
88}
89
91{
92 return new QWasmMediaRecorder(recorder);
93}
94
96{
97 return new QWasmCamera(camera);
98}
99
102{
104}
105
107{
108 return m_videoDevices->videoDevices();
109}
110
112
113#include "qwasmmediaintegration.moc"
QMediaPlayer player
Definition audio.cpp:205
\qmltype AudioInput \instantiates QAudioInput
Definition qaudioinput.h:19
\qmltype AudioOutput \instantiates QAudioOutput
The QCamera class provides interface for system camera devices.
Definition qcamera.h:28
\inmodule QtMultimedia
Definition qlist.h:74
The QMediaPlayer class allows the playing of a media files.
\inmodule QtMultimedia
std::unique_ptr< QPlatformVideoDevices > m_videoDevices
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
QMaybe< QPlatformAudioInput * > createAudioInput(QAudioInput *audioInput) override
QList< QCameraDevice > videoInputs() override
QPlatformMediaFormatInfo * m_formatInfo
QMaybe< QPlatformVideoSink * > createVideoSink(QVideoSink *sink) override
QMaybe< QPlatformAudioOutput * > createAudioOutput(QAudioOutput *q) override
QMaybe< QPlatformImageCapture * > createImageCapture(QImageCapture *imageCapture) override
QMaybe< QPlatformMediaCaptureSession * > createCaptureSession() override
QMaybe< QPlatformMediaPlayer * > createPlayer(QMediaPlayer *player) override
QMaybe< QPlatformMediaRecorder * > createRecorder(QMediaRecorder *recorder) override
QPlatformMediaFormatInfo * formatInfo() override
QMaybe< QPlatformCamera * > createCamera(QCamera *camera) override
QPlatformMediaIntegration * create(const QString &name) override
QMediaRecorder * recorder
Definition camera.cpp:20
QCamera * camera
Definition camera.cpp:19
QImageCapture * imageCapture
Definition camera.cpp:21
Combined button and popup list for selecting options.
GLuint name
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLsizei GLenum GLboolean sink
#define QPlatformMediaPlugin_iid
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)