82 size_t cache_limit = size_t(
U.memcachelimit) * 1024 * 1024;
99 bool evicted_final =
false;
100 bool evicted_source =
false;
104 evicted_final =
false;
105 evicted_source =
false;
108 if (count_final != 0) {
112 if (count_source != 0 && (!final_active || count_source > count_final)) {
115 if (evicted_source && final_active) {
116 const size_t items =
divide_ceil_ul(count_source, std::max<size_t>(count_final, 1));
118 for (
size_t i = 1;
i < items;
i++) {
127 }
while (
is_cache_full(scene) && (evicted_final || evicted_source));
130 return !(evicted_final || evicted_source);
143 if (meta ==
nullptr) {
177 if (scene->ed !=
nullptr) {
188 if (scene->ed !=
nullptr) {
198 for (
Strip *strip =
static_cast<Strip *
>(seqbase->
first); strip !=
nullptr; strip = strip->
next)
200 if (strip->clip == clip_target) {
204 if (strip->seqbase.first !=
nullptr) {
213 scene =
static_cast<Scene *
>(scene->id.next))
215 if (scene->ed !=
nullptr) {
223 if (scene->
ed ==
nullptr) {
256 const int frame_range[2])
259 for (
Strip *strip =
static_cast<Strip *
>(seqbase->
first); strip !=
nullptr; strip = strip->
next)
262 !((frame_range[0] <= timeline_frame) && (frame_range[1] > timeline_frame)))
304 if (strip->scene && strip->scene->ed &&
329 if (recursive_seq !=
nullptr) {
332 "Recursion detected in video sequencer. Strip %s at frame %d will not be rendered",
333 recursive_seq->
name + 2,
351 if (strip_main ==
nullptr || strip ==
nullptr) {
355 if (strip_main == strip) {
381 sanim->
anim =
nullptr;
396 GSet *used_uids = (
GSet *)user_data;
399 printf(
"Sequence %s does not have UID generated.\n", strip->
name);
404 printf(
"Sequence %s has duplicate UID generated.\n", strip->
name);
414 if (scene->
ed ==
nullptr) {
432 if (strip_test == strip) {
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void * BLI_gset_lookup(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_gset_insert(GSet *gs, void *key)
GSet * BLI_gset_new(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
MINLINE uint64_t divide_ceil_ul(uint64_t a, uint64_t b)
bool BLI_session_uid_is_generated(const SessionUID *uid)
uint BLI_session_uid_ghash_hash(const void *uid_v)
bool BLI_session_uid_ghash_compare(const void *lhs_v, const void *rhs_v)
SessionUID BLI_session_uid_generate(void)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_SEQUENCER_STRIPS
@ SEQ_CACHE_STORE_FINAL_OUT
void MOV_close(MovieReader *anim)
void relations_strip_free_anim(Strip *strip)
void prefetch_stop(Scene *scene)
Strip * lookup_meta_by_strip(Editing *ed, const Strip *key)
int time_right_handle_frame_get(const Scene *scene, const Strip *strip)
void foreach_strip(ListBase *seqbase, ForEachFunc callback, void *user_data)
void cache_cleanup_final(Scene *scene)
void relations_invalidate_compositor_modifiers(const Main *bmain, const bNodeTree *node_tree)
bool sequencer_strip_generates_image(Strip *strip)
size_t final_image_cache_calc_memory_size(const Scene *scene)
static void invalidate_movieclip_strips(Scene *scene, MovieClip *clip_target, ListBase *seqbase)
void relations_invalidate_cache(Scene *scene, Strip *strip)
void intra_frame_cache_invalidate(Scene *scene)
static Strip * sequencer_check_scene_recursion(Scene *scene, ListBase *seqbase)
void cache_settings_changed(Scene *scene)
bool relations_render_loop_check(Strip *strip_main, Strip *strip)
void final_image_cache_invalidate_frame_range(Scene *scene, const float timeline_frame_start, const float timeline_frame_end)
void relations_free_all_anim_ibufs(Scene *scene, int timeline_frame)
Span< Strip * > lookup_strips_by_scene(Editing *ed, const Scene *key)
void relations_invalidate_scene_strips(const Main *bmain, const Scene *scene_target)
bool source_image_cache_evict(Scene *scene)
Editing * editing_get(const Scene *scene)
static void invalidate_final_cache_strip_range(Scene *scene, const Strip *strip)
static void invalidate_raw_cache_of_parent_meta(Scene *scene, Strip *strip)
int time_left_handle_frame_get(const Scene *, const Strip *strip)
void source_image_cache_clear(Scene *scene)
static bool get_uids_cb(Strip *strip, void *user_data)
Span< Strip * > lookup_strips_by_compositor_node_group(Editing *ed, const bNodeTree *key)
void relations_invalidate_cache_raw(Scene *scene, Strip *strip)
void thumbnail_cache_clear(Scene *scene)
void source_image_cache_invalidate_strip(Scene *scene, const Strip *strip)
size_t source_image_cache_get_image_count(const Scene *scene)
void relations_invalidate_movieclip_strips(Main *bmain, MovieClip *clip_target)
MetaStack * meta_stack_active_get(const Editing *ed)
bool time_strip_intersects_frame(const Scene *scene, const Strip *strip, const int timeline_frame)
void final_image_cache_clear(Scene *scene)
void strip_effect_speed_rebuild_map(Scene *scene, Strip *strip)
void cache_cleanup(Scene *scene)
static void sequencer_all_free_anim_ibufs(const Scene *scene, ListBase *seqbase, int timeline_frame, const int frame_range[2])
bool final_image_cache_evict(Scene *scene)
bool is_cache_full(const Scene *scene)
void preview_cache_invalidate(Scene *scene)
void relations_session_uid_generate(Strip *strip)
bool relation_is_effect_of_strip(const Strip *effect, const Strip *input)
bool evict_caches_if_full(Scene *scene)
void media_presence_invalidate_strip(Scene *scene, const Strip *strip)
size_t final_image_cache_get_image_count(const Scene *scene)
size_t source_image_cache_calc_memory_size(const Scene *scene)
void relations_free_imbuf(Scene *scene, ListBase *seqbase, bool for_render)
void cache_cleanup_intra(Scene *scene)
void relations_check_uids_unique_and_report(const Scene *scene)
bool relations_check_scene_recursion(Scene *scene, ReportList *reports)
bool exists_in_seqbase(const Strip *strip, const ListBase *seqbase)
struct MovieReader * anim