nus-vv-streams / vvtk

A toolkit for volumetric video research
MIT License
9 stars 8 forks source link

Fixed prefetching logic #48

Closed tiif closed 3 months ago

tiif commented 8 months ago

This PR fixed the prefetching logic when the playing is not sequential.

New prefetching algorithm:


Test:

//then use UI to jump to frame 3

//result [3(ready), 4(ready), 5(ready), 6(ready)]


- Test 2: Request for a not ready frame inside the buffer

// buffer setup [1(ready), 2(ready), 3(ready), 4(decoding)]

//use UI to jump to frame 4

//buffer result [4(ready), 5(decoding), 6(decoding), 7(decoding)]


- Test 3: Request for a frame which is not inside the buffer > current frame range in buffer, and is not in the playback cache either

// buffer setup [1(ready), 2(decoding), 3(decoding), 4(decoding)]

//use UI to jump to frame 10

// result [10(decoding), 11(decoding), 12(decoding), 13(decoding)]


- Test 4: Request for a frame which is not inside the buffer < current frame range in buffer, and is not in the playback cache either

// buffer setup [20(ready), 21(ready), 22(ready), 23(ready)]

// use UI to jump to frame 8

// buffer result [8(decoding), 9(decoding), 10(decoding), 11(decoding)]


-----------------------------------------------------------------------------
### Extra note:
- If the ``CameraPosition`` of previous frame is retrievable, the program will use that; else, it will just use the default ``CameraPosition``
- Once a frame is requested, there is no way to cancel it. All the previous ``FrameRequest`` needs to be processed in order for the current ``FrameRequest`` to be handled.