MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ process_to_live_container() [1/2]

std::shared_ptr< Kakshya::TextureCollection > MayaFlux::Yantra::Vision::VisionWorkflow::process_to_live_container ( const std::shared_ptr< VisionMatrix > &  matrix,
const std::shared_ptr< Kakshya::VideoStreamContainer > &  source,
Kakshya::TextureCollectionSpec  spec = {},
const std::optional< LiveConfig > &  live = {} 
)

process_to_live_container() with a matrix the caller made and configured.

Returns
The collection, or null when matrix is null or as process_to_live_container() fails.

Definition at line 459 of file VisionWorkflow.cpp.

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");
492 start(source, frames, live, matrix, name, record_into(matrix, collection, m_scheduler, name));
493 return collection;
494}
#define MF_WARN(comp, ctx,...)
std::string name
Definition VKDevice.cpp:123
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.
Source source()
Begin a Source chain.
Definition Plot.hpp:127
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.
Definition Rigs.cpp:215

References MayaFlux::Journal::ComputeMatrix, MayaFlux::Kakshya::TextureCollectionSpec::height, m_scheduler, MayaFlux::Kakshya::TextureCollectionSpec::max_bytes, MF_WARN, name, MayaFlux::record_into(), source_frames(), start(), MayaFlux::Kakshya::TextureCollectionSpec::width, and MayaFlux::Journal::Yantra.

+ Here is the call graph for this function: