MayaFlux 0.4.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 364 of file Scheduler.cpp.

365{
366 if (token == ProcessingToken::CONDITIONAL)
367 return;
368
369 auto clock_it = m_token_clocks.find(token);
370 if (clock_it == m_token_clocks.end()) {
371 unsigned int domain_rate = (rate > 0) ? rate : get_default_rate(token);
372
373 switch (token) {
375 m_token_clocks[token] = std::make_shared<FrameClock>(domain_rate);
376 break;
379 default:
380 m_token_clocks[token] = std::make_shared<SampleClock>(domain_rate);
381 break;
382 }
383 }
384}
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, 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: