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

Method startRender

Engine/OutputSchedulerThread.cpp:1023–1129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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