30class TestVideoSink :
public QVideoSink
34 explicit TestVideoSink(
bool storeFrames =
false);
36 QVideoFrame waitForFrame();
38 void setStoreFrames(
bool storeFrames =
true) { m_storeFrames = storeFrames; }
40 void setStoreImagesEnabled(
bool storeImages =
true);
41 const std::vector<QImage> &images()
const {
return m_images; }
43 std::chrono::milliseconds durationBetweenFrames(qsizetype frameCount);
46 void addVideoFrame(
const QVideoFrame &frame);
47 void storeImage(
const QVideoFrame &frame);
50 void videoFrameChangedSync(
const QVideoFrame &frame);
53 QList<QVideoFrame> m_frameList;
54 int m_totalFrames = 0;
55 QElapsedTimer m_elapsedTimer;
56 using TimePoint = std::chrono::time_point<std::chrono::high_resolution_clock>;
57 std::vector<TimePoint> m_frameTimes;
61 std::vector<QImage> m_images;