464{
465 if (!matrix) {
467 "VisionWorkflow::process_to_live_container: no matrix");
468 return nullptr;
469 }
470
471 const auto frames =
source_frames(source,
"process_to_live_container");
472 if (!frames)
473 return nullptr;
474
475 const auto live = live_config.value_or(LiveConfig {});
476 const auto& apply_to = live.apply_to;
477
478 if (spec.width == 0 || spec.height == 0) {
479 spec.width = apply_to ? apply_to->get_width() :
source->get_width();
480 spec.height = apply_to ? apply_to->get_height() :
source->get_height();
481 }
482
483 auto collection = std::make_shared<Kakshya::TextureCollection>(spec);
484 if (collection->is_full()) {
486 "VisionWorkflow::process_to_live_container: a {}-byte cap holds no {}x{} layer, nothing recorded",
487 spec.max_bytes, spec.width, spec.height);
488 return collection;
489 }
490
491 const auto name = run_name(
"container");
493 return collection;
494}
#define MF_WARN(comp, ctx,...)
std::shared_ptr< Buffers::TextureBuffer > source_frames(const std::shared_ptr< Kakshya::VideoStreamContainer > &source, std::string_view caller) const
void start(const std::shared_ptr< Kakshya::VideoStreamContainer > &source, const std::shared_ptr< Buffers::TextureBuffer > &frames, const LiveConfig &live, const std::shared_ptr< VisionMatrix > &matrix, const std::string &name, std::function< void(const VisionIO &)> consumer, std::function< bool()> stop_when={})
Subscribe consumer and start the producer named name, which stops the run at source's end,...
std::weak_ptr< Vruta::TaskScheduler > m_scheduler
@ ComputeMatrix
Compute operations (Yantra - algorithms, matrices, DSP)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.
std::shared_ptr< Kriya::BufferPipeline > record_into(const std::shared_ptr< Kakshya::DynamicSoundStream > &stream, Kriya::CaptureBuilder source, uint32_t channel)
Record a signal into one channel of a stream, a block at a time.