71 static QPlatformMediaIntegration *instance();
73 explicit QPlatformMediaIntegration(QLatin1String);
74 ~QPlatformMediaIntegration() override;
75 const QPlatformMediaFormatInfo *formatInfo();
77 virtual q23::expected<QPlatformCamera *, QString> createCamera(QCamera *)
79 return q23::unexpected{ notAvailable };
81 virtual QPlatformSurfaceCapture *createScreenCapture(QScreenCapture *) {
return nullptr; }
82 virtual QPlatformSurfaceCapture *createWindowCapture(QWindowCapture *) {
return nullptr; }
84 virtual q23::expected<QPlatformAudioDecoder *, QString> createAudioDecoder(QAudioDecoder *)
86 return q23::unexpected{ notAvailable };
88 virtual q23::expected<std::unique_ptr<QPlatformAudioResampler>, QString>
89 createAudioResampler(
const QAudioFormat & ,
90 const QAudioFormat & );
91 virtual q23::expected<QPlatformMediaCaptureSession *, QString> createCaptureSession()
93 return q23::unexpected{ notAvailable };
95 virtual q23::expected<QPlatformMediaPlayer *, QString> createPlayer(QMediaPlayer *)
97 return q23::unexpected{ notAvailable };
99 virtual q23::expected<QPlatformMediaRecorder *, QString> createRecorder(QMediaRecorder *)
101 return q23::unexpected{ notAvailable };
103 virtual q23::expected<QPlatformImageCapture *, QString> createImageCapture(QImageCapture *)
105 return q23::unexpected{ notAvailable };
108 virtual q23::expected<QPlatformAudioInput *, QString> createAudioInput(QAudioInput *);
109 virtual q23::expected<QPlatformAudioOutput *, QString> createAudioOutput(QAudioOutput *);
111 virtual q23::expected<QPlatformVideoSink *, QString> createVideoSink(QVideoSink *)
113 return q23::unexpected{ notAvailable };
116 QList<QCapturableWindow> capturableWindowsList();
117 bool isCapturableWindowValid(
const QCapturableWindowPrivate &);
118 [[nodiscard]] q23::expected<QCapturableWindow, QString> capturableWindowFromQWindow(QWindow *);
120 QPlatformVideoDevices *videoDevices();
122 QPlatformCapturableWindows *capturableWindows();
124 QPlatformAudioDevices *audioDevices();
126 static QStringList availableBackends();
127 QLatin1String name();
130 virtual QVideoFrame convertVideoFrame(QVideoFrame &,
const QVideoFrameFormat &);
132 virtual QAbstractPlatformSpecificInterface *platformSpecificInterface() {
return nullptr; }
134 static QLatin1String audioBackendName();
136 virtual bool isCameraSwitchingDuringRecordingSupported()
const {
return true; }
139 virtual QPlatformMediaFormatInfo *createFormatInfo();
141 virtual QPlatformVideoDevices *createVideoDevices() {
return nullptr; }
143 virtual QPlatformCapturableWindows *createCapturableWindows() {
return nullptr; }
145 virtual std::unique_ptr<QPlatformAudioDevices> createAudioDevices();
147 inline static const QString notAvailable = QStringLiteral(
"Not available");
150 friend class QMockIntegration;
151 void resetInstance();
154 std::unique_ptr<QPlatformVideoDevices> m_videoDevices;
155 std::once_flag m_videoDevicesOnceFlag;
157 std::unique_ptr<QPlatformCapturableWindows> m_capturableWindows;
158 std::once_flag m_capturableWindowsOnceFlag;
160 mutable std::unique_ptr<QPlatformMediaFormatInfo> m_formatInfo;
161 mutable std::once_flag m_formatInfoOnceFlg;
163 std::unique_ptr<QPlatformAudioDevices> m_audioDevices;
164 std::once_flag m_audioDevicesOnceFlag;
166 const QLatin1String m_backendName;