QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VideoStreamStatsSampler Class Reference

The VideoStreamStats a receiver publishes, sampled about once a second while it streams. More...

#include <VideoStreamStatsSampler.h>

Public Member Functions

 VideoStreamStatsSampler (const StreamSupervisor &supervisor, VideoStreamStatsMeter::Clock clock={})
const VideoStreamStats & stats () const
 The stats the last sample() or reset() produced.
bool reset ()
 A session ended: the rates start over and the stats go invalid. True when that changed them.
bool sample (const VideoStreamStatsMeter::Counters &counters, VideoStreamStats stats, const RecordingPlan *recording)

Detailed Description

The VideoStreamStats a receiver publishes, sampled about once a second while it streams.

The backend fills the fields only it can measure and counts what VideoStreamStatsMeter turns into rates; the sampler adds the fields every backend reports alike: uptime and reconnects from the receiver's StreamSupervisor, and the recording's time and size from its RecordingPlan. It keeps the stats it last produced, so a receiver publishes changes only.

Definition at line 15 of file VideoStreamStatsSampler.h.

Constructor & Destructor Documentation

◆ VideoStreamStatsSampler()

VideoStreamStatsSampler::VideoStreamStatsSampler ( const StreamSupervisor & supervisor,
VideoStreamStatsMeter::Clock clock = {} )
explicit

Definition at line 8 of file VideoStreamStatsSampler.cc.

Member Function Documentation

◆ reset()

bool VideoStreamStatsSampler::reset ( )

A session ended: the rates start over and the stats go invalid. True when that changed them.

Definition at line 13 of file VideoStreamStatsSampler.cc.

◆ sample()

bool VideoStreamStatsSampler::sample ( const VideoStreamStatsMeter::Counters & counters,
VideoStreamStats stats,
const RecordingPlan * recording )

One sample. stats has the backend's fields, starting from stats(); counters its counters since the session started. recording: what the receiver records, if anything. True when the stats changed. The first sample after reset() only sets the meter's baseline.

Definition at line 19 of file VideoStreamStatsSampler.cc.

References RecordingPlan::bytesWritten(), RecordingPlan::recordingMs(), and stats().

◆ stats()

const VideoStreamStats & VideoStreamStatsSampler::stats ( ) const
inline

The stats the last sample() or reset() produced.

Definition at line 21 of file VideoStreamStatsSampler.h.

Referenced by sample().


The documentation for this class was generated from the following files: