Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qmediacapturesession.h
Go to the documentation of this file.
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
11
12class QCamera;
13class QAudioInput;
14class QAudioBufferInput;
15class QAudioOutput;
16class QCameraDevice;
17class QImageCapture;
18class QMediaRecorder;
19class QPlatformMediaCaptureSession;
20class QVideoSink;
21class QScreenCapture;
22class QWindowCapture;
23class QVideoFrameInput;
24
26class 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(QObject *nativeVideoSource READ nativeVideoSource WRITE setNativeVideoSource NOTIFY
35 nativeVideoSourceChanged REVISION(6, 12))
36 Q_PROPERTY(
37 QScreenCapture *screenCapture READ screenCapture WRITE setScreenCapture NOTIFY screenCaptureChanged)
38 Q_PROPERTY(QWindowCapture *windowCapture READ windowCapture WRITE setWindowCapture NOTIFY
39 windowCaptureChanged)
40 Q_PROPERTY(QVideoFrameInput *videoFrameInput READ videoFrameInput WRITE setVideoFrameInput
41 NOTIFY videoFrameInputChanged REVISION(6, 8))
42 Q_PROPERTY(QImageCapture *imageCapture READ imageCapture WRITE setImageCapture NOTIFY imageCaptureChanged)
43 Q_PROPERTY(QMediaRecorder *recorder READ recorder WRITE setRecorder NOTIFY recorderChanged)
44 Q_PROPERTY(QObject *videoOutput READ videoOutput WRITE setVideoOutput NOTIFY videoOutputChanged)
45public:
46 explicit QMediaCaptureSession(QObject *parent = nullptr);
47 ~QMediaCaptureSession() override;
48
49 QAudioInput *audioInput() const;
50 void setAudioInput(QAudioInput *input);
51
52 QAudioBufferInput *audioBufferInput() const;
53 void setAudioBufferInput(QAudioBufferInput *input);
54
55 QCamera *camera() const;
56 void setCamera(QCamera *camera);
57
58 QObject *nativeVideoSource() const;
59 void setNativeVideoSource(QObject *videoSource);
60
61 QImageCapture *imageCapture();
62 void setImageCapture(QImageCapture *imageCapture);
63
64 QScreenCapture *screenCapture();
65 void setScreenCapture(QScreenCapture *screenCapture);
66
67 QWindowCapture *windowCapture();
68 void setWindowCapture(QWindowCapture *windowCapture);
69
70 QVideoFrameInput *videoFrameInput() const;
71 void setVideoFrameInput(QVideoFrameInput *input);
72
73 QMediaRecorder *recorder();
74 void setRecorder(QMediaRecorder *recorder);
75
76 void setVideoOutput(QObject *output);
77 QObject *videoOutput() const;
78
79 void setVideoSink(QVideoSink *sink);
80 QVideoSink *videoSink() const;
81
82 void setAudioOutput(QAudioOutput *output);
83 QAudioOutput *audioOutput() const;
85 QPlatformMediaCaptureSession *platformSession() const;
87Q_SIGNALS:
88 void audioInputChanged();
89 Q_REVISION(6, 8) void audioBufferInputChanged();
90 void cameraChanged();
91 Q_REVISION(6, 12) void nativeVideoSourceChanged();
92 void screenCaptureChanged();
93 void windowCaptureChanged();
94 Q_REVISION(6, 8) void videoFrameInputChanged();
95 void imageCaptureChanged();
96 void recorderChanged();
97 void videoOutputChanged();
98 void audioOutputChanged();
99
100private:
101 friend class QPlatformMediaCaptureSession;
102
103 template <typename>
104 struct ObjectTraits;
105
106 template <typename Object>
107 void setObject(Object *);
108
109 // ### Qt7: remove unused member
110 QT6_ONLY(Q_DECL_UNUSED_MEMBER void *unused = nullptr;) // for ABI compatibility
111
112 Q_DISABLE_COPY(QMediaCaptureSession)
113 Q_DECLARE_PRIVATE(QMediaCaptureSession)
114};
115
116QT_END_NAMESPACE
117
118#endif // QMEDIACAPTURESESSION_H
The QCameraDevice class provides general information about camera devices.
The QCameraFormat class describes a video format supported by a camera device. \inmodule QtMultimedia...
QCameraDevice cameraDevice
Definition qcamera_p.h:36
QMediaCaptureSession * captureSession
Definition qcamera_p.h:33
QPlatformCamera * control
Definition qcamera_p.h:34
QCameraFormat cameraFormat
Definition qcamera_p.h:37
The QCamera class provides interface for system camera devices.
Definition qcamera.h:25
The QMediaCaptureSession class allows capturing of audio and video content.
Combined button and popup list for selecting options.
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2582