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

◆ decide_audio_buffer()

DistributionDecision MayaFlux::Buffers::BufferTokenDistributor::decide_audio_buffer ( const std::shared_ptr< AudioBuffer > &  audio,
ProcessingToken  token 
)
staticprivate

Definition at line 103 of file BufferTokenDistributor.cpp.

106{
108 return DistributionDecision {
110 .transfer_processor = nullptr,
111 .transfer_direction = ProcessingToken::AUDIO_BACKEND,
112 .reason = "AudioBuffer requires SAMPLE_RATE token with CPU or GPU device"
113 };
114 }
115
116 // Decision 1: AUDIO_PARALLEL (GPU audio) → INTERNAL_ONLY
118 audio->force_internal_usage(true);
119 return DistributionDecision {
121 .transfer_processor = nullptr,
122 .transfer_direction = ProcessingToken::AUDIO_BACKEND,
123 .reason = "Audio buffer with GPU processing marked internal"
124 };
125 }
126
127 // Decision 2: Normal audio (SAMPLE_RATE + CPU) → DIRECT_ROOT
129 audio->force_internal_usage(false);
130 return DistributionDecision {
132 .transfer_processor = nullptr,
133 .transfer_direction = ProcessingToken::AUDIO_BACKEND,
134 .reason = "Audio buffer registered to root"
135 };
136 }
137
138 return DistributionDecision {
140 .transfer_processor = nullptr,
141 .transfer_direction = ProcessingToken::AUDIO_BACKEND,
142 .reason = "AudioBuffer token combination not handled"
143 };
144}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
static bool is_valid_audio_token(ProcessingToken token)
static bool has_gpu(ProcessingToken token)
static bool has_cpu(ProcessingToken token)
static bool has_sample_rate(ProcessingToken token)
@ AUDIO_BACKEND
Standard audio processing backend configuration.

References MayaFlux::Buffers::AUDIO_BACKEND, MayaFlux::Buffers::DIRECT_ROOT, has_cpu(), has_gpu(), has_sample_rate(), MayaFlux::Buffers::INTERNAL_ONLY, is_valid_audio_token(), MayaFlux::Buffers::REJECTED, MayaFlux::Buffers::DistributionDecision::result, and token.

Referenced by distribute().

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