6#include <QtCore/QMetaObject>
7#include <QtCore/QObject>
8#include <QtCore/QPointer>
10#include <QtCore/QTimer>
11#include <QtMultimedia/QVideoFrameFormat>
12#include <QtQmlIntegration/QtQmlIntegration>
45 void attach(QCamera* camera, QVideoSink* videoSink);
65 QVideoFrameFormat::PixelFormat pixelFormat = QVideoFrameFormat::Format_Invalid;
66 double streamFrameRate = 0.0;
70 void _onVideoFrame(
const QVideoFrame& frame);
80 QPointer<QVideoSink> _videoSink;
81 QList<QMetaObject::Connection> _connections;
83 FrameCounters _frameCounters;
85 std::optional<qint64> _streamingSinceMs;
88 double _cameraFrameRate = 0.0;
double cameraFrameRate() const
The frame rate the camera was set up for; 0 while unknown.
void detach()
Stops measuring.
void attach(QCamera *camera, QVideoSink *videoSink)
Measures the frames videoSink receives from camera (optional), in place of any other sink attached.
friend class UVCStreamMonitorTest
friend class VideoManagerTest
UVCStreamMonitor(QObject *parent=nullptr, VideoStreamStatsMeter::Clock clock={})
clock defaults to the steady clock.
VideoStreamStats stats() const
std::function< qint64()> Clock
Monotonic milliseconds.