Vision module
FrameSampler
PacketProcessor that forwards a sampled subset of decoded video frames.
FrameSampler
#include <icy/vision/framesampler.h>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.
Public Attributes
| Return | Name | Description |
|---|---|---|
PacketSignal | emitter |
emitter
PacketSignal emitterPublic 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 | This method performs processing on the given packet and emits the result. |
bool | accepts virtual inline | This method ensures compatibility with the given packet type. Return false to reject the packet. |
FrameSampler
inline explicit
inline explicit FrameSampler(FrameSamplerConfig config)setConfig
inline
inline void setConfig(FrameSamplerConfig config)config
const inline
inline FrameSamplerConfig config() conststats
const inline
inline FrameSamplerStats stats() constreset
inline
inline void reset()process
virtual inline
virtual inline void process(IPacket & packet)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().
accepts
virtual inline
virtual inline bool accepts(IPacket *)This method ensures compatibility with the given packet type. Return false to reject the packet.
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 _config_seen
std::atomic< uint64_t > _seen {0}_forwarded
std::atomic< uint64_t > _forwarded {0}_dropped
std::atomic< uint64_t > _dropped {0}_lastForwardedTimeUsec
std::atomic< int64_t > _lastForwardedTimeUsec {kUnsetTimeUsec}Private Methods
| Return | Name | Description |
|---|---|---|
bool | shouldForward const inline |
shouldForward
const inline
inline bool shouldForward(const av::PlanarVideoPacket & frame, uint64_t seen) constPrivate Static Methods
| Return | Name | Description |
|---|---|---|
FrameSamplerConfig | sanitize static inline |
sanitize
static inline
static inline FrameSamplerConfig sanitize(FrameSamplerConfig config)