AV module

FPSLimiter

[PacketStream]({#ref classicy_1_1PacketStream #}) processor that caps packet throughput to a maximum FPS.

FPSLimiter

#include <icy/av/fpscounter.h>

Inherits: PacketProcessor

PacketStream processor that caps packet throughput to a maximum FPS.

If the observed frame rate exceeds the configured FPS budget, packets are dropped until the rate falls back under the limit.

Note that previous processors must not fragment packets, otherwise this class will not be accurate, and the packet drop rate will be too high.

Public Attributes

ReturnNameDescription
PacketSignalemitter

emitter

PacketSignal emitter

Public Methods

ReturnNameDescription
FPSLimiter inlineConstruct the limiter.
voidprocess virtual inlineProcess a packet: forward it if within the rate limit, drop it otherwise.
voidonStreamStateChange virtual inlineReset the FPS counter when the stream state changes.

FPSLimiter

inline

inline FPSLimiter(int max, bool videoOnly)

Construct the limiter.

Parameters

  • max The maximum allowed frame rate in frames per second.

  • videoOnly If true, non-VideoPacket packets are always forwarded regardless of rate.


process

virtual inline

virtual inline void process(IPacket & packet)

Process a packet: forward it if within the rate limit, drop it otherwise.

Parameters

  • packet The incoming packet to evaluate.

onStreamStateChange

virtual inline

virtual inline void onStreamStateChange(const PacketStreamState &)

Reset the FPS counter when the stream state changes.

Protected Attributes

ReturnNameDescription
int_max
bool_videoOnly
legacy::FPSCounter_counter

_max

int _max

_videoOnly

bool _videoOnly

_counter

legacy::FPSCounter _counter