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
framegenerator_p.h
Go to the documentation of this file.
1
// Copyright (C) 2024 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4
#
ifndef
FRAMEGENERATOR_H
5
#
define
FRAMEGENERATOR_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
<
QtCore
/
qobject
.
h
>
19
#
include
<
QtMultimedia
/
qvideoframe
.
h
>
20
21
#
include
<
array
>
22
#
include
<
chrono
>
23
24
QT_BEGIN_NAMESPACE
25
26
enum
class
ImagePattern
27
{
28
SingleColor,
// Image filled with a single color
29
ColoredSquares
// Colored squares, [red, green; blue, yellow]
30
};
31
32
class
VideoGenerator
:
public
QObject
33
{
34
Q_OBJECT
35
public
:
36
void
setPattern
(
ImagePattern
pattern
);
37
void
setFrameCount
(
int
count);
38
void
setSize
(QSize size);
39
void
setPixelFormat
(QVideoFrameFormat::PixelFormat pixelFormat);
40
void
setFrameRate
(
double
rate);
41
void
setPeriod
(
std
::chrono::microseconds period);
42
void
setPresentationRotation
(QtVideo::Rotation rotation);
43
void
setPresentationMirrored
(
bool
mirror);
44
void
setEndTimeReporting
(
bool
endTimeIsReported);
45
void
setColors
(std::array<QColor, 5> colors);
46
void
emitEmptyFrameOnStop
();
47
QVideoFrame
createFrame
();
48
49
Q_SIGNALS
:
50
void
done
();
51
void
frameCreated
(
const
QVideoFrame &frame);
52
53
public
Q_SLOTS
:
54
void
nextFrame
();
55
56
private
:
57
std::array<QColor, 5> m_colors{
58
QColorConstants
::
Red
,
QColorConstants
::
Green
,
QColorConstants
::
Blue
,
59
QColorConstants
::
Black
,
QColorConstants
::
White
,
60
};
61
ImagePattern m_pattern = ImagePattern::SingleColor;
62
QSize m_size{ 640, 480 };
63
QVideoFrameFormat::PixelFormat m_pixelFormat =
QVideoFrameFormat
::
Format_BGRA8888
;
64
std::optional<
int
> m_maxFrameCount;
65
int
m_frameIndex = 0;
66
std::optional<
double
> m_frameRate;
67
std::optional<std::chrono::microseconds> m_period;
68
std::optional<QtVideo::Rotation> m_presentationRotation;
69
std::optional<
bool
> m_presentationMirrored;
70
bool
m_emitEmptyFrameOnStop =
false
;
71
bool
m_endTimeIsReported =
true
;
72
};
73
74
QT_END_NAMESPACE
75
76
#
endif
VideoGenerator
Definition
framegenerator_p.h:33
VideoGenerator::setEndTimeReporting
void setEndTimeReporting(bool endTimeIsReported)
Definition
framegenerator.cpp:53
VideoGenerator::createFrame
QVideoFrame createFrame()
Definition
framegenerator.cpp:101
VideoGenerator::setSize
void setSize(QSize size)
Definition
framegenerator.cpp:24
VideoGenerator::emitEmptyFrameOnStop
void emitEmptyFrameOnStop()
Definition
framegenerator.cpp:63
VideoGenerator::setPresentationMirrored
void setPresentationMirrored(bool mirror)
Definition
framegenerator.cpp:49
VideoGenerator::frameCreated
void frameCreated(const QVideoFrame &frame)
VideoGenerator::setColors
void setColors(std::array< QColor, 5 > colors)
Definition
framegenerator.cpp:58
VideoGenerator::setFrameCount
void setFrameCount(int count)
Definition
framegenerator.cpp:19
VideoGenerator::setPeriod
void setPeriod(std::chrono::microseconds period)
Definition
framegenerator.cpp:39
VideoGenerator::setFrameRate
void setFrameRate(double rate)
Definition
framegenerator.cpp:34
VideoGenerator::setPresentationRotation
void setPresentationRotation(QtVideo::Rotation rotation)
Definition
framegenerator.cpp:44
VideoGenerator::setPixelFormat
void setPixelFormat(QVideoFrameFormat::PixelFormat pixelFormat)
Definition
framegenerator.cpp:29
fillColoredSquares
static void fillColoredSquares(QImage &image)
Definition
framegenerator.cpp:68
createJpegFrame
static QVideoFrame createJpegFrame(const QImage &image, QSize size)
Definition
framegenerator.cpp:84
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtmultimedia
src
multimediatestlib
framegenerator_p.h
Generated on
for Qt by
1.18.0