FrameSampler
FrameSampler
#include <icy/vision/framesampler.h>class FrameSamplerDefined in src/vision/include/icy/vision/framesampler.h:49
Inherits:
PacketProcessor
PacketProcessor that forwards a sampled subset of decoded video frames.
The sampler is intentionally zero-copy on its synchronous path: sampled frames are forwarded by reference and dropped frames are discarded before any queue hop. Pair it with DetectionQueue when a worker-thread boundary is required.
List of all members
| Name | Kind | Owner |
|---|---|---|
emitter | variable | Declared here |
FrameSampler | function | Declared here |
setConfig | function | Declared here |
config | function | Declared here |
stats | function | Declared here |
reset | function | Declared here |
process | function | Declared here |
accepts | function | Declared here |
_config | variable | Declared here |
_seen | variable | Declared here |
_forwarded | variable | Declared here |
_dropped | variable | Declared here |
_lastForwardedTimeUsec | variable | Declared here |
shouldForward | function | Declared here |
kUnsetTimeUsec | variable | Declared here |
sanitize | function | 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/vision/include/icy/vision/framesampler.h:52
Public Methods
| Return | Name | Description |
|---|---|---|
FrameSampler inline explicit | ||
void | setConfig inline | |
FrameSamplerConfig | config const inline | |
FrameSamplerStats | stats const inline | |
void | reset inline | |
void | process virtual inline override | This method performs processing on the given packet and emits the result. |
bool | accepts virtual inline override | This method ensures compatibility with the given packet type. Return false to reject the packet. |
FrameSampler
inline explicit
inline explicit FrameSampler(FrameSamplerConfig config = {})Defined in src/vision/include/icy/vision/framesampler.h:54
setConfig
inline
inline void setConfig(FrameSamplerConfig config)Defined in src/vision/include/icy/vision/framesampler.h:60
config
const inline
inline FrameSamplerConfig config() constDefined in src/vision/include/icy/vision/framesampler.h:66
stats
const inline
inline FrameSamplerStats stats() constDefined in src/vision/include/icy/vision/framesampler.h:71
reset
inline
inline void reset()Defined in src/vision/include/icy/vision/framesampler.h:80
process
virtual inline override
virtual inline void process(IPacket & packet) overrideDefined in src/vision/include/icy/vision/framesampler.h:88
This method performs processing on the given packet and emits the result.
Processors that defer work asynchronously must either clone the packet or retain an owned equivalent. See retention().
Reimplements
accepts
virtual inline override
virtual inline bool accepts(IPacket *) overrideDefined in src/vision/include/icy/vision/framesampler.h:107
This method ensures compatibility with the given packet type. Return false to reject the packet.
Reimplements
Private Attributes
| Return | Name | Description |
|---|---|---|
FrameSamplerConfig | _config | |
std::atomic< uint64_t > | _seen | |
std::atomic< uint64_t > | _forwarded | |
std::atomic< uint64_t > | _dropped | |
std::atomic< int64_t > | _lastForwardedTimeUsec |
_config
FrameSamplerConfig _configDefined in src/vision/include/icy/vision/framesampler.h:141
_seen
std::atomic< uint64_t > _seen {0}Defined in src/vision/include/icy/vision/framesampler.h:142
_forwarded
std::atomic< uint64_t > _forwarded {0}Defined in src/vision/include/icy/vision/framesampler.h:143
_dropped
std::atomic< uint64_t > _dropped {0}Defined in src/vision/include/icy/vision/framesampler.h:144
_lastForwardedTimeUsec
std::atomic< int64_t > _lastForwardedTimeUsec {kUnsetTimeUsec}Defined in src/vision/include/icy/vision/framesampler.h:145
Private Methods
| Return | Name | Description |
|---|---|---|
bool | shouldForward const inline |
shouldForward
const inline
inline bool shouldForward(const av::PlanarVideoPacket & frame, uint64_t seen) constDefined in src/vision/include/icy/vision/framesampler.h:124
Private Static Attributes
| Return | Name | Description |
|---|---|---|
constexpr int64_t | kUnsetTimeUsec static constexpr |
kUnsetTimeUsec
static constexpr
constexpr int64_t kUnsetTimeUsec = std::numeric_limits<int64_t>::min()Defined in src/vision/include/icy/vision/framesampler.h:115
Private Static Methods
| Return | Name | Description |
|---|---|---|
FrameSamplerConfig | sanitize static inline |
sanitize
static inline
static inline FrameSamplerConfig sanitize(FrameSamplerConfig config)