FPSLimiter
FPSLimiter
#include <icy/av/fpscounter.h>class FPSLimiterDefined in src/av/include/icy/av/fpscounter.h:152
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.
List of all members
| Name | Kind | Owner |
|---|---|---|
emitter | variable | Declared here |
FPSLimiter | function | Declared here |
process | function | Declared here |
onStreamStateChange | function | Declared here |
_max | variable | Declared here |
_videoOnly | variable | Declared here |
_counter | variable | Declared here |
PacketProcessor | function | Inherited from PacketProcessor |
process | function | Inherited from PacketProcessor |
accepts | function | Inherited from PacketProcessor |
operator<< | function | Inherited from PacketProcessor |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
~PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
emit | function | Inherited from PacketStreamAdapter |
getEmitter | function | Inherited from PacketStreamAdapter |
retention | function | Inherited from PacketStreamAdapter |
onStreamStateChange | function | Inherited from PacketStreamAdapter |
_emitter | variable | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
PacketStreamAdapter | function | Inherited from PacketStreamAdapter |
operator= | function | Inherited from PacketStreamAdapter |
Inherited from PacketProcessor
| Kind | Name | Description |
|---|---|---|
function | PacketProcessor inline | |
function | process virtual | This method performs processing on the given packet and emits the result. |
function | accepts virtual inline | This method ensures compatibility with the given packet type. Return false to reject the packet. |
function | operator<< virtual inline | Stream operator alias for process() |
Inherited from PacketStreamAdapter
| Kind | Name | Description |
|---|---|---|
function | PacketStreamAdapter | Construct the adapter, binding it to the given packet signal. |
function | ~PacketStreamAdapter virtual inline | |
function | emit virtual | Emit a mutable raw buffer as a packet. |
function | emit virtual | Emit a read-only raw buffer as a packet (data is copied internally). |
function | emit virtual | Emit a string as a packet (data is copied internally). |
function | emit virtual | Emit a flag-only packet carrying no payload data. |
function | emit virtual | Emit an existing packet directly onto the outgoing signal. |
function | getEmitter | Returns a reference to the outgoing packet signal. |
function | retention virtual const | Returns how this adapter treats incoming packet lifetime. Most adapters are synchronous and therefore only borrow the packet for the current call chain. Queue-style adapters override this to advertise that they clone before deferred use. Callers may treat the first adapter reporting Cloned or Retained as the explicit ownership boundary in the stream graph. |
function | onStreamStateChange virtual inline | Called by the PacketStream to notify when the internal Stream state changes. On receiving the Stopped state, it is the responsibility of the adapter to have ceased all outgoing packet transmission, especially in multi-thread scenarios. |
variable | _emitter | |
function | PacketStreamAdapter | NonCopyable and NonMovable. |
function | operator= | Deleted assignment operator. |
function | PacketStreamAdapter | Deleted constructor. |
function | operator= | Deleted assignment operator. |
Public Attributes
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter |
emitter
PacketSignal emitterDefined in src/av/include/icy/av/fpscounter.h:192
Public 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 = false)Defined in src/av/include/icy/av/fpscounter.h:158
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)Defined in src/av/include/icy/av/fpscounter.h:167
Process a packet: forward it if within the rate limit, drop it otherwise.
Parameters
packetThe incoming packet to evaluate.
Reimplements
onStreamStateChange
virtual inline
virtual inline void onStreamStateChange(const PacketStreamState &)Defined in src/av/include/icy/av/fpscounter.h:187
Reset the FPS counter when the stream state changes.
Reimplements
Protected Attributes
| Return | Name | Description |
|---|---|---|
int | _max | |
bool | _videoOnly | |
legacy::FPSCounter | _counter |
_max
int _maxDefined in src/av/include/icy/av/fpscounter.h:195
_videoOnly
bool _videoOnlyDefined in src/av/include/icy/av/fpscounter.h:196
_counter
legacy::FPSCounter _counter