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

◆ add_processor()

bool MayaFlux::Buffers::BufferProcessingChain::add_processor ( const std::shared_ptr< BufferProcessor > &  processor,
const std::shared_ptr< Buffer > &  buffer,
std::string *  rejection_reason = nullptr 
)

Adds a processor to the transformation pipeline for a specific buffer.

Parameters
processorProcessor to add
bufferBuffer to associate with this processor
rejection_reasonOptional reason for rejection if the processor cannot be added
Returns
true if the processor was successfully added, false if it was rejected

The processor is added to the end of the transformation sequence for the specified buffer. If this is the first processor for the buffer, a new sequence is created. The chain performs intelligent validation and optimization:

  • Compatibility Validation: Ensures the processor can handle the buffer's data type
  • Backend Analysis: Analyzes processor backend preferences for optimization opportunities
  • Pipeline Optimization: May reorder or batch processors for improved performance
  • Resource Planning: Allocates necessary resources for the processor's execution

Definition at line 9 of file BufferProcessingChain.cpp.

10{
11 if (m_is_processing.load(std::memory_order_acquire) || processor->m_active_processing.load(std::memory_order_acquire) > 0) {
12 return queue_pending_processor_op(processor, buffer, true, rejection_reason);
13 }
14
15 return add_processor_direct(processor, buffer, rejection_reason);
16}
bool queue_pending_processor_op(const std::shared_ptr< BufferProcessor > &processor, const std::shared_ptr< Buffer > &buffer, bool is_addition, std::string *rejection_reason=nullptr)
bool add_processor_direct(const std::shared_ptr< BufferProcessor > &processor, const std::shared_ptr< Buffer > &buffer, std::string *rejection_reason=nullptr)

References add_processor_direct(), m_is_processing, and queue_pending_processor_op().

Referenced by MayaFlux::Buffers::FileToStreamChain::attach_to_buffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: