Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qscreencapture.h
Go to the documentation of this file.
1
// Copyright (C) 2022 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
QSCREENCAPTURE_H
5
#
define
QSCREENCAPTURE_H
6
7
#
include
<
QtCore
/
qobject
.
h
>
8
#
include
<
QtCore
/
qnamespace
.
h
>
9
#
include
<
QtGui
/
qscreen
.
h
>
10
#
include
<
QtGui
/
qwindow
.
h
>
11
#
include
<
QtGui
/
qwindowdefs
.
h
>
12
#
include
<
QtMultimedia
/
qtmultimediaglobal
.
h
>
13
14
#
include
<
optional
>
15
16
QT_BEGIN_NAMESPACE
17
18
class
QMediaCaptureSession;
19
class
QPlatformSurfaceCapture;
20
class
QScreenCapturePrivate;
21
22
class
Q_MULTIMEDIA_EXPORT
QScreenCapture
:
public
QObject
23
{
24
Q_OBJECT
25
Q_PROPERTY(
bool
active READ isActive WRITE setActive NOTIFY activeChanged)
26
Q_PROPERTY(QScreen *screen READ screen WRITE setScreen NOTIFY screenChanged)
27
Q_PROPERTY(Error error READ error NOTIFY errorChanged)
28
Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged)
29
Q_PROPERTY(std::optional<qreal> maximumFrameRate READ maximumFrameRate WRITE setMaximumFrameRate
30
NOTIFY maximumFrameRateChanged REVISION(6, 12))
31
32
public
:
33
enum
Error {
34
NoError = 0,
35
InternalError = 1,
36
CapturingNotSupported = 2,
37
CaptureFailed = 4,
38
NotFound = 5,
39
};
40
Q_ENUM(Error)
41
42
explicit
QScreenCapture(QObject *parent =
nullptr
);
43
~QScreenCapture() override;
44
45
QMediaCaptureSession *captureSession()
const
;
46
47
void
setScreen(QScreen *screen);
48
QScreen *screen()
const
;
49
50
bool
isActive()
const
;
51
52
Error error()
const
;
53
QString errorString()
const
;
54
55
void
setMaximumFrameRate(std::optional<qreal> frameRate);
56
std::optional<qreal> maximumFrameRate()
const
;
57
58
public
Q_SLOTS:
59
void
setActive(
bool
active);
60
void
start() { setActive(
true
); }
61
void
stop() { setActive(
false
); }
62
63
Q_SIGNALS:
64
void
activeChanged(
bool
);
65
void
errorChanged();
66
void
screenChanged(QScreen *);
67
void
errorOccurred(QScreenCapture::Error error,
const
QString &errorString);
68
Q_REVISION(6, 12)
void
maximumFrameRateChanged();
69
70
private
:
71
void
setCaptureSession(QMediaCaptureSession *captureSession);
72
QPlatformSurfaceCapture *platformScreenCapture()
const
;
73
friend
class
QMediaCaptureSession;
74
Q_DISABLE_COPY(QScreenCapture)
75
Q_DECLARE_PRIVATE(QScreenCapture)
76
};
77
78
QT_END_NAMESPACE
79
80
#
endif
// QSCREENCAPTURE_H
QMediaRecorderPrivate
Definition
qmediarecorder_p.h:30
QMediaRecorderPrivate::initErrorMessage
QString initErrorMessage
Definition
qmediarecorder_p.h:40
QMediaRecorderPrivate::control
QPlatformMediaRecorder * control
Definition
qmediarecorder_p.h:39
QMediaRecorderPrivate::settingsChanged
bool settingsChanged
Definition
qmediarecorder_p.h:43
QMediaRecorderPrivate::captureSession
QMediaCaptureSession * captureSession
Definition
qmediarecorder_p.h:38
QMediaRecorderPrivate::encoderSettings
QMediaEncoderSettings encoderSettings
Definition
qmediarecorder_p.h:45
QMediaRecorderPrivate::autoStop
bool autoStop
Definition
qmediarecorder_p.h:41
QMediaRecorderPrivate::msgFailedStartRecording
static QString msgFailedStartRecording()
Definition
qmediarecorder.cpp:132
QObjectData::q_ptr
QObject * q_ptr
Definition
qobject.h:73
QScreenCapture
\inmodule QtMultimedia
Definition
qscreencapture.h:23
QMediaCaptureSession::ObjectTraits< QCamera >
\qmltype CaptureSession
Definition
qmediacapturesession.cpp:133
qtmultimedia
src
multimedia
recording
qscreencapture.h
Generated on
for Qt by
1.18.0