QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PipelineStatsProbe.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <atomic>
5#include <cstddef>
6#include <gst/gst.h>
7
9
10struct VideoStreamStats;
11
19{
20public:
22 void noteBuffer(GstBuffer* buffer);
23
27 static void noteElementMessage(GstMessage* message);
28
32 void sample(GstElement* pipeline, GstElement* source, GstElement* tee, VideoStreamStatsMeter::Counters& counters,
33 VideoStreamStats& stats);
34
36 static bool queryLatency(GstElement* pipeline, GstClockTime& min, GstClockTime& max);
37
38private:
39 void _noteKeyframe(GstClockTime time);
40
44 static constexpr std::size_t kKeyframeWindow = 5;
45
47 std::atomic<quint64> _bytesReceived = 0;
49 std::array<GstClockTime, kKeyframeWindow> _keyframeTimes{};
50 std::size_t _keyframeTimeCount = 0;
52 std::atomic<GstClockTime> _keyframeInterval = GST_CLOCK_TIME_NONE;
54 quint64 _rtpPacketsLost = 0;
55};
struct _GstElement GstElement
What PipelineSession measures of its stream for VideoStreamStats, apart from its branches.
static void noteElementMessage(GstMessage *message)
void sample(GstElement *pipeline, GstElement *source, GstElement *tee, VideoStreamStatsMeter::Counters &counters, VideoStreamStats &stats)
void noteBuffer(GstBuffer *buffer)
Streaming thread (the tee's sink pad, so one at a time): buffer reached the tee.
static bool queryLatency(GstElement *pipeline, GstClockTime &min, GstClockTime &max)
The latency pipeline reports; false when it doesn't answer the latency query.