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

◆ ensure_domain()

void MayaFlux::Vruta::TaskScheduler::ensure_domain ( ProcessingToken  token,
unsigned int  rate = 0 
)
private

Initialize a processing domain if it doesn't exist.

Parameters
tokenProcessing domain to initialize
rateProcessing rate for the domain

Definition at line 462 of file Scheduler.cpp.

463{
464 if (token == ProcessingToken::CONDITIONAL)
465 return;
466
467 auto clock_it = m_token_clocks.find(token);
468 if (clock_it == m_token_clocks.end()) {
469 unsigned int domain_rate = (rate > 0) ? rate : get_default_rate(token);
470
471 switch (token) {
473 m_token_clocks[token] = std::make_shared<FrameClock>(domain_rate);
474 break;
477 default:
478 m_token_clocks[token] = std::make_shared<SampleClock>(domain_rate);
479 break;
480 }
481 }
482}
float rate
unsigned int get_default_rate(ProcessingToken token) const
Get the default rate for a processing token.
std::unordered_map< ProcessingToken, std::shared_ptr< IClock > > m_token_clocks
Clock instances for each processing domain.
@ CONDITIONAL
Condition-driven execution - resume when a caller-supplied predicate returns true.
@ FRAME_ACCURATE
Coroutine is frame-accurate.
@ SAMPLE_ACCURATE
Coroutine is sample-accurate.
@ ON_DEMAND
Coroutine is executed on demand, not scheduled.

References MayaFlux::Vruta::CONDITIONAL, MayaFlux::Vruta::FRAME_ACCURATE, get_default_rate(), m_token_clocks, MayaFlux::Vruta::ON_DEMAND, rate, and MayaFlux::Vruta::SAMPLE_ACCURATE.

Referenced by add_task(), register_clock(), register_token_processor(), and TaskScheduler().

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