Blender Git Loki
Git Commits -> Revision 808ac6d
Revision 808ac6d by Sergey Sharybin (master) March 20, 2013, 17:03 (GMT) |
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. |
Commit Details:
Full Hash: 808ac6debf45952974c5723bf93a83b1107d6e61
SVN Revision: 55448
Parent Commit: 09a6045
Lines Changed: +596, -19
17 Modified Paths:
/intern/memutil/intern/MEM_CacheLimiterC-Api.cpp (+5, -0) (Diff)
/intern/memutil/MEM_CacheLimiter.h (+8, -6) (Diff)
/intern/memutil/MEM_CacheLimiterC-Api.h (+3, -1) (Diff)
/source/blender/blenkernel/BKE_movieclip.h (+5, -1) (Diff)
/source/blender/blenkernel/intern/movieclip.c (+80, -6) (Diff)
/source/blender/blenloader/intern/readfile.c (+2, -0) (Diff)
/source/blender/editors/space_clip/clip_draw.c (+2, -0) (Diff)
/source/blender/editors/space_clip/clip_editor.c (+393, -0) (Diff)
/source/blender/editors/space_clip/clip_intern.h (+3, -0) (Diff)
/source/blender/editors/space_clip/clip_ops.c (+4, -1) (Diff)
/source/blender/editors/space_clip/space_clip.c (+25, -0) (Diff)
/source/blender/imbuf/IMB_moviecache.h (+2, -0) (Diff)
/source/blender/imbuf/intern/moviecache.c (+43, -3) (Diff)
/source/blender/makesdna/DNA_movieclip_types.h (+5, -0) (Diff)
/source/blender/makesrna/intern/rna_userdef.c (+1, -1) (Diff)
/source/blender/windowmanager/intern/wm_jobs.c (+13, -0) (Diff)
/source/blender/windowmanager/WM_api.h (+2, -0) (Diff)
/intern/memutil/MEM_CacheLimiter.h (+8, -6) (Diff)
/intern/memutil/MEM_CacheLimiterC-Api.h (+3, -1) (Diff)
/source/blender/blenkernel/BKE_movieclip.h (+5, -1) (Diff)
/source/blender/blenkernel/intern/movieclip.c (+80, -6) (Diff)
/source/blender/blenloader/intern/readfile.c (+2, -0) (Diff)
/source/blender/editors/space_clip/clip_draw.c (+2, -0) (Diff)
/source/blender/editors/space_clip/clip_editor.c (+393, -0) (Diff)
/source/blender/editors/space_clip/clip_intern.h (+3, -0) (Diff)
/source/blender/editors/space_clip/clip_ops.c (+4, -1) (Diff)
/source/blender/editors/space_clip/space_clip.c (+25, -0) (Diff)
/source/blender/imbuf/IMB_moviecache.h (+2, -0) (Diff)
/source/blender/imbuf/intern/moviecache.c (+43, -3) (Diff)
/source/blender/makesdna/DNA_movieclip_types.h (+5, -0) (Diff)
/source/blender/makesrna/intern/rna_userdef.c (+1, -1) (Diff)
/source/blender/windowmanager/intern/wm_jobs.c (+13, -0) (Diff)
/source/blender/windowmanager/WM_api.h (+2, -0) (Diff)