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
qwindowsintegration.cpp
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
5
6#include <decoder/mfaudiodecodercontrol_p.h>
7#include <mediacapture/qwindowscamera_p.h>
8#include <mediacapture/qwindowsimagecapture_p.h>
9#include <mediacapture/qwindowsmediacapture_p.h>
10#include <mediacapture/qwindowsmediaencoder_p.h>
11#include <player/qmediaengineplayer_p.h>
12#include <qmediaenginevideosink_p.h>
13#include <qwindowsformatinfo_p.h>
14
15#include <QtMultimedia/private/qplatformmediaplugin_p.h>
16#include <QtMultimedia/private/qwindowsaudiodevices_p.h>
17#include <QtCore/private/qfunctions_win_p.h>
18#include <QtCore/private/qsystemerror_p.h>
19
21
22using namespace Qt::StringLiterals;
23
25{
26 Q_OBJECT
27 Q_PLUGIN_METADATA(IID QPlatformMediaPlugin_iid FILE "windows.json")
28
29public:
33
35 {
36 if (name != u"windows")
37 return nullptr;
38
41 if (SUCCEEDED(hr))
42 return new QWindowsMediaIntegration;
43
44 qWarning() << "Failed to initialize Media Foundation:"
46 return nullptr;
47 }
48};
49
50QWindowsMediaIntegration::QWindowsMediaIntegration()
51 : QPlatformMediaIntegration("windows"_L1)
52{}
53
58
60{
61 return new QWindowsFormatInfo();
62}
63
65{
66 return new QWindowsVideoDevices(this);
67}
68
73
78
80{
81 return new QMediaEnginePlayer(parent);
82}
83
85{
86 return new QWindowsCamera(camera);
87}
88
90{
91 return new QWindowsMediaEncoder(recorder);
92}
93
95{
96 return new QWindowsImageCapture(imageCapture);
97}
98
100{
101 return new QMediaEngineVideoSink(sink);
102}
103
104QT_END_NAMESPACE
105
106#include "qwindowsintegration.moc"
q23::expected< QPlatformVideoSink *, QString > createVideoSink(QVideoSink *sink) override
QPlatformMediaFormatInfo * createFormatInfo() override
q23::expected< QPlatformAudioDecoder *, QString > createAudioDecoder(QAudioDecoder *decoder) override
q23::expected< QPlatformCamera *, QString > createCamera(QCamera *camera) override
q23::expected< QPlatformImageCapture *, QString > createImageCapture(QImageCapture *imageCapture) override
QPlatformVideoDevices * createVideoDevices() override
q23::expected< QPlatformMediaRecorder *, QString > createRecorder(QMediaRecorder *recorder) override
q23::expected< QPlatformMediaPlayer *, QString > createPlayer(QMediaPlayer *parent) override
q23::expected< QPlatformMediaCaptureSession *, QString > createCaptureSession() override
Combined button and popup list for selecting options.