| 1 | // Copyright (C) 2016 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 QMEDIACAPTURESESSION_H | 
| 5 | #define QMEDIACAPTURESESSION_H | 
| 6 | |
| 7 | #include <QtCore/qobject.h> | 
| 8 | #include <QtMultimedia/qtmultimediaglobal.h> | 
| 9 | |
| 10 | QT_BEGIN_NAMESPACE | 
| 11 | |
| 12 | class QCamera; | 
| 13 | class QAudioInput; | 
| 14 | class QAudioBufferInput; | 
| 15 | class QAudioOutput; | 
| 16 | class QCameraDevice; | 
| 17 | class QImageCapture; | 
| 18 | class QMediaRecorder; | 
| 19 | class QPlatformMediaCaptureSession; | 
| 20 | class QVideoSink; | 
| 21 | class QScreenCapture; | 
| 22 | class QWindowCapture; | 
| 23 | class QVideoFrameInput; | 
| 24 | |
| 25 | class QMediaCaptureSessionPrivate; | 
| 26 | class Q_MULTIMEDIA_EXPORT QMediaCaptureSession : public QObject | 
| 27 | { | 
| 28 | Q_OBJECT | 
| 29 | Q_PROPERTY(QAudioInput *audioInput READ audioInput WRITE setAudioInput NOTIFY audioInputChanged) | 
| 30 | Q_PROPERTY(QAudioBufferInput *audioBufferInput READ audioBufferInput WRITE setAudioBufferInput | 
| 31 | NOTIFY audioBufferInputChanged REVISION(6, 8)) | 
| 32 | Q_PROPERTY(QAudioOutput *audioOutput READ audioOutput WRITE setAudioOutput NOTIFY audioOutputChanged) | 
| 33 | Q_PROPERTY(QCamera *camera READ camera WRITE setCamera NOTIFY cameraChanged) | 
| 34 | Q_PROPERTY( | 
| 35 | QScreenCapture *screenCapture READ screenCapture WRITE setScreenCapture NOTIFY screenCaptureChanged) | 
| 36 | Q_PROPERTY(QWindowCapture *windowCapture READ windowCapture WRITE setWindowCapture NOTIFY | 
| 37 | windowCaptureChanged) | 
| 38 | Q_PROPERTY(QVideoFrameInput *videoFrameInput READ videoFrameInput WRITE setVideoFrameInput | 
| 39 | NOTIFY videoFrameInputChanged REVISION(6, 8)) | 
| 40 | Q_PROPERTY(QImageCapture *imageCapture READ imageCapture WRITE setImageCapture NOTIFY imageCaptureChanged) | 
| 41 | Q_PROPERTY(QMediaRecorder *recorder READ recorder WRITE setRecorder NOTIFY recorderChanged) | 
| 42 | Q_PROPERTY(QObject *videoOutput READ videoOutput WRITE setVideoOutput NOTIFY videoOutputChanged) | 
| 43 | public: | 
| 44 | explicit QMediaCaptureSession(QObject *parent = nullptr); | 
| 45 | ~QMediaCaptureSession() override; | 
| 46 | |
| 47 | QAudioInput *audioInput() const; | 
| 48 | void setAudioInput(QAudioInput *input); | 
| 49 | |
| 50 | QAudioBufferInput *audioBufferInput() const; | 
| 51 | void setAudioBufferInput(QAudioBufferInput *input); | 
| 52 | |
| 53 | QCamera *camera() const; | 
| 54 | void setCamera(QCamera *camera); | 
| 55 | |
| 56 | QImageCapture *imageCapture(); | 
| 57 | void setImageCapture(QImageCapture *imageCapture); | 
| 58 | |
| 59 | QScreenCapture *screenCapture(); | 
| 60 | void setScreenCapture(QScreenCapture *screenCapture); | 
| 61 | |
| 62 | QWindowCapture *windowCapture(); | 
| 63 | void setWindowCapture(QWindowCapture *windowCapture); | 
| 64 | |
| 65 | QVideoFrameInput *videoFrameInput() const; | 
| 66 | void setVideoFrameInput(QVideoFrameInput *input); | 
| 67 | |
| 68 | QMediaRecorder *recorder(); | 
| 69 | void setRecorder(QMediaRecorder *recorder); | 
| 70 | |
| 71 | void setVideoOutput(QObject *output); | 
| 72 | QObject *videoOutput() const; | 
| 73 | |
| 74 | void setVideoSink(QVideoSink *sink); | 
| 75 | QVideoSink *videoSink() const; | 
| 76 | |
| 77 | void setAudioOutput(QAudioOutput *output); | 
| 78 | QAudioOutput *audioOutput() const; | 
| 79 | |
| 80 | QPlatformMediaCaptureSession *platformSession() const; | 
| 81 | |
| 82 | Q_SIGNALS: | 
| 83 | void audioInputChanged(); | 
| 84 | Q_REVISION(6, 8) void audioBufferInputChanged(); | 
| 85 | void cameraChanged(); | 
| 86 | void screenCaptureChanged(); | 
| 87 | void windowCaptureChanged(); | 
| 88 | Q_REVISION(6, 8) void videoFrameInputChanged(); | 
| 89 | void imageCaptureChanged(); | 
| 90 | void recorderChanged(); | 
| 91 | void videoOutputChanged(); | 
| 92 | void audioOutputChanged(); | 
| 93 | |
| 94 | private: | 
| 95 | friend class QPlatformMediaCaptureSession; | 
| 96 | |
| 97 | // ### Qt7: remove unused member | 
| 98 | QT6_ONLY(void *unused = nullptr;) // for ABI compatibility | 
| 99 | |
| 100 | Q_DISABLE_COPY(QMediaCaptureSession) | 
| 101 | Q_DECLARE_PRIVATE(QMediaCaptureSession) | 
| 102 | }; | 
| 103 | |
| 104 | QT_END_NAMESPACE | 
| 105 | |
| 106 | #endif // QMEDIACAPTURESESSION_H | 
| 107 | 
