MCPcopy Create free account
hub / github.com/IENT/YUView / loadFrame

Method loadFrame

YUViewLib/src/playlistitem/playlistItemDifference.cpp:220–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220void playlistItemDifference::loadFrame(int frameIdx,
221 bool playing,
222 bool loadRawData,
223 bool emitSignals)
224{
225 if (childCount() != 2 || !difference.inputsValid())
226 return;
227
228 auto state = difference.needsLoading(frameIdx, loadRawData);
229 if (state == ItemLoadingState::LoadingNeeded)
230 {
231 // Load the requested current frame
232 DEBUG_DIFF("playlistItemDifference::loadFrame loading difference for frame %d", frameIdx);
233 isDifferenceLoading = true;
234 // Since every playlist item can have it's own relative indexing, we need two frame indices
235 difference.loadFrameDifference(frameIdx);
236 isDifferenceLoading = false;
237 if (emitSignals)
238 emit SignalItemChanged(true, RECACHE_NONE);
239 }
240
241 if (playing && (state == ItemLoadingState::LoadingNeeded ||
242 state == ItemLoadingState::LoadingNeededDoubleBuffer))
243 {
244 // Load the next frame into the double buffer
245 int nextFrameIdx = frameIdx + 1;
246 if (nextFrameIdx <= this->properties().startEndRange.second)
247 {
248 DEBUG_DIFF("playlistItemDifference::loadFrame loading difference into double buffer %d %s",
249 nextFrameIdx,
250 playing ? "(playing)" : "");
251 isDifferenceLoadingToDoubleBuffer = true;
252 difference.loadFrameDifference(frameIdx, true);
253 isDifferenceLoadingToDoubleBuffer = false;
254 if (emitSignals)
255 emit signalItemDoubleBufferLoaded();
256 }
257 }
258}
259
260bool playlistItemDifference::isLoading() const { return this->isDifferenceLoading; }
261

Callers

nothing calls this directly

Calls 4

inputsValidMethod · 0.80
loadFrameDifferenceMethod · 0.80
propertiesMethod · 0.80
needsLoadingMethod · 0.45

Tested by

no test coverage detected