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
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:
38
40 {
41 if (name == u"wasm")
42 return new QWasmMediaIntegration;
43 return nullptr;
44 }
45};
46
49
51{
52 return new QWasmMediaPlayer(player);
53}
54
56{
57 return new QWasmVideoSink(sink);
58}
59
60QMaybe<QPlatformAudioInput *> QWasmMediaIntegration::createAudioInput(QAudioInput *audioInput)
61{
62 return new QWasmAudioInput(audioInput);
63}
64
66{
67 return new QWasmAudioOutput(q);
68}
69
71{
72 // TODO: create custom implementation
73 return new QPlatformMediaFormatInfo;
74}
75
80
81QMaybe<QPlatformMediaCaptureSession *> QWasmMediaIntegration::createCaptureSession()
82{
83 return new QWasmMediaCaptureSession();
84}
85
87{
88 return new QWasmMediaRecorder(recorder);
89}
90
92{
93 return new QWasmCamera(camera);
94}
95
96QMaybe<QPlatformImageCapture *>
101
103{
104 return videoDevices()->videoDevices();
105}
106
108
109#include "qwasmmediaintegration.moc"
QMediaPlayer player
Definition audio.cpp:213
\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
The QMediaPlayer class allows the playing of a media files.
\inmodule QtMultimedia
QPlatformVideoDevices * videoDevices()
virtual QList< QCameraDevice > videoDevices() const =0
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
QMaybe< QPlatformAudioInput * > createAudioInput(QAudioInput *audioInput) override
QList< QCameraDevice > videoInputs() override
QPlatformVideoDevices * createVideoDevices() override
QPlatformMediaFormatInfo * createFormatInfo() override
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
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
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)