MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / startRender

Method startRender

Engine/OutputSchedulerThread.cpp:1028–1134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1026}
1027
1028void
1029OutputSchedulerThread::startRender()
1030{
1031 if ( isFPSRegulationNeeded() ) {
1032 _imp->timer.playState = ePlayStateRunning;
1033 }
1034
1035 // Start measuring
1036 _imp->renderTimer.reset(new TimeLapse);
1037
1038 ///We will push frame to renders starting at startingFrame.
1039 ///They will be in the range determined by firstFrame-lastFrame
1040 int startingFrame;
1041 int firstFrame, lastFrame;
1042 int frameStep;
1043 bool forward;
1044 OutputSchedulerThreadStartArgsPtr args = _imp->runArgs.lock();
1045 ///Copy the last requested run args
1046
1047 firstFrame = args->firstFrame;
1048 lastFrame = args->lastFrame;
1049 frameStep = args->frameStep;
1050 startingFrame = timelineGetTime();
1051 forward = args->pushTimelineDirection == eRenderDirectionForward;
1052
1053
1054 aboutToStartRender();
1055
1056 ///Notify everyone that the render is started
1057 _imp->engine->s_renderStarted(forward);
1058
1059#ifndef NATRON_PLAYBACK_USES_THREAD_POOL
1060 int nThreads;
1061 {
1062 QMutexLocker l(&_imp->renderThreadsMutex);
1063 _imp->removeAllQuitRenderThreads();
1064 nThreads = (int)_imp->renderThreads.size();
1065 }
1066
1067 ///Start with one thread if it doesn't exist
1068 if (nThreads == 0) {
1069 int lastNThreads;
1070 adjustNumberOfThreads(&nThreads, &lastNThreads);
1071 }
1072#endif
1073
1074 QMutexLocker l(&_imp->renderThreadsMutex);
1075
1076
1077 ///If the output effect is sequential (only WriteFFMPEG for now)
1078 EffectInstancePtr effect = _imp->outputEffect.lock();
1079 WriteNode* isWriteNode = dynamic_cast<WriteNode*>( effect.get() );
1080 if (isWriteNode) {
1081 NodePtr embeddedWriter = isWriteNode->getEmbeddedWriter();
1082 if (embeddedWriter) {
1083 effect = embeddedWriter->getEffectInstance();
1084 }
1085 }

Callers

nothing calls this directly

Calls 14

s_renderStartedMethod · 0.80
getEmbeddedWriterMethod · 0.80
getEffectInstanceMethod · 0.80
startMethod · 0.80
ViewIdxClass · 0.70
resetMethod · 0.45
lockMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected