| 1134 | } // OutputSchedulerThread::startRender |
| 1135 | |
| 1136 | void |
| 1137 | OutputSchedulerThread::stopRender() |
| 1138 | { |
| 1139 | _imp->timer.playState = ePlayStatePause; |
| 1140 | |
| 1141 | #ifdef NATRON_SCHEDULER_SPAWN_THREADS_WITH_TIMER |
| 1142 | QMutexLocker k(&_imp->lastRecordedFPSMutex); |
| 1143 | _imp->lastRecordedFPS = _imp->timer.getActualFrameRate(); |
| 1144 | _imp->threadSpawnsTimer.stop(); |
| 1145 | #endif |
| 1146 | |
| 1147 | ///Wait for all render threads to be done |
| 1148 | |
| 1149 | #ifndef NATRON_PLAYBACK_USES_THREAD_POOL |
| 1150 | ///Clear the work queue |
| 1151 | { |
| 1152 | QMutexLocker framesLocker (&_imp->framesToRenderMutex); |
| 1153 | _imp->framesToRender.clear(); |
| 1154 | } |
| 1155 | #endif |
| 1156 | |
| 1157 | ///Remove all current threads so the new render doesn't have many threads concurrently trying to do the same thing at the same time |
| 1158 | #ifndef NATRON_PLAYBACK_USES_THREAD_POOL |
| 1159 | stopRenderThreads(0); |
| 1160 | #endif |
| 1161 | _imp->waitForRenderThreadsToQuit(); |
| 1162 | |
| 1163 | ///If the output effect is sequential (only WriteFFMPEG for now) |
| 1164 | EffectInstancePtr effect = _imp->outputEffect.lock(); |
| 1165 | WriteNode* isWriteNode = dynamic_cast<WriteNode*>( effect.get() ); |
| 1166 | if (isWriteNode) { |
| 1167 | NodePtr embeddedWriter = isWriteNode->getEmbeddedWriter(); |
| 1168 | if (embeddedWriter) { |
| 1169 | effect = embeddedWriter->getEffectInstance(); |
| 1170 | } |
| 1171 | } |
| 1172 | SequentialPreferenceEnum pref = effect->getSequentialPreference(); |
| 1173 | if ( (pref == eSequentialPreferenceOnlySequential) || (pref == eSequentialPreferencePreferSequential) ) { |
| 1174 | int firstFrame, lastFrame; |
| 1175 | OutputSchedulerThreadStartArgsPtr args = _imp->runArgs.lock(); |
| 1176 | firstFrame = args->firstFrame; |
| 1177 | lastFrame = args->lastFrame; |
| 1178 | |
| 1179 | RenderScale scaleOne(1.); |
| 1180 | ignore_result( effect->endSequenceRender_public( firstFrame, lastFrame, |
| 1181 | 1, |
| 1182 | !appPTR->isBackground(), |
| 1183 | scaleOne, true, |
| 1184 | !appPTR->isBackground(), |
| 1185 | false, |
| 1186 | ViewIdx(0), |
| 1187 | false /*use OpenGL render*/, |
| 1188 | EffectInstance::OpenGLContextEffectDataPtr() ) ); |
| 1189 | } |
| 1190 | |
| 1191 | |
| 1192 | bool wasAborted = isBeingAborted(); |
| 1193 |
nothing calls this directly
no test coverage detected