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#include <private/qwindowsaudiodevices_p.h>
6#include <qwindowsformatinfo_p.h>
7#include <qwindowsmediacapture_p.h>
8#include <qwindowsimagecapture_p.h>
9#include <qwindowscamera_p.h>
10#include <qwindowsmediaencoder_p.h>
11#include <mfplayercontrol_p.h>
12#include <mfaudiodecodercontrol_p.h>
13#include <mfevrvideowindowcontrol_p.h>
14#include <private/qplatformmediaplugin_p.h>
15
16#include <QtCore/private/qfunctions_win_p.h>
17#include <QtCore/private/qsystemerror_p.h>
18
20
21using namespace Qt::StringLiterals;
22
24{
25 Q_OBJECT
26 Q_PLUGIN_METADATA(IID QPlatformMediaPlugin_iid FILE "windows.json")
27
28public:
32
34 {
35 if (name != u"windows")
36 return nullptr;
37
40 if (SUCCEEDED(hr))
41 return new QWindowsMediaIntegration;
42
43 qWarning() << "Failed to initialize Media Foundation:"
45 return nullptr;
46 }
47};
48
49QWindowsMediaIntegration::QWindowsMediaIntegration()
50 : QPlatformMediaIntegration("windows"_L1)
51{}
52
57
59{
60 return new QWindowsFormatInfo();
61}
62
64{
65 return new QWindowsVideoDevices(this);
66}
67
72
77
79{
80 return new MFPlayerControl(parent);
81}
82
84{
85 return new QWindowsCamera(camera);
86}
87
89{
90 return new QWindowsMediaEncoder(recorder);
91}
92
94{
95 return new QWindowsImageCapture(imageCapture);
96}
97
102
103QT_END_NAMESPACE
104
105#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.