Vision module

FrameSampler

[PacketProcessor]({#ref classicy_1_1PacketProcessor #}) that forwards a sampled subset of decoded video frames.

FrameSampler

#include </home/runner/work/icey/icey/src/vision/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

ReturnNameDescription
PacketSignalemitter

emitter

PacketSignal emitter

Public Methods

ReturnNameDescription
FrameSampler inline explicit
voidsetConfig inline
FrameSamplerConfigconfig const inline
FrameSamplerStatsstats const inline
voidreset inline
voidprocess virtual inlineThis method performs processing on the given packet and emits the result.
boolaccepts virtual inlineThis 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() const

stats

const inline

inline FrameSamplerStats stats() const

reset

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

ReturnNameDescription
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

ReturnNameDescription
boolshouldForward const inline

shouldForward

const inline

inline bool shouldForward(const av::PlanarVideoPacket & frame, uint64_t seen) const

Private Static Methods

ReturnNameDescription
FrameSamplerConfigsanitize static inline

sanitize

static inline

static inline FrameSamplerConfig sanitize(FrameSamplerConfig config)