MayaFlux 0.1.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 231 of file Scheduler.cpp.

232{
233 auto clock_it = m_token_clocks.find(token);
234 if (clock_it == m_token_clocks.end()) {
235 unsigned int domain_rate = (rate > 0) ? rate : get_default_rate(token);
236
237 switch (token) {
239 m_token_clocks[token] = std::make_unique<SampleClock>(domain_rate);
240 break;
242 m_token_clocks[token] = std::make_unique<SampleClock>(domain_rate);
243 break;
245 m_token_clocks[token] = std::make_unique<SampleClock>(domain_rate);
246 break;
247 default:
248 m_token_clocks[token] = std::make_unique<SampleClock>(domain_rate);
249 break;
250 }
251 }
252}
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: