79 static QPlatformMediaIntegration *instance();
81 explicit QPlatformMediaIntegration(QLatin1String);
82 ~QPlatformMediaIntegration() override;
83 const QPlatformMediaFormatInfo *formatInfo();
85 virtual q23::expected<QPlatformCamera *, QString> createCamera(QCamera *)
87 return q23::unexpected{ notAvailable };
89 virtual QPlatformSurfaceCapture *createScreenCapture(QScreenCapture *) {
return nullptr; }
90 virtual QPlatformSurfaceCapture *createWindowCapture(QWindowCapture *) {
return nullptr; }
92 virtual q23::expected<QPlatformAudioDecoder *, QString> createAudioDecoder(QAudioDecoder *)
94 return q23::unexpected{ notAvailable };
96 virtual q23::expected<std::unique_ptr<QPlatformAudioResampler>, QString>
97 createAudioResampler(
const QAudioFormat & ,
98 const QAudioFormat & );
99 virtual q23::expected<QPlatformMediaCaptureSession *, QString> createCaptureSession()
101 return q23::unexpected{ notAvailable };
103 virtual q23::expected<QPlatformMediaPlayer *, QString> createPlayer(QMediaPlayer *)
105 return q23::unexpected{ notAvailable };
107 virtual q23::expected<QPlatformMediaRecorder *, QString> createRecorder(QMediaRecorder *)
109 return q23::unexpected{ notAvailable };
111 virtual q23::expected<QPlatformImageCapture *, QString> createImageCapture(QImageCapture *)
113 return q23::unexpected{ notAvailable };
116 virtual q23::expected<QPlatformAudioInput *, QString> createAudioInput(QAudioInput *);
117 virtual q23::expected<QPlatformAudioOutput *, QString> createAudioOutput(QAudioOutput *);
119 virtual q23::expected<QPlatformVideoSink *, QString> createVideoSink(QVideoSink *)
121 return q23::unexpected{ notAvailable };
124 virtual q23::expected<QPlatformCamera *, QString>
125 createGStreamerVideoSource(QGStreamerVideoSource *,
const GstElementOrDescription &)
127 return q23::unexpected{ notAvailable };
130 QList<QCapturableWindow> capturableWindowsList();
131 bool isCapturableWindowValid(
const QCapturableWindowPrivate &);
132 [[nodiscard]] q23::expected<QCapturableWindow, QString> capturableWindowFromQWindow(QWindow *);
134 QPlatformVideoDevices *videoDevices();
136 QPlatformCapturableWindows *capturableWindows();
138 QPlatformAudioDevices *audioDevices();
140 static QStringList availableBackends();
141 QLatin1String name();
144 virtual QVideoFrame convertVideoFrame(QVideoFrame &,
const QVideoFrameFormat &);
146 virtual QAbstractPlatformSpecificInterface *platformSpecificInterface() {
return nullptr; }
148 static QLatin1String audioBackendName();
150 virtual bool isCameraSwitchingDuringRecordingSupported()
const {
return true; }
153 virtual QPlatformMediaFormatInfo *createFormatInfo();
155 virtual QPlatformVideoDevices *createVideoDevices() {
return nullptr; }
157 virtual QPlatformCapturableWindows *createCapturableWindows() {
return nullptr; }
159 virtual std::unique_ptr<QPlatformAudioDevices> createAudioDevices();
161 inline static const QString notAvailable = QStringLiteral(
"Not available");
164 friend class QMockIntegration;
165 void resetInstance();
168 std::unique_ptr<QPlatformVideoDevices> m_videoDevices;
169 std::once_flag m_videoDevicesOnceFlag;
171 std::unique_ptr<QPlatformCapturableWindows> m_capturableWindows;
172 std::once_flag m_capturableWindowsOnceFlag;
174 mutable std::unique_ptr<QPlatformMediaFormatInfo> m_formatInfo;
175 mutable std::once_flag m_formatInfoOnceFlg;
177 std::unique_ptr<QPlatformAudioDevices> m_audioDevices;
178 std::once_flag m_audioDevicesOnceFlag;
180 const QLatin1String m_backendName;