| 388 | } |
| 389 | |
| 390 | void 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 | |
| 425 | void VideoCache::interactiveLoaderFinished() |
| 426 | { |
no test coverage detected