diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-29 16:08:26 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-29 16:08:26 +0400 |
commit | d8bdd4497eec824a522062c4a8b597ef25395d63 (patch) | |
tree | c797600b9e618ff184cdf16c36d59a9196d9cc7d /source/blender/imbuf/IMB_imbuf.h | |
parent | 31cd0521ae64e95982bd4bd4f8685b7cf96d4248 (diff) |
Refactor of proxies build operators
Split proxy build operator into three parts:
- Prepare context (IMB_anim_index_rebuild_context) which prepares all
needed data and stores it in an anonymous structure used by specific
builder lately.
- Build proxies/timecodes into temporary files (IMB_anim_index_rebuild)
This function will build all selected proxies/timecodes into a temporary
files so old proxies will be still available during building.
- Finish building proxies (IMB_anim_index_rebuild_finish) which copies
temporary files over old proxies filed and releases all resources used
by a context.
Context creation and finishing building happens in a main thread so
it's easy and safe to close all opened handles of proxies files and
refresh cache after rebuilding is finished.
This should finally fix #30315: Temporary proxy files are not erased and old proxys are not updated if the proxy is built more then once (windows)
Diffstat (limited to 'source/blender/imbuf/IMB_imbuf.h')
-rw-r--r-- | source/blender/imbuf/IMB_imbuf.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 5f38142726f..dfd53a145f6 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -217,13 +217,19 @@ void IMB_anim_set_index_dir(struct anim * anim, const char * dir); int IMB_anim_index_get_frame_index(struct anim * anim, IMB_Timecode_Type tc, int position); +struct IndexBuildContext; + +/* prepare context for proxies/imecodes builder */ +struct IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, IMB_Timecode_Type tcs_in_use, + IMB_Proxy_Size proxy_sizes_in_use, int quality); + /* will rebuild all used indices and proxies at once */ -void IMB_anim_index_rebuild(struct anim * anim, - IMB_Timecode_Type build_tcs, - IMB_Proxy_Size build_preview_sizes, - int build_quality, +void IMB_anim_index_rebuild(struct IndexBuildContext *context, short *stop, short *do_update, float *progress); +/* finish rebuilding proxises/timecodes and free temporary contexts used */ +void IMB_anim_index_rebuild_finish(struct IndexBuildContext *context, short stop); + /** * Return the length (in frames) of the given @a anim. */ @@ -243,6 +249,7 @@ int IMB_anim_get_fps(struct anim * anim, */ struct anim *IMB_open_anim(const char *name, int ib_flags, int streamindex); void IMB_close_anim(struct anim *anim); +void IMB_close_anim_proxies(struct anim *anim); /** |