97 throw std::invalid_argument(
"SAMPLE_RATE and FRAME_RATE are mutually exclusive.");
101 throw std::invalid_argument(
"CPU_PROCESS and GPU_PROCESS are mutually exclusive.");
105 throw std::invalid_argument(
"SEQUENTIAL and PARALLEL are mutually exclusive.");
142 bool preferred_frame = preferred &
FRAME_RATE;
147 if (preferred_frame && !current_frame)
150 if (preferred_sample && current_frame)
153 if ((preferred_sample && current_sample) || (preferred_frame && current_frame))
162 if (preferred_sample && current_gpu)
164 if (preferred_gpu && current_cpu)
167 if (preferred_cpu && current_gpu && !current_frame)
172 bool preferred_par = preferred &
PARALLEL;
174 bool current_par = current &
PARALLEL;
176 if ((preferred_seq && current_par) || (preferred_par && current_seq)) {
178 if ((preferred_sample && current_sample) || (preferred_frame && current_frame))
209 if (buffer_type ==
"audio") {
211 }
else if (buffer_type ==
"video" || buffer_type ==
"texture") {
221struct hash<
std::pair<MayaFlux::Buffers::ProcessingToken, MayaFlux::Buffers::ProcessingToken>> {
222 size_t operator()(
const std::pair<MayaFlux::Buffers::ProcessingToken, MayaFlux::Buffers::ProcessingToken>& pair)
const
224 return hash<uint32_t>()(
static_cast<uint32_t
>(pair.first)) ^ (hash<uint32_t>()(
static_cast<uint32_t
>(pair.second)) << 1);
static MayaFlux::Nodes::ProcessingToken token
bool are_tokens_compatible(ProcessingToken preferred, ProcessingToken current)
Determines if two processing tokens are compatible for joint execution.
ProcessingToken
Bitfield enum defining processing characteristics and backend requirements for buffer operations.
@ SAMPLE_RATE
Processes data at audio sample rate with buffer-sized chunks.
@ CPU_PROCESS
Executes processing operations on CPU threads.
@ AUDIO_BACKEND
Standard audio processing backend configuration.
@ PARALLEL
Processes operations in parallel when possible.
@ SEQUENTIAL
Processes operations sequentially, one after another.
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.
@ FRAME_RATE
Processes data at video frame rate.
@ GPU_PPOCESS
Executes processing operations on GPU hardware.
@ AUDIO_PARALLEL
High-performance audio processing with GPU acceleration.
TokenEnforcementStrategy
Defines how strictly processing token requirements are enforced in buffer processing chains.
@ OVERRIDE_SKIP
Allows token overrides but skips processing for incompatible operations.
@ STRICT
Strictly enforces token assignment with no cross-token sharing.
@ OVERRIDE_REJECT
Allows token overrides but rejects incompatible processors from chains.
@ FILTERED
Filters processors through token enumeration, allowing compatible combinations.
@ IGNORE
Ignores token assignments completely, allowing any processing combination.
void validate_token(ProcessingToken token)
Validates that a processing token has a valid, non-conflicting configuration.
ProcessingToken get_optimal_token(const std::string &buffer_type, uint32_t system_capabilities)
Gets the optimal processing token for a given buffer type and system configuration.
size_t operator()(const std::pair< MayaFlux::Buffers::ProcessingToken, MayaFlux::Buffers::ProcessingToken > &pair) const