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

◆ process_non_owning()

void MayaFlux::Buffers::BufferProcessingChain::process_non_owning ( const std::shared_ptr< Buffer > &  buffer)
private

Internal processing method for non-owning buffer contexts.

Parameters
bufferBuffer to process

This method is used internally by BufferProcessingChain to process buffers that are not owned by the chain itself. It ensures that the processor's processing function is called in a thread-safe manner, managing the active processing state to prevent concurrent access issues.

Definition at line 98 of file BufferProcessingChain.cpp.

99{
100 if (m_pending_count.load(std::memory_order_relaxed) > 0) {
102 }
103
104 auto it = m_buffer_processors.find(buffer);
105 if (it == m_buffer_processors.end() || it->second.empty()) {
106 return;
107 }
108
109 for (auto& processor : it->second) {
110 bool should_process = true;
111
113 auto processor_token = processor->get_processing_token();
114 should_process = are_tokens_compatible(m_token_filter_mask, processor_token);
115 }
116
117 if (should_process) {
118 processor->process_non_owning(buffer); // non-owning calls non-owning
119 }
120 }
121
124 }
125}
ProcessingToken m_token_filter_mask
Preferred processing token for this chain.
std::unordered_map< std::shared_ptr< Buffer >, std::vector< std::shared_ptr< BufferProcessor > > > m_buffer_processors
Map of buffers to their processor sequences.
void cleanup_rejected_processors(const std::shared_ptr< Buffer > &buffer)
Validates the processing token against the chain's preferred token.
void process_pending_processor_operations()
Process pending processor operations.
TokenEnforcementStrategy m_enforcement_strategy
Token enforcement strategy for this chain.
bool are_tokens_compatible(ProcessingToken preferred, ProcessingToken current)
Determines if two processing tokens are compatible for joint execution.
@ OVERRIDE_SKIP
Allows token overrides but skips processing for incompatible operations.
@ OVERRIDE_REJECT
Allows token overrides but rejects incompatible processors from chains.

References MayaFlux::Buffers::are_tokens_compatible(), cleanup_rejected_processors(), m_buffer_processors, m_enforcement_strategy, m_pending_count, m_token_filter_mask, MayaFlux::Buffers::OVERRIDE_REJECT, MayaFlux::Buffers::OVERRIDE_SKIP, and process_pending_processor_operations().

+ Here is the call graph for this function: