MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Buffers::BufferProcessor Class Referenceabstract

Central computational transformation interface for continuous buffer processing. More...

#include <BufferProcessor.hpp>

+ Inheritance diagram for MayaFlux::Buffers::BufferProcessor:
+ Collaboration diagram for MayaFlux::Buffers::BufferProcessor:

Public Member Functions

virtual ~BufferProcessor ()=default
 Virtual destructor for proper cleanup of derived classes.
 
void process (std::shared_ptr< Buffer > buffer)
 Applies a computational transformation to the data in the provided buffer.
 
virtual void processing_function (std::shared_ptr< Buffer > buffer)=0
 The core processing function that must be implemented by derived classes.
 
virtual void on_attach (std::shared_ptr< Buffer >)
 Called when this processor is attached to a buffer.
 
virtual void on_detach (std::shared_ptr< Buffer >)
 Called when this processor is detached from a buffer.
 
virtual void set_processing_token (ProcessingToken token)
 Gets the preferred processing backend for this processor.
 
virtual ProcessingToken get_processing_token () const
 Gets the current processing token for this buffer.
 
virtual bool is_compatible_with (std::shared_ptr< Buffer >) const
 Checks if this processor can handle the specified buffer type.
 

Protected Attributes

ProcessingToken m_processing_token { ProcessingToken::AUDIO_BACKEND }
 

Private Member Functions

void process_non_owning (std::shared_ptr< Buffer > buffer)
 Internal processing method for non-owning buffer contexts.
 

Private Attributes

std::atomic< size_t > m_active_processing { 0 }
 

Friends

class BufferProcessingChain
 

Detailed Description

Central computational transformation interface for continuous buffer processing.

BufferProcessor defines the interface for components that transform data stored in buffer objects within the continuous processing domain of the MayaFlux engine. This design follows the Strategy pattern, allowing different algorithmic transformations to be applied to buffers without changing the underlying buffer implementation, while providing processors with significant agency over processing backend selection and execution strategies.

Unlike Kakshya::DataProcessor which operates on-demand for arbitrary data sources, BufferProcessor is designed for continuous, cycle-based processing within the engine's real-time processing pipeline. Processors have expanded capabilities including:

Backend Influence and Override Capabilities:

  • Processors can influence or override which processing backend a buffer uses
  • Support for both sequential (CPU) and parallel (GPU) execution strategies
  • Dynamic backend selection based on data characteristics and processing requirements
  • Ability to leverage specialized hardware acceleration when available

Data Type Agnostic Processing:

  • Can work on any data type supported by the attached buffer (audio, video, texture, etc.)
  • Automatic adaptation to buffer-specific data formats and layouts
  • Type-safe processing through buffer interface abstraction
  • Support for multi-modal data processing within unified pipelines

Advanced Processing Capabilities:

  • Mathematical transformations (FFT, convolution, statistical analysis)
  • Signal processing algorithms (filtering, modulation, synthesis, effects)
  • Data manipulation (normalization, scaling, interpolation, format conversion)
  • Cross-domain mappings and transformations between different data types
  • Real-time analysis and feature extraction
  • Hardware-accelerated compute operations

The processor system provides a flexible framework for block-based computational operations, complementing the sample-by-sample processing of the node system while enabling efficient parallel transformations and backend-specific optimizations. Processors maintain full compatibility with the buffer architecture while providing the agency to optimize processing strategies based on runtime conditions and hardware capabilities.

Definition at line 49 of file BufferProcessor.hpp.


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