Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
stream::video_loss_monitor_t Class Reference

#include <src/video_loss_monitor.h>

Classes

struct  report_t
 One block's report. The wire format is big-endian. More...

Public Member Functions

void on_report (const report_t &report)
 Count one block's report.
void on_sent (std::uint64_t packets, std::uint64_t data_packets)
std::uint64_t sent_packets () const
 Video packets sent to the client, parity included.
std::uint64_t sent_data_packets () const
std::uint64_t repaired_blocks () const
 Blocks the client rebuilt from parity: lost packets, no lost picture.
std::uint64_t dropped_frames () const
 Frames the client dropped because a block could not be rebuilt.
std::uint64_t missing_packets () const
 Packets missing from the blocks the client reported.
std::uint64_t reported_blocks () const

Static Public Member Functions

static std::optional< report_t > parse (std::string_view payload)

Static Public Attributes

static constexpr std::size_t report_size = 4 + 7 * 2 + 3
 The size of SS_FRAME_FEC_STATUS: a 32-bit frame index, seven 16-bit counts and three bytes.

Detailed Description

What the client reported losing over a session, from its FEC status reports.

Everything the host measures is on its own side of the network. These reports are the client's view of the same packets, so they show loss the host cannot see: a congested hop, Wi-Fi, a slow port. Reports arrive on the control thread; the totals are atomic so a session can be summarized from whichever thread stops it.

Definition at line 35 of file video_loss_monitor.h.

Member Function Documentation

◆ dropped_frames()

std::uint64_t stream::video_loss_monitor_t::dropped_frames ( ) const
inline

Frames the client dropped because a block could not be rebuilt.

Definition at line 159 of file video_loss_monitor.h.

◆ missing_packets()

std::uint64_t stream::video_loss_monitor_t::missing_packets ( ) const
inline

Packets missing from the blocks the client reported.

Definition at line 164 of file video_loss_monitor.h.

◆ on_report()

void stream::video_loss_monitor_t::on_report ( const report_t & report)
inline

Count one block's report.

Definition at line 110 of file video_loss_monitor.h.

◆ on_sent()

void stream::video_loss_monitor_t::on_sent ( std::uint64_t packets,
std::uint64_t data_packets )
inline

Count one FEC block sent to the client. Called by the video thread.

Parameters
packetsThe block's packets, parity included.
data_packetsHow many of them carry data.

Definition at line 129 of file video_loss_monitor.h.

◆ parse()

std::optional< report_t > stream::video_loss_monitor_t::parse ( std::string_view payload)
inlinestatic

Parse an SS_FRAME_FEC_STATUS payload.

Returns
The report, or nothing if the payload is not one.

Definition at line 85 of file video_loss_monitor.h.

◆ repaired_blocks()

std::uint64_t stream::video_loss_monitor_t::repaired_blocks ( ) const
inline

Blocks the client rebuilt from parity: lost packets, no lost picture.

Definition at line 154 of file video_loss_monitor.h.

◆ reported_blocks()

std::uint64_t stream::video_loss_monitor_t::reported_blocks ( ) const
inline

Blocks the client reported on. Zero means it never sent SS_FRAME_FEC_STATUS, which is not the same as a link that lost nothing.

Definition at line 170 of file video_loss_monitor.h.

◆ sent_data_packets()

std::uint64_t stream::video_loss_monitor_t::sent_data_packets ( ) const
inline

Data packets sent to the client: what a loss rate is measured against.

The client watches a block until it can rebuild it, which takes as many packets as the block has data. Parity of a block whose data all arrived, and parity behind the packet that completed a rebuild, are never looked at, so their losses are never reported. Dividing the reported loss by every packet sent would underestimate the loss rate by the parity share; dividing by the data packets does not.

Definition at line 149 of file video_loss_monitor.h.

◆ sent_packets()

std::uint64_t stream::video_loss_monitor_t::sent_packets ( ) const
inline

Video packets sent to the client, parity included.

Definition at line 135 of file video_loss_monitor.h.

Member Data Documentation

◆ report_size

std::size_t stream::video_loss_monitor_t::report_size = 4 + 7 * 2 + 3
staticconstexpr

The size of SS_FRAME_FEC_STATUS: a 32-bit frame index, seven 16-bit counts and three bytes.

Definition at line 79 of file video_loss_monitor.h.


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