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
4#ifndef QFFMPEGMEDIAINTEGRATION_H
5#define QFFMPEGMEDIAINTEGRATION_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtMultimedia/private/qplatformmediaintegration_p.h>
19
20QT_BEGIN_NAMESPACE
21
22extern bool thread_local FFmpegLogsEnabledInThread;
23
24class QFFmpegMediaFormatInfo;
25
26class QFFmpegMediaIntegration : public QPlatformMediaIntegration
27{
28public:
29 QFFmpegMediaIntegration();
30
31 q23::expected<QPlatformAudioDecoder *, QString> createAudioDecoder(QAudioDecoder *decoder) override;
32 q23::expected<std::unique_ptr<QPlatformAudioResampler>, QString>
33 createAudioResampler(const QAudioFormat &inputFormat,
34 const QAudioFormat &outputFormat) override;
35 q23::expected<QPlatformMediaCaptureSession *, QString> createCaptureSession() override;
36 q23::expected<QPlatformMediaPlayer *, QString> createPlayer(QMediaPlayer *player) override;
37 q23::expected<QPlatformCamera *, QString> createCamera(QCamera *) override;
38 QPlatformSurfaceCapture *createScreenCapture(QScreenCapture *) override;
39 QPlatformSurfaceCapture *createWindowCapture(QWindowCapture *) override;
40 q23::expected<QPlatformMediaRecorder *, QString> createRecorder(QMediaRecorder *) override;
41 q23::expected<QPlatformImageCapture *, QString> createImageCapture(QImageCapture *) override;
42
43 q23::expected<QPlatformVideoSink *, QString> createVideoSink(QVideoSink *sink) override;
44
45 q23::expected<QPlatformAudioInput *, QString> createAudioInput(QAudioInput *input) override;
46// QPlatformAudioOutput *createAudioOutput(QAudioOutput *) override;
47
48 QVideoFrame convertVideoFrame(QVideoFrame &srcFrame,
49 const QVideoFrameFormat &destFormat) override;
50
51protected:
52 QPlatformMediaFormatInfo *createFormatInfo() override;
53
54 QPlatformVideoDevices *createVideoDevices() override;
55
56 QPlatformCapturableWindows *createCapturableWindows() override;
57};
58
59QT_END_NAMESPACE
60
61#endif
62

source code of qtmultimedia/src/plugins/multimedia/ffmpeg/qffmpegmediaintegration_p.h