MayaFlux 0.2.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 233 of file Scheduler.cpp.

234{
235 auto clock_it = m_token_clocks.find(token);
236 if (clock_it == m_token_clocks.end()) {
237 unsigned int domain_rate = (rate > 0) ? rate : get_default_rate(token);
238
239 switch (token) {
241 m_token_clocks[token] = std::make_unique<SampleClock>(domain_rate);
242 break;
244 m_token_clocks[token] = std::make_unique<SampleClock>(domain_rate);
245 break;
247 m_token_clocks[token] = std::make_unique<SampleClock>(domain_rate);
248 break;
249 default:
250 m_token_clocks[token] = std::make_unique<SampleClock>(domain_rate);
251 break;
252 }
253 }
254}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
unsigned int get_default_rate(ProcessingToken token) const
Get the default rate for a processing token.
std::unordered_map< ProcessingToken, std::unique_ptr< IClock > > m_token_clocks
Clock instances for each processing domain.
@ FRAME_ACCURATE
Coroutine is frame-accurate.
@ SAMPLE_ACCURATE
Coroutine is sample-accurate.
@ ON_DEMAND
Coroutine is executed on demand, not scheduled.

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

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

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