|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
Advanced pipeline manager for multi-stage buffer transformations with backend optimization. More...
#include <BufferProcessingChain.hpp>
Collaboration diagram for MayaFlux::Buffers::BufferProcessingChain:Classes | |
| struct | PendingProcessorOp |
Public Member Functions | |
| void | add_final_processor (const std::shared_ptr< BufferProcessor > &processor, const std::shared_ptr< Buffer > &buffer) |
| Sets a special processor to be applied after the main pipeline. | |
| void | add_postprocessor (const std::shared_ptr< BufferProcessor > &processor, const std::shared_ptr< Buffer > &buffer) |
| Sets a postprocessor to be applied after the main pipeline. | |
| void | add_preprocessor (const std::shared_ptr< BufferProcessor > &processor, const std::shared_ptr< Buffer > &buffer) |
| Sets a preprocessor to be applied before the main pipeline. | |
| bool | 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. | |
| std::vector< TokenCompatibilityReport > | analyze_token_compatibility () const |
| Analyzes token compatibility across all processors in the chain. | |
| void | enforce_chain_token_on_processors () |
| Enforces the chain's preferred processing token on all processors. | |
| std::unordered_map< std::shared_ptr< Buffer >, std::vector< std::shared_ptr< BufferProcessor > > > | get_chain () const |
| Gets the entire transformation pipeline structure. | |
| TokenEnforcementStrategy | get_enforcement_strategy () const |
| Gets the current token enforcement strategy for this chain. | |
| ProcessingToken | get_preferred_token () const |
| Gets the preferred processing token for this chain. | |
| template<typename T > | |
| std::shared_ptr< T > | get_processor (const std::shared_ptr< Buffer > &buffer) const |
| Gets a processor of a specific type from the buffer's processing pipeline. | |
| const std::vector< std::shared_ptr< BufferProcessor > > & | get_processors (const std::shared_ptr< Buffer > &buffer) const |
| Gets all processors in a buffer's transformation pipeline. | |
| bool | has_pending_operations () const |
| bool | has_processors (const std::shared_ptr< Buffer > &buffer) const |
| Checks if a buffer has any processors in its pipeline. | |
| void | merge_chain (const std::shared_ptr< BufferProcessingChain > &other) |
| Combines another processing pipeline into this one with optimization. | |
| void | optimize_for_tokens (const std::shared_ptr< Buffer > &buffer) |
| Optimizes the processing pipeline for improved performance. | |
| void | postprocess (const std::shared_ptr< Buffer > &buffer) |
| Applies the postprocessor to a buffer. | |
| void | preprocess (const std::shared_ptr< Buffer > &buffer) |
| Applies the preprocessor to a buffer. | |
| void | process (const std::shared_ptr< Buffer > &buffer) |
| Applies the transformation pipeline to a buffer with intelligent execution. | |
| void | process_complete (const std::shared_ptr< Buffer > &buffer) |
| Applies preprocessors, processing chain, post processors and final processors sequentially to a buffer. | |
| void | process_final (const std::shared_ptr< Buffer > &buffer) |
| Applies the final processor to a buffer with guaranteed execution. | |
| void | remove_processor (const std::shared_ptr< BufferProcessor > &processor, const std::shared_ptr< Buffer > &buffer) |
| Removes a processor from the pipeline for a specific buffer. | |
| void | set_enforcement_strategy (TokenEnforcementStrategy strategy) |
| Sets the token enforcement strategy for this chain. | |
| void | set_preferred_token (ProcessingToken token) |
| Sets the preferred processing token for this chain. | |
| bool | validate_all_processors (std::vector< std::string > *incompatibility_reasons=nullptr) const |
| Validates all processors in the chain against the preferred processing token. | |
Protected Member Functions | |
| bool | add_processor_direct (const std::shared_ptr< BufferProcessor > &processor, const std::shared_ptr< Buffer > &buffer, std::string *rejection_reason=nullptr) |
| void | remove_processor_direct (const std::shared_ptr< BufferProcessor > &processor, const std::shared_ptr< Buffer > &buffer) |
Private Member Functions | |
| void | cleanup_rejected_processors (const std::shared_ptr< Buffer > &buffer) |
| Validates the processing token against the chain's preferred token. | |
| void | process_non_owning (const std::shared_ptr< Buffer > &buffer) |
| Internal processing method for non-owning buffer contexts. | |
| void | process_pending_processor_operations () |
| Process pending processor operations. | |
| 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) |
Private Attributes | |
| std::unordered_map< std::shared_ptr< Buffer >, std::vector< std::shared_ptr< BufferProcessor > > > | m_buffer_processors |
| Map of buffers to their processor sequences. | |
| std::unordered_map< std::shared_ptr< Buffer >, std::unordered_set< std::shared_ptr< BufferProcessor > > > | m_conditional_processors |
| Map of buffers to processors that are conditionally applied. | |
| TokenEnforcementStrategy | m_enforcement_strategy { TokenEnforcementStrategy::FILTERED } |
| Token enforcement strategy for this chain. | |
| std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< BufferProcessor > > | m_final_processors |
| Map of buffers to their final processors. | |
| std::atomic< bool > | m_is_processing |
| std::atomic< uint32_t > | m_pending_count { 0 } |
| PendingProcessorOp | m_pending_ops [MAX_PENDING_PROCESSORS] |
| std::unordered_map< std::shared_ptr< Buffer >, std::unordered_set< std::shared_ptr< BufferProcessor > > > | m_pending_removal |
| Map of buffers to processors pending removal. | |
| std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< BufferProcessor > > | m_postprocessors |
| Map of buffers to their postprocessors. | |
| std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< BufferProcessor > > | m_preprocessors |
| Map of buffers to their preprocessors. | |
| ProcessingToken | m_token_filter_mask { ProcessingToken::AUDIO_BACKEND } |
| Preferred processing token for this chain. | |
Static Private Attributes | |
| static constexpr size_t | MAX_PENDING_PROCESSORS = 32 |
Friends | |
| class | BufferProcessor |
Advanced pipeline manager for multi-stage buffer transformations with backend optimization.
BufferProcessingChain organizes multiple BufferProcessor objects into sophisticated transformation pipelines for one or more buffers. This system enables complex multi-stage computational processes to be applied to data in a controlled, deterministic order while leveraging the expanded capabilities of modern BufferProcessors for optimal performance and backend utilization.
The chain implements an intelligent directed acyclic graph (DAG) of transformations, maintaining separate processor sequences for each buffer while enabling advanced features:
Backend-Aware Processing:
Multi-Modal Data Support:
Performance Optimization:
Key features:
Definition at line 45 of file BufferProcessingChain.hpp.