|
Blender V4.3
|
#include <cstddef>#include <ctime>#include <memory.h>#include "MEM_guardedalloc.h"#include "DNA_scene_types.h"#include "DNA_sequence_types.h"#include "DNA_space_types.h"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "BLI_fileops_types.h"#include "BLI_ghash.h"#include "BLI_mempool.h"#include "BLI_threads.h"#include "BKE_main.hh"#include "SEQ_prefetch.hh"#include "SEQ_relations.hh"#include "SEQ_render.hh"#include "SEQ_time.hh"#include "disk_cache.hh"#include "image_cache.hh"#include "prefetch.hh"Go to the source code of this file.
Classes | |
| struct | SeqCache |
| struct | SeqCacheItem |
Functions | |
| static bool | seq_cmp_render_data (const SeqRenderData *a, const SeqRenderData *b) |
| static uint | seq_hash_render_data (const SeqRenderData *a) |
| static uint | seq_cache_hashhash (const void *key_) |
| static bool | seq_cache_hashcmp (const void *a_, const void *b_) |
| static float | seq_cache_timeline_frame_to_frame_index (const Scene *scene, const Sequence *seq, const float timeline_frame, const int type) |
| float | seq_cache_frame_index_to_timeline_frame (Sequence *seq, float frame_index) |
| static SeqCache * | seq_cache_get_from_scene (Scene *scene) |
| static void | seq_cache_lock (Scene *scene) |
| static void | seq_cache_unlock (Scene *scene) |
| static size_t | seq_cache_get_mem_total () |
| static void | seq_cache_keyfree (void *val) |
| static void | seq_cache_valfree (void *val) |
| static int | get_stored_types_flag (Scene *scene, SeqCacheKey *key) |
| static void | seq_cache_put_ex (Scene *scene, SeqCacheKey *key, ImBuf *ibuf) |
| static ImBuf * | seq_cache_get_ex (SeqCache *cache, SeqCacheKey *key) |
| static void | seq_cache_key_unlink (SeqCacheKey *key) |
| static SeqCacheKey * | seq_cache_choose_key (Scene *scene, SeqCacheKey *lkey, SeqCacheKey *rkey) |
| static void | seq_cache_recycle_linked (Scene *scene, SeqCacheKey *base) |
| static SeqCacheKey * | seq_cache_get_item_for_removal (Scene *scene) |
| bool | seq_cache_recycle_item (Scene *scene) |
| static void | seq_cache_set_temp_cache_linked (Scene *scene, SeqCacheKey *base) |
| static void | seq_cache_create (Main *bmain, Scene *scene) |
| static void | seq_cache_populate_key (SeqCacheKey *key, const SeqRenderData *context, Sequence *seq, const float timeline_frame, const int type) |
| static SeqCacheKey * | seq_cache_allocate_key (SeqCache *cache, const SeqRenderData *context, Sequence *seq, const float timeline_frame, const int type) |
| void | seq_cache_free_temp_cache (Scene *scene, short id, int timeline_frame) |
| void | seq_cache_destruct (Scene *scene) |
| void | SEQ_cache_cleanup (Scene *scene) |
| void | seq_cache_cleanup_sequence (Scene *scene, Sequence *seq, Sequence *seq_changed, int invalidate_types, bool force_seq_changed_range) |
| ImBuf * | seq_cache_get (const SeqRenderData *context, Sequence *seq, float timeline_frame, int type) |
| bool | seq_cache_put_if_possible (const SeqRenderData *context, Sequence *seq, float timeline_frame, int type, ImBuf *ibuf) |
| void | seq_cache_put (const SeqRenderData *context, Sequence *seq, float timeline_frame, int type, ImBuf *i) |
| void | SEQ_cache_iterate (Scene *scene, void *userdata, bool callback_init(void *userdata, size_t item_count), bool callback_iter(void *userdata, Sequence *seq, int timeline_frame, int cache_type)) |
| bool | seq_cache_is_full () |
Variables | |
| static ThreadMutex | cache_create_lock = BLI_MUTEX_INITIALIZER |
|
static |
Definition at line 195 of file image_cache.cc.
References Sequence::cache_flag, flag, SeqCacheKey::seq, SEQ_CACHE_OVERRIDE, and SEQ_CACHE_STORE_FINAL_OUT.
Referenced by seq_cache_put_ex().
|
static |
Definition at line 528 of file image_cache.cc.
References BLI_mempool_alloc(), SeqCache::keys_pool, and seq_cache_populate_key().
Referenced by seq_cache_get(), and seq_cache_put().
|
static |
Definition at line 275 of file image_cache.cc.
References SEQ_CACHE_PREFETCH_ENABLE, seq_prefetch_get_time_range(), seq_prefetch_job_is_running(), and SeqCacheKey::timeline_frame.
Referenced by seq_cache_get_item_for_removal().
| void SEQ_cache_cleanup | ( | Scene * | scene | ) |
Definition at line 596 of file image_cache.cc.
References BLI_assert, BLI_ghash_remove(), BLI_ghashIterator_done(), BLI_ghashIterator_getKey(), BLI_ghashIterator_init(), BLI_ghashIterator_step(), SeqCacheKey::cache_owner, SeqCache::hash, SeqCache::last_key, seq_cache_get_from_scene(), seq_cache_keyfree(), seq_cache_lock(), seq_cache_unlock(), seq_cache_valfree(), and SEQ_prefetch_stop().
Referenced by do_render_full_pipeline(), screen_render_exec(), and SEQ_relations_free_imbuf().
| void seq_cache_cleanup_sequence | ( | Scene * | scene, |
| Sequence * | seq, | ||
| Sequence * | seq_changed, | ||
| int | invalidate_types, | ||
| bool | force_seq_changed_range ) |
Definition at line 622 of file image_cache.cc.
References BLI_assert, BLI_ghash_remove(), BLI_ghashIterator_done(), BLI_ghashIterator_getKey(), BLI_ghashIterator_init(), BLI_ghashIterator_step(), SeqCache::bmain, SeqCacheKey::cache_owner, SeqCache::disk_cache, SeqCacheKey::frame_index, SeqCache::hash, SeqCache::last_key, max_ii(), min_ii(), SeqCacheKey::seq, seq_cache_get_from_scene(), seq_cache_key_unlink(), seq_cache_keyfree(), seq_cache_lock(), SEQ_CACHE_STORE_COMPOSITE, SEQ_CACHE_STORE_FINAL_OUT, SEQ_CACHE_STORE_PREPROCESSED, SEQ_CACHE_STORE_RAW, seq_cache_timeline_frame_to_frame_index(), seq_cache_unlock(), seq_cache_valfree(), seq_disk_cache_invalidate(), seq_disk_cache_is_enabled(), SEQ_time_left_handle_frame_get(), SEQ_time_right_handle_frame_get(), and SeqCacheKey::type.
Referenced by SEQ_relations_invalidate_cache_in_range(), sequence_do_invalidate_dependent(), and sequence_invalidate_cache().
Definition at line 489 of file image_cache.cc.
References BLI_ghash_new(), BLI_mempool_create(), BLI_MEMPOOL_NOP, BLI_mutex_init(), BLI_mutex_lock(), BLI_mutex_unlock(), SeqCache::bmain, cache_create_lock, SeqCache::hash, SeqCache::items_pool, SeqCache::iterator_mutex, SeqCache::keys_pool, SeqCache::last_key, MEM_callocN, seq_cache_hashcmp(), seq_cache_hashhash(), and time.
Referenced by seq_cache_get(), and seq_cache_put().
| void seq_cache_destruct | ( | Scene * | scene | ) |
Definition at line 576 of file image_cache.cc.
References BLI_ghash_free(), BLI_mempool_destroy(), BLI_mutex_end(), SeqCache::disk_cache, SeqCache::hash, SeqCache::items_pool, SeqCache::iterator_mutex, SeqCache::keys_pool, MEM_freeN(), seq_cache_get_from_scene(), seq_cache_keyfree(), seq_cache_valfree(), and seq_disk_cache_free().
Referenced by SEQ_editing_free().
Definition at line 141 of file image_cache.cc.
References SEQ_time_start_frame_get().
Referenced by seq_disk_cache_delete_invalid_files().
Definition at line 541 of file image_cache.cc.
References BLI_assert, BLI_ghash_remove(), BLI_ghashIterator_done(), BLI_ghashIterator_getKey(), BLI_ghashIterator_init(), BLI_ghashIterator_step(), SeqCacheKey::cache_owner, SeqCacheKey::frame_index, SeqCache::hash, SeqCacheKey::is_temp_cache, SeqCache::last_key, SeqCacheKey::seq, seq_cache_get_from_scene(), seq_cache_key_unlink(), seq_cache_keyfree(), seq_cache_lock(), seq_cache_timeline_frame_to_frame_index(), seq_cache_unlock(), seq_cache_valfree(), SEQ_time_left_handle_frame_get(), SEQ_time_right_handle_frame_get(), SeqCacheKey::task_id, and SeqCacheKey::type.
Referenced by seq_prefetch_frames(), and SEQ_render_give_ibuf().
| ImBuf * seq_cache_get | ( | const SeqRenderData * | context, |
| Sequence * | seq, | ||
| float | timeline_frame, | ||
| int | type ) |
Definition at line 687 of file image_cache.cc.
References SeqCache::disk_cache, seq_cache_allocate_key(), seq_cache_create(), seq_cache_get_ex(), seq_cache_get_from_scene(), seq_cache_lock(), seq_cache_populate_key(), seq_cache_put_ex(), seq_cache_recycle_item(), SEQ_CACHE_STORE_FINAL_OUT, seq_cache_unlock(), seq_disk_cache_create(), seq_disk_cache_is_enabled(), seq_disk_cache_read_file(), seq_prefetch_get_original_context(), seq_prefetch_get_original_sequence(), and SeqCacheKey::type.
Referenced by seq_cache_put(), seq_prefetch_seq_has_disk_cache(), SEQ_render_give_ibuf(), seq_render_strip(), and seq_render_strip_stack().
|
static |
Definition at line 248 of file image_cache.cc.
References BLI_ghash_lookup(), SeqCache::hash, SeqCacheItem::ibuf, and IMB_refImBuf().
Referenced by seq_cache_get().
Definition at line 146 of file image_cache.cc.
Referenced by SEQ_cache_cleanup(), seq_cache_cleanup_sequence(), seq_cache_destruct(), seq_cache_free_temp_cache(), seq_cache_get(), seq_cache_get_item_for_removal(), SEQ_cache_iterate(), seq_cache_lock(), seq_cache_populate_key(), seq_cache_put(), seq_cache_put_ex(), seq_cache_recycle_item(), seq_cache_recycle_linked(), seq_cache_set_temp_cache_linked(), and seq_cache_unlock().
|
static |
Definition at line 383 of file image_cache.cc.
References BLI_assert, BLI_ghashIterator_done(), BLI_ghashIterator_getKey(), BLI_ghashIterator_getValue(), BLI_ghashIterator_init(), BLI_ghashIterator_step(), SeqCacheKey::cache_owner, SeqCache::hash, SeqCacheItem::ibuf, SeqCacheKey::is_temp_cache, SeqCacheKey::link_next, seq_cache_choose_key(), seq_cache_get_from_scene(), seq_cache_recycle_linked(), and SeqCacheKey::timeline_frame.
Referenced by seq_cache_recycle_item().
|
static |
Definition at line 173 of file image_cache.cc.
Referenced by seq_cache_is_full().
|
static |
Definition at line 116 of file image_cache.cc.
References b, and seq_cmp_render_data().
Referenced by seq_cache_create().
|
static |
Definition at line 104 of file image_cache.cc.
References SeqCacheKey::context, SeqCacheKey::frame_index, SeqCacheKey::seq, seq_hash_render_data(), and SeqCacheKey::type.
Referenced by seq_cache_create().
| bool seq_cache_is_full | ( | ) |
Definition at line 868 of file image_cache.cc.
References MEM_get_memory_in_use, and seq_cache_get_mem_total().
Referenced by seq_cache_recycle_item(), and seq_prefetch_is_cache_full().
| void SEQ_cache_iterate | ( | Scene * | scene, |
| void * | userdata, | ||
| bool | callback_initvoid *userdata, size_t item_count, | ||
| bool | callback_itervoid *userdata, Sequence *seq, int timeline_frame, int cache_type ) |
Definition at line 823 of file image_cache.cc.
References BLI_assert, BLI_ghash_len(), BLI_ghashIterator_done(), BLI_ghashIterator_getKey(), BLI_ghashIterator_init(), BLI_ghashIterator_step(), SeqCacheKey::cache_owner, SeqCacheKey::frame_index, SeqCache::hash, SeqCache::last_key, SeqCacheKey::seq, seq_cache_get_from_scene(), seq_cache_lock(), SEQ_CACHE_STORE_FINAL_OUT, seq_cache_unlock(), SEQ_time_start_frame_get(), SeqCacheKey::timeline_frame, and SeqCacheKey::type.
Referenced by draw_cache_view().
|
static |
Definition at line 261 of file image_cache.cc.
References BLI_assert, SeqCacheKey::link_next, and SeqCacheKey::link_prev.
Referenced by seq_cache_cleanup_sequence(), seq_cache_free_temp_cache(), and seq_cache_recycle_linked().
|
static |
Definition at line 178 of file image_cache.cc.
References BLI_mempool_free(), SeqCacheKey::cache_owner, and SeqCache::keys_pool.
Referenced by SEQ_cache_cleanup(), seq_cache_cleanup_sequence(), seq_cache_destruct(), seq_cache_free_temp_cache(), and seq_cache_recycle_linked().
|
static |
Definition at line 155 of file image_cache.cc.
References BLI_mutex_lock(), SeqCache::iterator_mutex, and seq_cache_get_from_scene().
Referenced by SEQ_cache_cleanup(), seq_cache_cleanup_sequence(), seq_cache_free_temp_cache(), seq_cache_get(), SEQ_cache_iterate(), seq_cache_put(), and seq_cache_recycle_item().
|
static |
Definition at line 509 of file image_cache.cc.
References SeqCacheKey::cache_owner, SeqCacheKey::context, SeqCacheKey::frame_index, SeqCacheKey::is_temp_cache, SeqCacheKey::link_next, SeqCacheKey::link_prev, SeqCacheKey::seq, seq_cache_get_from_scene(), seq_cache_timeline_frame_to_frame_index(), SeqCacheKey::task_id, SeqCacheKey::timeline_frame, and SeqCacheKey::type.
Referenced by seq_cache_allocate_key(), and seq_cache_get().
| void seq_cache_put | ( | const SeqRenderData * | context, |
| Sequence * | seq, | ||
| float | timeline_frame, | ||
| int | type, | ||
| ImBuf * | i ) |
Definition at line 776 of file image_cache.cc.
References BLI_assert, SeqCache::disk_cache, IMB_freeImBuf(), SeqCacheKey::is_temp_cache, seq_cache_allocate_key(), seq_cache_create(), seq_cache_get(), seq_cache_get_from_scene(), seq_cache_lock(), seq_cache_put_ex(), seq_cache_unlock(), seq_disk_cache_create(), seq_disk_cache_enforce_limits(), seq_disk_cache_is_enabled(), seq_disk_cache_write_file(), seq_prefetch_get_original_context(), and seq_prefetch_get_original_sequence().
Referenced by seq_cache_put_if_possible(), SEQ_render_give_ibuf(), seq_render_preprocess_ibuf(), seq_render_scene_strip(), and seq_render_strip_stack().
|
static |
Definition at line 211 of file image_cache.cc.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_insert(), BLI_mempool_alloc(), SeqCacheItem::cache_owner, get_stored_types_flag(), SeqCache::hash, SeqCacheItem::ibuf, IMB_refImBuf(), SeqCacheKey::is_temp_cache, SeqCache::items_pool, SeqCache::last_key, SeqCacheKey::link_next, SeqCacheKey::link_prev, seq_cache_get_from_scene(), SEQ_CACHE_STORE_FINAL_OUT, and SeqCacheKey::type.
Referenced by seq_cache_get(), and seq_cache_put().
| bool seq_cache_put_if_possible | ( | const SeqRenderData * | context, |
| Sequence * | seq, | ||
| float | timeline_frame, | ||
| int | type, | ||
| ImBuf * | ibuf ) |
Definition at line 748 of file image_cache.cc.
References seq_cache_put(), seq_cache_recycle_item(), seq_cache_set_temp_cache_linked(), seq_prefetch_get_original_context(), and seq_prefetch_get_original_sequence().
Referenced by SEQ_render_give_ibuf().
| bool seq_cache_recycle_item | ( | Scene * | scene | ) |
Find only "base" keys. Sources(other types) for a frame must be freed all at once.
Definition at line 441 of file image_cache.cc.
References seq_cache_get_from_scene(), seq_cache_get_item_for_removal(), seq_cache_is_full(), seq_cache_lock(), seq_cache_recycle_linked(), and seq_cache_unlock().
Referenced by seq_cache_get(), seq_cache_put_if_possible(), and seq_prefetch_is_cache_full().
|
static |
Definition at line 336 of file image_cache.cc.
References BLI_assert, BLI_ghash_haskey(), BLI_ghash_remove(), SeqCache::hash, SeqCache::last_key, SeqCacheKey::link_next, SeqCacheKey::link_prev, next, seq_cache_get_from_scene(), seq_cache_key_unlink(), seq_cache_keyfree(), and seq_cache_valfree().
Referenced by seq_cache_get_item_for_removal(), and seq_cache_recycle_item().
|
static |
Definition at line 465 of file image_cache.cc.
References SeqCacheKey::is_temp_cache, SeqCacheKey::link_next, SeqCacheKey::link_prev, next, and seq_cache_get_from_scene().
Referenced by seq_cache_put_if_possible().
|
static |
Definition at line 125 of file image_cache.cc.
References SEQ_CACHE_STORE_RAW, SEQ_give_frame_index(), SEQ_time_start_frame_get(), SEQ_TYPE_EFFECT, and Sequence::type.
Referenced by seq_cache_cleanup_sequence(), seq_cache_free_temp_cache(), and seq_cache_populate_key().
|
static |
Definition at line 164 of file image_cache.cc.
References BLI_mutex_unlock(), SeqCache::iterator_mutex, and seq_cache_get_from_scene().
Referenced by SEQ_cache_cleanup(), seq_cache_cleanup_sequence(), seq_cache_free_temp_cache(), seq_cache_get(), SEQ_cache_iterate(), seq_cache_put(), and seq_cache_recycle_item().
|
static |
Definition at line 184 of file image_cache.cc.
References BLI_mempool_free(), SeqCacheItem::cache_owner, SeqCacheItem::ibuf, IMB_freeImBuf(), and SeqCache::items_pool.
Referenced by SEQ_cache_cleanup(), seq_cache_cleanup_sequence(), seq_cache_destruct(), seq_cache_free_temp_cache(), and seq_cache_recycle_linked().
|
static |
|
static |
|
static |
Definition at line 79 of file image_cache.cc.
Referenced by seq_cache_create().