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

◆ distribute()

DistributionDecision MayaFlux::Buffers::BufferTokenDistributor::distribute ( const std::shared_ptr< Buffer > &  buffer,
ProcessingToken  requested_token 
)
static

Distribute a buffer based on its type and requested token.

Parameters
bufferThe buffer to distribute
requested_tokenThe token being requested
Returns
Distribution decision with routing instructions

Definition at line 14 of file BufferTokenDistributor.cpp.

17{
18 if (!buffer) {
19 return DistributionDecision {
21 .transfer_processor = nullptr,
22 .transfer_direction = ProcessingToken::AUDIO_BACKEND,
23 .reason = "Null buffer provided"
24 };
25 }
26
27 if (auto audio = std::dynamic_pointer_cast<AudioBuffer>(buffer)) {
28 return decide_audio_buffer(audio, requested_token);
29 }
30
31 if (auto vk = std::dynamic_pointer_cast<VKBuffer>(buffer)) {
32 return decide_vk_buffer(vk, requested_token);
33 }
34
35 return DistributionDecision {
37 .transfer_processor = nullptr,
38 .transfer_direction = ProcessingToken::AUDIO_BACKEND,
39 .reason = "Unknown buffer type"
40 };
41}
static DistributionDecision decide_vk_buffer(const std::shared_ptr< VKBuffer > &vk, ProcessingToken token)
static DistributionDecision decide_audio_buffer(const std::shared_ptr< AudioBuffer > &audio, ProcessingToken token)
@ AUDIO_BACKEND
Standard audio processing backend configuration.

References MayaFlux::Buffers::AUDIO_BACKEND, decide_audio_buffer(), decide_vk_buffer(), MayaFlux::Buffers::REJECTED, and MayaFlux::Buffers::DistributionDecision::result.

Referenced by distribute_with_transfer().

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