MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kriya::BufferCapture Class Reference

Flexible data capture interface for buffer-based processing pipelines. More...

#include <Capture.hpp>

+ Collaboration diagram for MayaFlux::Kriya::BufferCapture:

Public Types

enum class  CaptureMode : uint8_t {
  TRANSIENT , ACCUMULATE , TRIGGERED , WINDOWED ,
  CIRCULAR
}
 Defines the data capture and retention strategy. More...
 
enum class  ProcessingControl : uint8_t { AUTOMATIC , ON_CAPTURE , MANUAL }
 Controls how and when data processing occurs. More...
 

Public Member Functions

BufferCapture & as_circular (uint32_t size)
 Enable circular buffer mode with fixed size.
 
 BufferCapture ()=default
 
 BufferCapture (std::nullptr_t)
 
 BufferCapture (std::shared_ptr< Buffers::AudioBuffer > buffer, CaptureMode mode=CaptureMode::TRANSIENT, uint32_t cycle_count=1)
 Construct a BufferCapture with specified mode and parameters.
 
 BufferCapture (std::shared_ptr< Buffers::VKBuffer > buffer, CaptureMode mode=CaptureMode::TRANSIENT, uint32_t cycle_count=1)
 
BufferCapture & for_cycles (uint32_t count)
 Set the number of times to execute this capture operation.
 
std::shared_ptr< Buffers::AudioBuffer > get_audio_buffer () const
 Return the configured audio source.
 
uint32_t get_circular_size () const
 
uint32_t get_cycle_count () const
 
std::shared_ptr< Buffers::VKBuffer > get_graphics_buffer () const
 Return the configured graphics source.
 
CaptureMode get_mode () const
 
float get_overlap_ratio () const
 
ProcessingControl get_processing_control () const
 
std::shared_ptr< Buffers::Buffer > get_source_buffer () const
 Return the configured source buffer.
 
const std::string & get_tag () const
 
uint32_t get_window_size () const
 
BufferCapture & on_cycle_complete (std::function< void(uint32_t)> callback)
 Set callback for when a capture cycle completes.
 
BufferCapture & on_data_expired (std::function< void(const Kakshya::DataVariant &, uint32_t)> callback)
 Set callback for when captured data expires.
 
BufferCapture & on_data_ready (OperationFunction callback)
 Set callback for when captured data is ready.
 
void set_processing_control (ProcessingControl control)
 
BufferCapture & until_condition (std::function< bool()> predicate)
 Set a condition that stops capture when met.
 
BufferCapture & with_metadata (const std::string &key, const std::string &value)
 Add metadata key-value pair.
 
BufferCapture & with_processing_control (ProcessingControl control)
 Set processing control strategy.
 
BufferCapture & with_tag (const std::string &tag)
 Assign a tag for identification and organization.
 
BufferCapture & with_window (uint32_t window_size, float overlap_ratio=0.0F)
 Configure windowed capture with overlap.
 

Private Attributes

std::shared_ptr< Buffers::AudioBuffer > m_audio_buffer
 
uint32_t m_circular_size {}
 
std::function< void(uint32_t)> m_cycle_callback
 
uint32_t m_cycle_count { 1 }
 
std::function< void(const Kakshya::DataVariant &, uint32_t)> m_data_expired_callback
 
OperationFunction m_data_ready_callback
 
std::shared_ptr< Buffers::VKBuffer > m_graphics_buffer
 
std::unordered_map< std::string, std::string > m_metadata
 
CaptureMode m_mode { CaptureMode::TRANSIENT }
 
float m_overlap_ratio {}
 
ProcessingControl m_processing_control = ProcessingControl::AUTOMATIC
 
std::function< bool()> m_stop_condition
 
std::string m_tag
 
uint32_t m_window_size {}
 

Friends

class BufferOperation
 
class BufferPipeline
 

Detailed Description

Flexible data capture interface for buffer-based processing pipelines.

BufferCapture provides sophisticated data capture capabilities within the Kriya processing system, enabling various capture modes and lifecycle management for buffer data. It supports transient, accumulative, windowed, and circular capture patterns for different real-time processing scenarios.

Capture Modes:

  • TRANSIENT: Single-cycle capture with automatic expiration (default)
  • ACCUMULATE: Multi-cycle accumulation in persistent container
  • TRIGGERED: Conditional capture based on predicates
  • WINDOWED: Rolling window capture with configurable overlap
  • CIRCULAR: Fixed-size circular buffer with overwrite behavior

Key Features:

  • Multiple capture strategies for different use cases
  • Callback system for data lifecycle events
  • Metadata and tagging support for organization
  • Integration with BufferPipeline and BufferOperation
  • Scheduler timing and synchronization

Use Cases:

  • Real-time audio analysis and feature extraction
  • Frame capture from graphics buffers
  • Streaming data collection for machine learning
  • Circular delay lines and feedback systems
  • Windowed processing for spectral analysis
  • Event-driven data capture and recording
See also
BufferOperation For pipeline integration
BufferPipeline For execution context
CaptureBuilder For fluent construction

Definition at line 55 of file Capture.hpp.


The documentation for this class was generated from the following files: