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#ifndef QPLATFORMMEDIACAPTURE_H
4#define QPLATFORMMEDIACAPTURE_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <private/qtmultimediaglobal_p.h>
18#include <QtCore/qobject.h>
19
20QT_BEGIN_NAMESPACE
21class QPlatformCamera;
22class QPlatformImageCapture;
23class QPlatformMediaRecorder;
24class QAudioDevice;
25class QCameraDevice;
26class QVideoSink;
27class QPlatformAudioInput;
28class QPlatformAudioOutput;
29class QMediaCaptureSession;
30class QPlatformSurfaceCapture;
31class QPlatformVideoSource;
32class QPlatformAudioBufferInput;
33class QPlatformVideoFrameInput;
34
35class Q_MULTIMEDIA_EXPORT QPlatformMediaCaptureSession : public QObject
36{
37 Q_OBJECT
38public:
39 QPlatformMediaCaptureSession() = default;
40 ~QPlatformMediaCaptureSession() override;
41
42 void setCaptureSession(QMediaCaptureSession *session) { m_session = session; }
43 QMediaCaptureSession *captureSession() const { return m_session; }
44
45 virtual QPlatformCamera *camera() = 0;
46 virtual void setCamera(QPlatformCamera *) {}
47
48 virtual QPlatformSurfaceCapture *screenCapture() { return nullptr; }
49 virtual void setScreenCapture(QPlatformSurfaceCapture *) {}
50
51 virtual QPlatformSurfaceCapture *windowCapture() { return nullptr; }
52 virtual void setWindowCapture(QPlatformSurfaceCapture *) { }
53
54 virtual QPlatformVideoFrameInput *videoFrameInput() { return nullptr; }
55 virtual void setVideoFrameInput(QPlatformVideoFrameInput *) { }
56
57 virtual QPlatformImageCapture *imageCapture() = 0;
58 virtual void setImageCapture(QPlatformImageCapture *) {}
59
60 virtual QPlatformMediaRecorder *mediaRecorder() = 0;
61 virtual void setMediaRecorder(QPlatformMediaRecorder *) {}
62
63 virtual void setAudioInput(QPlatformAudioInput *input) = 0;
64
65 virtual void setAudioBufferInput(QPlatformAudioBufferInput *) { }
66
67 virtual void setVideoPreview(QVideoSink * /*sink*/) {}
68
69 virtual void setAudioOutput(QPlatformAudioOutput *) {}
70
71 // TBD: implement ordering of the sources basing on the order of adding
72 std::vector<QPlatformVideoSource *> activeVideoSources();
73
74Q_SIGNALS:
75 void cameraChanged();
76 void screenCaptureChanged();
77 void windowCaptureChanged();
78 void videoFrameInputChanged();
79 void imageCaptureChanged();
80 void encoderChanged();
81
82private:
83 QMediaCaptureSession *m_session = nullptr;
84};
85
86QT_END_NAMESPACE
87
88
89#endif // QPLATFORMMEDIAINTERFACE_H
90

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtmultimedia/src/multimedia/platform/qplatformmediacapture_p.h