Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
6#include "mediaplayer/qwasmmediaplayer_p.h"
7#include <QtMultimedia/private/qplatformvideosink_p.h>
8#include "common/qwasmaudioinput_p.h"
9#include "common/qwasmaudiooutput_p.h"
10#include "mediacapture/qwasmmediacapturesession_p.h"
11#include "mediacapture/qwasmmediarecorder_p.h"
12#include "mediacapture/qwasmcamera_p.h"
13#include "mediacapture/qwasmimagecapture_p.h"
14#include "mediacapture/qwasmscreencapture_p.h"
15#include "mediacapture/qwasmwindowcapture_p.h"
16#include "mediacapture/qwasmcapturablewindows_p.h"
17
18#include <QtMultimedia/qcamera.h>
19#include <QtMultimedia/qcameradevice.h>
20#include <QtMultimedia/private/qplatformaudiodevices_p.h>
21#include <QtMultimedia/private/qplatformmediaformatinfo_p.h>
22#include <QtMultimedia/private/qplatformmediaplugin_p.h>
23#include <QtMultimedia/private/qplatformvideodevices_p.h>
24#include <QtCore/qloggingcategory.h>
25
26#include <private/qwasmaudiodecoder_p.h>
27
29
30
32{
33 Q_OBJECT
34 Q_PLUGIN_METADATA(IID QPlatformMediaPlugin_iid FILE "wasm.json")
35
36public:
40
42 {
43 if (name == u"wasm")
44 return new QWasmMediaIntegration;
45 return nullptr;
46 }
47};
48
51
53{
54 return new QWasmMediaPlayer(player);
55}
56
58{
59 return new QOpenGLRhiVideoSink(sink);
60}
61
63{
64 return new QWasmAudioInput(audioInput);
65}
66
68{
69 return new QWasmAudioOutput(q);
70}
71
74{
75 return new QWasmAudioDecoder(decoder);
76}
77
79{
80 // TODO: create custom implementation
81 return new QPlatformMediaFormatInfo;
82}
83
85{
86 return new QWasmCameraDevices(this);
87}
88
93
95{
96 return new QWasmMediaRecorder(recorder);
97}
98
100{
101 return new QWasmCamera(camera);
102}
103
105QWasmMediaIntegration::createImageCapture(QImageCapture *imageCapture)
106{
107 return new QWasmImageCapture(imageCapture);
108}
109
111{
112 return videoDevices()->videoInputs();
113}
114
116{
117 return new QWasmScreenCapture(screenCapture);
118}
119
121{
122 return new QWasmWindowCapture(windowCapture);
123}
124
126{
127 return new QWasmCapturableWindows();
128}
129
130QT_END_NAMESPACE
131
132#include "qwasmmediaintegration.moc"
QList< QCameraDevice > videoInputs()
QPlatformVideoDevices * createVideoDevices() override
q23::expected< QPlatformCamera *, QString > createCamera(QCamera *camera) override
q23::expected< QPlatformMediaPlayer *, QString > createPlayer(QMediaPlayer *player) override
QPlatformMediaFormatInfo * createFormatInfo() override
QPlatformCapturableWindows * createCapturableWindows() override
q23::expected< QPlatformVideoSink *, QString > createVideoSink(QVideoSink *sink) override
QPlatformSurfaceCapture * createWindowCapture(QWindowCapture *windowCapture) override
q23::expected< QPlatformAudioInput *, QString > createAudioInput(QAudioInput *audioInput) override
q23::expected< QPlatformAudioOutput *, QString > createAudioOutput(QAudioOutput *q) override
QPlatformSurfaceCapture * createScreenCapture(QScreenCapture *screenCapture) override
q23::expected< QPlatformAudioDecoder *, QString > createAudioDecoder(QAudioDecoder *decoder) override
q23::expected< QPlatformImageCapture *, QString > createImageCapture(QImageCapture *imageCapture) override
q23::expected< QPlatformMediaCaptureSession *, QString > createCaptureSession() override
q23::expected< QPlatformMediaRecorder *, QString > createRecorder(QMediaRecorder *recorder) override
QWasmMediaRecorder(QMediaRecorder *parent)
Combined button and popup list for selecting options.