|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
Coroutine-based execution engine for composable, multi-strategy buffer processing. More...
#include <BufferPipeline.hpp>
Inheritance diagram for MayaFlux::Kriya::BufferPipeline:
Collaboration diagram for MayaFlux::Kriya::BufferPipeline:Classes | |
| struct | BranchInfo |
| struct | GraphicsReader |
Public Member Functions | |
| BufferPipeline & | branch_if (std::function< bool(uint32_t)> condition, const std::function< void(BufferPipeline &)> &branch_builder, bool synchronous=false, uint64_t samples_per_operation=1) |
| Add conditional branch to the pipeline. | |
| BufferPipeline ()=default | |
| BufferPipeline (Vruta::TaskScheduler &scheduler, std::shared_ptr< Buffers::BufferManager > buffer_manager=nullptr, std::shared_ptr< IO::IOManager > io_manager=nullptr) | |
| BufferPipeline & | capture_timing (Vruta::DelayContext mode) |
| Set timing mode for capture phase. | |
| void | end () |
| End a running pipeline now. | |
| void | execute_buffer_rate (uint64_t max_cycles=0) |
| Execute pipeline synchronized to audio hardware cycle boundaries. | |
| void | execute_continuous () |
| Start continuous execution of the pipeline. | |
| void | execute_for_cycles (uint64_t cycles=0) |
| Execute the pipeline for a specified number of cycles. | |
| void | execute_frame_rate (uint64_t max_cycles=0, uint64_t frames_per_operation=0) |
| Execute the pipeline at graphics frame rate. | |
| void | execute_once () |
| Execute the pipeline for a single cycle. | |
| void | execute_scheduled (uint64_t max_cycles=0, uint64_t samples_per_operation=1) |
| Execute pipeline with sample-accurate timing between operations. | |
| void | execute_scheduled_at_rate (uint32_t max_cycles=0, double seconds_per_operation=1) |
| Execute pipeline with real-time rate control. | |
| uint32_t | get_current_cycle () const |
| Get the current cycle number. | |
| std::shared_ptr< Kakshya::DynamicVideoStream > | get_graphics_stream () const |
| The dynamic video stream of the first operation that writes one. | |
| ExecutionStrategy | get_strategy () const |
| Get current execution strategy. | |
| bool | has_pending_data () const |
| Check if any operations have pending data ready for processing. | |
| bool | is_running () const |
| True from an execute call until the pipeline ends or runs out of cycles. | |
| void | mark_data_consumed (uint32_t operation_index) |
| Execute pipeline synchronized to audio hardware cycle boundaries. | |
| BufferPipeline & | on_complete (std::function< void()> cb) |
| Register a callback fired once when pipeline execution ends. | |
| BufferPipeline & | operator>> (BufferOperation &&operation) |
| Chain an operation to the pipeline. | |
| BufferPipeline & | parallel (std::initializer_list< BufferOperation > operations) |
| Execute operations in parallel within the current cycle. | |
| BufferPipeline & | process_timing (Vruta::DelayContext mode) |
| Set timing mode for process phase. | |
| void | stop_continuous () |
| Stop continuous execution of the pipeline. | |
| BufferPipeline & | with_lifecycle (std::function< void(uint32_t)> on_cycle_start, std::function< void(uint32_t)> on_cycle_end) |
| Set lifecycle callbacks for cycle management. | |
| BufferPipeline & | with_strategy (ExecutionStrategy strategy) |
| Set the execution strategy for this pipeline. | |
| ~BufferPipeline () | |
Static Public Member Functions | |
| static std::shared_ptr< BufferPipeline > | create (Vruta::TaskScheduler &scheduler, std::shared_ptr< Buffers::BufferManager > buffer_manager=nullptr, std::shared_ptr< IO::IOManager > io_manager=nullptr) |
Private Types | |
| enum class | DataState : uint8_t { EMPTY , READY , CONSUMED , EXPIRED } |
Private Member Functions | |
| void | await_timing (Vruta::DelayContext mode, uint64_t units) |
| void | capture_operation (BufferOperation &op, uint64_t cycle) |
| void | cleanup_completed_branches () |
| void | cleanup_expired_data () |
| std::shared_ptr< Vruta::SoundRoutine > | dispatch_branch_async (BranchInfo &branch, uint64_t cycle) |
| std::vector< std::shared_ptr< Vruta::Routine > > | dispatch_cycle_branches (bool frame_rate) |
| std::shared_ptr< Vruta::GraphicsRoutine > | dispatch_frame_branch (BranchInfo &branch) |
| void | execute_capture_phase (uint64_t cycle_base) |
| Vruta::GraphicsRoutine | execute_frame_internal (uint64_t max_cycles, uint64_t frames_per_operation) |
| Vruta::GraphicsRoutine | execute_frame_phased (uint64_t max_cycles, uint64_t frames_per_operation) |
| Vruta::GraphicsRoutine | execute_frame_streaming (uint64_t max_cycles, uint64_t frames_per_operation) |
| Vruta::SoundRoutine | execute_internal (uint64_t max_cycles, uint64_t samples_per_operation) |
| Vruta::SoundRoutine | execute_parallel (uint64_t max_cycles, uint64_t samples_per_operation) |
| Vruta::SoundRoutine | execute_phased (uint64_t max_cycles, uint64_t samples_per_operation) |
| void | execute_process_phase (uint64_t cycle) |
| Vruta::SoundRoutine | execute_reactive (uint64_t max_cycles, uint64_t samples_per_operation) |
| Vruta::SoundRoutine | execute_streaming (uint64_t max_cycles, uint64_t samples_per_operation) |
| void | finish_cycle () |
| void | flow_through (size_t index, uint64_t cycle) |
| bool | has_immediate_routing (const BufferOperation &op) const |
| bool | operation_due (const BufferOperation &op) const |
| uint32_t | operation_iterations (const BufferOperation &op) const |
| void | prepare_displays () |
| void | process_dispatch (BufferOperation &op, uint64_t cycle) |
| void | process_fuse (BufferOperation &op, uint64_t cycle) |
| void | process_load (BufferOperation &op) |
| void | process_modify (BufferOperation &op, uint64_t cycle) |
| void | process_operation (BufferOperation &op, uint64_t cycle) |
| void | process_route (BufferOperation &op) |
| void | process_transform (BufferOperation &op, uint64_t cycle) |
| void | queue_graphics_write (BufferOperation &op, const std::shared_ptr< Buffers::VKBuffer > &target, const Kakshya::DataVariant &data) |
| std::optional< Kakshya::DataVariant > | read_graphics_buffer (BufferOperation &op, const std::shared_ptr< Buffers::VKBuffer > &buffer) |
| void | reset_accumulated_data () |
| void | reset_cycle_state () |
| bool | route_image (BufferOperation &op) |
| void | start_cycle () |
Static Private Member Functions | |
| static bool | any_active (const std::vector< std::shared_ptr< Vruta::Routine > > &tasks) |
Coroutine-based execution engine for composable, multi-strategy buffer processing.
BufferPipeline provides a flexible framework for orchestrating complex data flow patterns through declarative operation chains. It supports multiple execution strategies (phased, streaming, parallel, reactive), sophisticated data accumulation modes, and sample-accurate timing coordination via the coroutine scheduler.
Core Concepts:
Simple Capture & Route:
Accumulation & Batch Processing (PHASED strategy):
Real-Time Streaming Modification (STREAMING strategy):
Circular Buffer for Rolling Analysis:
Windowed Capture with Overlap:
Multi-Source Fusion:
Conditional Branching:
Per-Iteration Routing (Immediate Routing):
Lifecycle Callbacks:
Execution Modes:
execute_buffer_rate(N): Synchronized to audio buffer boundaries for N cyclesexecute_continuous(): Runs indefinitely until stoppedexecute_for_cycles(N): Runs exactly N cycles then stopsexecute_once(): Single cycle executionexecute_scheduled(N, samples): With sample-accurate delays between operationsStrategy Selection:
Definition at line 171 of file BufferPipeline.hpp.