4#ifndef FRAMEGRABBER_P_H
5#define FRAMEGRABBER_P_H
18#include <QtCore/qtconfigmacros.h>
19#include <QtMultimedia/qvideoframe.h>
20#include <QtMultimedia/qvideosink.h>
44
45
46
57
58
59
60
61
62
63
64
67 std::optional<qreal> expectedFrameRate =
std::nullopt,
68 qint64 noOlderThanTime = 0);
71
72
73
76 std::optional<qreal> expectedFrameRate =
std::nullopt,
77 qint64 noOlderThanTime = 0);
80
81
82
83
84
85
86
87
91
92
93
94
95
101
102
103
104
105
106
107
108
110 qsizetype frameCount = 1,
111 std::optional<qreal> expectedFrameRate =
std::nullopt);
119
120
121
125 void onFrameReceived(
const QVideoFrame &frame);
126 [[nodiscard]]
bool waitForFirstFrame();
127 void resetFirstFrame();
129 template <
typename Frame>
130 [[nodiscard]] std::vector<Frame> waitAndTake(
131 std::vector<Frame> &frames,
133 std::optional<qreal> expectedFrameRate,
134 qint64 noOlderThanTime);
136 std::vector<VideoFrameInfo> m_frameInfos;
139 bool m_retainVideoFrames =
false;
140 std::vector<QVideoFrame> m_videoFrames;
145 bool m_retainFirstVideoFrame =
false;
146 std::optional<QVideoFrame> m_firstVideoFrame;
148 bool m_streamStarted =
false;
150 bool m_stopped =
false;