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
10QT_BEGIN_NAMESPACE
11
12class QCamera;
13class QAudioInput;
14class QAudioOutput;
15class QCameraDevice;
16class QImageCapture;
17class QMediaRecorder;
18class QPlatformMediaCaptureSession;
19class QVideoSink;
20class QScreenCapture;
21class QWindowCapture;
22
23class QMediaCaptureSessionPrivate;
24class Q_MULTIMEDIA_EXPORT QMediaCaptureSession : public QObject
25{
26 Q_OBJECT
27 Q_PROPERTY(QAudioInput *audioInput READ audioInput WRITE setAudioInput NOTIFY audioInputChanged)
28 Q_PROPERTY(QAudioOutput *audioOutput READ audioOutput WRITE setAudioOutput NOTIFY audioOutputChanged)
29 Q_PROPERTY(QCamera *camera READ camera WRITE setCamera NOTIFY cameraChanged)
30 Q_PROPERTY(
31 QScreenCapture *screenCapture READ screenCapture WRITE setScreenCapture NOTIFY screenCaptureChanged)
32 Q_PROPERTY(
33 QWindowCapture *windowCapture READ windowCapture WRITE setWindowCapture NOTIFY windowCaptureChanged)
34 Q_PROPERTY(QImageCapture *imageCapture READ imageCapture WRITE setImageCapture NOTIFY imageCaptureChanged)
35 Q_PROPERTY(QMediaRecorder *recorder READ recorder WRITE setRecorder NOTIFY recorderChanged)
36 Q_PROPERTY(QObject *videoOutput READ videoOutput WRITE setVideoOutput NOTIFY videoOutputChanged)
37public:
38 explicit QMediaCaptureSession(QObject *parent = nullptr);
39 ~QMediaCaptureSession();
40
41 QAudioInput *audioInput() const;
42 void setAudioInput(QAudioInput *input);
43
44 QCamera *camera() const;
45 void setCamera(QCamera *camera);
46
47 QImageCapture *imageCapture();
48 void setImageCapture(QImageCapture *imageCapture);
49
50 QScreenCapture *screenCapture();
51 void setScreenCapture(QScreenCapture *screenCapture);
52
53 QWindowCapture *windowCapture();
54 void setWindowCapture(QWindowCapture *windowCapture);
55
56 QMediaRecorder *recorder();
57 void setRecorder(QMediaRecorder *recorder);
58
59 void setVideoOutput(QObject *output);
60 QObject *videoOutput() const;
61
62 void setVideoSink(QVideoSink *sink);
63 QVideoSink *videoSink() const;
64
65 void setAudioOutput(QAudioOutput *output);
66 QAudioOutput *audioOutput() const;
67
68 QPlatformMediaCaptureSession *platformSession() const;
69
70Q_SIGNALS:
71 void audioInputChanged();
72 void cameraChanged();
73 void screenCaptureChanged();
74 void windowCaptureChanged();
75 void imageCaptureChanged();
76 void recorderChanged();
77 void videoOutputChanged();
78 void audioOutputChanged();
79
80private:
81 QMediaCaptureSessionPrivate *d_ptr;
82 Q_DISABLE_COPY(QMediaCaptureSession)
83 Q_DECLARE_PRIVATE(QMediaCaptureSession)
84};
85
86QT_END_NAMESPACE
87
88#endif // QMEDIACAPTURESESSION_H
89

source code of qtmultimedia/src/multimedia/recording/qmediacapturesession.h