80 static QPlatformMediaIntegration *instance();
82 explicit QPlatformMediaIntegration(QLatin1String);
83 ~QPlatformMediaIntegration() override;
84 const QPlatformMediaFormatInfo *formatInfo();
86 virtual q23::expected<QPlatformCamera *, QString> createCamera(QCamera *)
88 return q23::unexpected{ notAvailable };
90 virtual QPlatformSurfaceCapture *createScreenCapture(QScreenCapture *) {
return nullptr; }
91 virtual QPlatformSurfaceCapture *createWindowCapture(QWindowCapture *) {
return nullptr; }
93 virtual q23::expected<QPlatformAudioDecoder *, QString> createAudioDecoder(QAudioDecoder *)
95 return q23::unexpected{ notAvailable };
97 virtual q23::expected<std::unique_ptr<QPlatformAudioResampler>, QString>
98 createAudioResampler(
const QAudioFormat & ,
99 const QAudioFormat & );
100 virtual q23::expected<QPlatformMediaCaptureSession *, QString> createCaptureSession()
102 return q23::unexpected{ notAvailable };
104 virtual q23::expected<QPlatformMediaPlayer *, QString> createPlayer(QMediaPlayer *)
106 return q23::unexpected{ notAvailable };
108 virtual q23::expected<QPlatformMediaRecorder *, QString> createRecorder(QMediaRecorder *)
110 return q23::unexpected{ notAvailable };
112 virtual q23::expected<QPlatformImageCapture *, QString> createImageCapture(QImageCapture *)
114 return q23::unexpected{ notAvailable };
117 virtual q23::expected<QPlatformAudioInput *, QString> createAudioInput(QAudioInput *);
118 virtual q23::expected<QPlatformAudioOutput *, QString> createAudioOutput(QAudioOutput *);
120 virtual q23::expected<QPlatformVideoSink *, QString> createVideoSink(QVideoSink *)
122 return q23::unexpected{ notAvailable };
125 QList<QCapturableWindow> capturableWindowsList();
126 bool isCapturableWindowValid(
const QCapturableWindowPrivate &);
127 [[nodiscard]] q23::expected<QCapturableWindow, QString> capturableWindowFromQWindow(QWindow *);
129 QPlatformVideoDevices *videoDevices();
131 QPlatformCapturableWindows *capturableWindows();
133 QPlatformAudioDevices *audioDevices();
135 static QStringList availableBackends();
136 QLatin1String name();
139 virtual QVideoFrame convertVideoFrame(QVideoFrame &,
const QVideoFrameFormat &);
141 static QLatin1String audioBackendName();
143 virtual bool isCameraSwitchingDuringRecordingSupported()
const {
return true; }
145 virtual q23::expected<QPlatformCamera *, QString>
146 createGStreamerVideoSource(QGStreamerVideoSource *,
const GstElementOrDescription &)
148 return q23::unexpected{ notAvailable };
151 virtual QGStreamerInterface *gstreamerInterface() {
return nullptr; }
153 void resetInstance();
156 virtual QPlatformMediaFormatInfo *createFormatInfo();
158 virtual QPlatformVideoDevices *createVideoDevices() {
return nullptr; }
160 virtual QPlatformCapturableWindows *createCapturableWindows() {
return nullptr; }
162 virtual std::unique_ptr<QPlatformAudioDevices> createAudioDevices();
164 inline static const QString notAvailable = QStringLiteral(
"Not available");
167 friend class QMockIntegration;
170 std::unique_ptr<QPlatformVideoDevices> m_videoDevices;
171 std::once_flag m_videoDevicesOnceFlag;
173 std::unique_ptr<QPlatformCapturableWindows> m_capturableWindows;
174 std::once_flag m_capturableWindowsOnceFlag;
176 mutable std::unique_ptr<QPlatformMediaFormatInfo> m_formatInfo;
177 mutable std::once_flag m_formatInfoOnceFlg;
179 std::unique_ptr<QPlatformAudioDevices> m_audioDevices;
180 std::once_flag m_audioDevicesOnceFlag;
182 const QLatin1String m_backendName;