72 static QPlatformMediaIntegration *instance();
74 explicit QPlatformMediaIntegration(QLatin1String);
75 ~QPlatformMediaIntegration() override;
76 const QPlatformMediaFormatInfo *formatInfo();
78 virtual q23::expected<QPlatformCamera *, QString> createCamera(QCamera *)
80 return q23::unexpected{ notAvailable };
82 virtual QPlatformSurfaceCapture *createScreenCapture(QScreenCapture *) {
return nullptr; }
83 virtual QPlatformSurfaceCapture *createWindowCapture(QWindowCapture *) {
return nullptr; }
85 virtual q23::expected<QPlatformAudioDecoder *, QString> createAudioDecoder(QAudioDecoder *)
87 return q23::unexpected{ notAvailable };
89 virtual q23::expected<std::unique_ptr<QPlatformAudioResampler>, QString>
90 createAudioResampler(
const QAudioFormat & ,
91 const QAudioFormat & );
92 virtual q23::expected<QPlatformMediaCaptureSession *, QString> createCaptureSession()
94 return q23::unexpected{ notAvailable };
96 virtual q23::expected<QPlatformMediaPlayer *, QString> createPlayer(QMediaPlayer *)
98 return q23::unexpected{ notAvailable };
100 virtual q23::expected<QPlatformMediaRecorder *, QString> createRecorder(QMediaRecorder *)
102 return q23::unexpected{ notAvailable };
104 virtual q23::expected<QPlatformImageCapture *, QString> createImageCapture(QImageCapture *)
106 return q23::unexpected{ notAvailable };
109 virtual q23::expected<QPlatformAudioInput *, QString> createAudioInput(QAudioInput *);
110 virtual q23::expected<QPlatformAudioOutput *, QString> createAudioOutput(QAudioOutput *);
112 virtual q23::expected<QPlatformVideoSink *, QString> createVideoSink(QVideoSink *)
114 return q23::unexpected{ notAvailable };
117 QList<QCapturableWindow> capturableWindowsList();
118 bool isCapturableWindowValid(
const QCapturableWindowPrivate &);
119 [[nodiscard]] q23::expected<QCapturableWindow, QString> capturableWindowFromQWindow(QWindow *);
121 QPlatformVideoDevices *videoDevices();
123 QPlatformCapturableWindows *capturableWindows();
125 QPlatformAudioDevices *audioDevices();
127 static QStringList availableBackends();
128 QLatin1String name();
131 virtual QVideoFrame convertVideoFrame(QVideoFrame &,
const QVideoFrameFormat &);
133 virtual QAbstractPlatformSpecificInterface *platformSpecificInterface() {
return nullptr; }
135 static QLatin1String audioBackendName();
138 virtual QPlatformMediaFormatInfo *createFormatInfo();
140 virtual QPlatformVideoDevices *createVideoDevices() {
return nullptr; }
142 virtual QPlatformCapturableWindows *createCapturableWindows() {
return nullptr; }
144 virtual std::unique_ptr<QPlatformAudioDevices> createAudioDevices();
146 inline static const QString notAvailable = QStringLiteral(
"Not available");
149 friend class QMockIntegration;
150 void resetInstance();
153 std::unique_ptr<QPlatformVideoDevices> m_videoDevices;
154 std::once_flag m_videoDevicesOnceFlag;
156 std::unique_ptr<QPlatformCapturableWindows> m_capturableWindows;
157 std::once_flag m_capturableWindowsOnceFlag;
159 mutable std::unique_ptr<QPlatformMediaFormatInfo> m_formatInfo;
160 mutable std::once_flag m_formatInfoOnceFlg;
162 std::unique_ptr<QPlatformAudioDevices> m_audioDevices;
163 std::once_flag m_audioDevicesOnceFlag;
165 const QLatin1String m_backendName;