blender/intern/memutil
Sergey Sharybin 808ac6debf Prefetching for movie clips
This commit basically implements frames prefetching for
movie clip datablock.

Number of frames to be prefetched is controlled in User
Preferences, System tab, Prefetch Frames option.

Currently prefetching is destructive-less for movie cache,
meaning mo frames will be removed from the cache when while
prefetching. This is because it's half of simplier to
implement, but it also makes sense from tracking point of
view -- we could want to playback in both directions and
removing frames from behind time cursor is not always a
good idea.

Anyway, smarter prefetching strategy could be developed
later.

Some implementation notes:

- Added MEM_CacheLimiter_get_memory_in_use function to get
  memory usage of specified memory limiter.

- Fixed prototype of MEM_CacheLimiter_get_maximum which
  was simply wrong (used wrong data type for output).

- Added some utility functions to movie clip and movie
  cache for direct cache interaction and obtaining cache
  statistics.

- Prefetching is implemented using general jobs system.
  which is invoking from clip draw function.

- Prefetcing will stop as soon other job or playback starts.
  This is done from performance point of view. Jobs will
  likely require lots of CPU power and better to provide
  whole CPU to it.

  Playback is a bit more complicated case. For jpeg sequence
  playback prefetching while paying back is nice. But trying
  to prefetch heavy exr images and doing color space
  conversion slows down both playback and prefetching.

TODO:

- Think of better policy of dealing with already cached frames
  (like when cached frames from other clips prevents frames
  from current clip to be prefetched)

- Currently a bit funky redraw notification happens from
  prefetch job. Perhaps own ND_ is better to have here.

- Hiding clip while prefetch is active in theory shall stop
  prefetching job.

- Having multiple clips opened on file load will prefetch
  frames for only one of them.
2013-03-20 17:03:20 +00:00
..
intern Prefetching for movie clips 2013-03-20 17:03:20 +00:00
CMakeLists.txt remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
MEM_Allocator.h code cleanup: 0 --> NULL 2013-03-08 06:32:00 +00:00
MEM_CacheLimiter.h Prefetching for movie clips 2013-03-20 17:03:20 +00:00
MEM_CacheLimiterC-Api.h Prefetching for movie clips 2013-03-20 17:03:20 +00:00
MEM_NonCopyable.h unify include guard defines, __$FILENAME__ 2012-02-17 18:59:41 +00:00
MEM_RefCounted.h unify include guard defines, __$FILENAME__ 2012-02-17 18:59:41 +00:00
MEM_RefCountedC-Api.h unify include guard defines, __$FILENAME__ 2012-02-17 18:59:41 +00:00
MEM_RefCountPtr.h fix some types and incorrect info 2012-07-26 17:41:09 +00:00
MEM_SmartPtr.h code cleanup: spelling, 2012-11-12 07:33:01 +00:00
SConscript Added GPL header to sconscripts! 2012-12-17 08:01:43 +00:00