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

Method loadFrame

YUViewLib/src/video/VideoCache.cpp:390–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390void VideoCache::loadFrame(playlistItem *item, int frameIndex, int loadingSlot)
391{
392 if (item == nullptr || item->taggedForDeletion() ||
393 (frameIndex < 0 && item->properties().isIndexedByFrame()))
394 // The item is not loadable (invalid, tagged for deletion, and invalid frame index was given)
395 return;
396
397 assert(loadingSlot == 0 || loadingSlot == 1);
398 if (interactiveThread[loadingSlot]->worker()->isWorking())
399 {
400 // The interactive worker is currently busy ...
401 if (interactiveThread[loadingSlot]->worker()->getCacheItem() != item ||
402 interactiveThread[loadingSlot]->worker()->getCacheFrame() != frameIndex)
403 {
404 // ... and it is not working on the requested frame. Schedule this load request as the next
405 // one.
406 DEBUG_CACHING_DETAIL(
407 "VideoCache::loadFrame %d queued for later - slot %d", frameIndex, loadingSlot);
408 interactiveItemQueued[loadingSlot] = item;
409 interactiveItemQueued_Idx[loadingSlot] = frameIndex;
410 }
411 }
412 else
413 {
414 // Let the interactive worker work...
415 bool loadRawData = splitView->showRawData() && !playback->playing();
416 interactiveThread[loadingSlot]->worker()->setJob(item, frameIndex);
417 interactiveThread[loadingSlot]->worker()->setWorking(true);
418 interactiveThread[loadingSlot]->worker()->processLoadingJob(playback->playing(), loadRawData);
419 DEBUG_CACHING_DETAIL("VideoCache::loadFrame %d started - slot %d", frameIndex, loadingSlot);
420
421 emit updateCacheStatus();
422 }
423}
424
425void VideoCache::interactiveLoaderFinished()
426{

Callers 5

playbackStartedMethod · 0.45
updateMethod · 0.45
loadFrameDifferenceMethod · 0.45
loadResampledFrameMethod · 0.45

Calls 12

taggedForDeletionMethod · 0.80
isIndexedByFrameMethod · 0.80
propertiesMethod · 0.80
isWorkingMethod · 0.80
workerMethod · 0.80
getCacheItemMethod · 0.80
getCacheFrameMethod · 0.80
showRawDataMethod · 0.80
playingMethod · 0.80
setJobMethod · 0.80
setWorkingMethod · 0.80
processLoadingJobMethod · 0.80

Tested by

no test coverage detected