AV module
FPSLimiter
PacketStream 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
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter |
emitter
PacketSignal emitterPublic Methods
| Return | Name | Description |
|---|---|---|
FPSLimiter inline | Construct the limiter. | |
void | process virtual inline | Process a packet: forward it if within the rate limit, drop it otherwise. |
void | onStreamStateChange virtual inline | Reset the FPS counter when the stream state changes. |
FPSLimiter
inline
inline FPSLimiter(int max, bool videoOnly)Construct the limiter.
Parameters
maxThe maximum allowed frame rate in frames per second.videoOnlyIf 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
packetThe incoming packet to evaluate.
onStreamStateChange
virtual inline
virtual inline void onStreamStateChange(const PacketStreamState &)Reset the FPS counter when the stream state changes.
Protected Attributes
| Return | Name | Description |
|---|---|---|
int | _max | |
bool | _videoOnly | |
legacy::FPSCounter | _counter |
_max
int _max_videoOnly
bool _videoOnly_counter
legacy::FPSCounter _counter