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

◆ process()

void MayaFlux::Kakshya::VisionProcessor::process ( const std::shared_ptr< SignalSourceContainer > &  container)
overridevirtual

Execute the VisionSequence on processed_data[0].

No-op when processed_data is empty, the pixel span normalises to empty, or geometry was not cached at on_attach time.

Parameters
containerThe container to read processed_data[0] from.

Implements MayaFlux::Kakshya::DataProcessor.

Definition at line 75 of file VisionProcessor.cpp.

76{
77 if (m_width == 0 || m_height == 0 || !container)
78 return;
79
80 m_is_processing.store(true, std::memory_order_release);
81
82 if (m_force_cpu) {
83 std::span<const float> frame;
84 if (auto vc = std::dynamic_pointer_cast<VideoStreamContainer>(container)) {
85 frame = vc->processed_frame_as_float(0);
86 vc->invalidate_float_frame_cache(0);
87 } else if (auto wc = std::dynamic_pointer_cast<WindowContainer>(container)) {
88 frame = wc->processed_frame_as_float(0);
89 wc->invalidate_float_frame_cache(0);
90 } else if (auto tc = std::dynamic_pointer_cast<TextureContainer>(container)) {
91 frame = tc->as_normalised_float(0);
92 }
93 if (!frame.empty())
95 } else if (m_gpu_frame) {
96 const void* raw = container->get_raw_data();
97 if (raw) {
99 loom.upload_data(m_gpu_frame, raw, m_gpu_frame->get_size_bytes(), m_upload_staging);
101 }
102 }
103
104 if (m_result_source)
105 m_result_source->signal(m_result);
106
107 m_is_processing.store(false, std::memory_order_release);
108}
std::shared_ptr< Buffers::VKBuffer > m_upload_staging
Kinesis::Vision::VisionExecutor m_cpu_executor
std::shared_ptr< Vruta::BroadcastSource< Kinesis::Vision::VisionResult > > m_result_source
Kinesis::Vision::VisionSequence m_sequence
std::unique_ptr< Yantra::VisionGpuExecutor > m_executor
std::shared_ptr< Core::VKImage > m_gpu_frame
Kinesis::Vision::VisionResult m_result
VisionResult run(const VisionSequence &sequence, std::span< const float > frame, uint32_t w, uint32_t h)
Execute a VisionSequence on one frame.

References MayaFlux::Portal::Graphics::TextureLoom::instance(), m_cpu_executor, m_executor, m_force_cpu, m_gpu_frame, m_height, m_is_processing, m_result, m_result_source, m_sequence, m_upload_staging, m_width, and MayaFlux::Kinesis::Vision::VisionExecutor::run().

+ Here is the call graph for this function: