MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / decodeSampled

Method decodeSampled

pj_scene2D/core/src/streaming_video_decoder.cpp:302–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void StreamingVideoDecoder::decodeSampled(Timestamp interval_ns, const std::function<bool(const DecodedFrame&)>& sink) {
303 if (store_ == nullptr || interval_ns <= 0 || store_->entryCount(topic_) == 0) {
304 return;
305 }
306 // Adaptive dispatch: when the source already carries keyframes at least as dense
307 // as the requested cadence, decode only ~1 keyframe per interval (same cadence,
308 // near-instant). Otherwise fall back to the forward pass.
309 if (sampledUsesKeyframeOnly(interval_ns)) {
310 decodeSampledKeyframes(interval_ns, sink);
311 } else {
312 decodeSampledForward(interval_ns, sink);
313 }
314}
315
316void StreamingVideoDecoder::decodeSampledKeyframes(
317 Timestamp interval_ns, const std::function<bool(const DecodedFrame&)>& sink) {

Callers 2

buildThreadMethod · 0.80
TESTFunction · 0.80

Calls 1

entryCountMethod · 0.80

Tested by 1

TESTFunction · 0.64