89 if (scene && scene->
ed) {
131 if (
STREQ(strip->
name, strip_orig->name)) {
137 if (match !=
nullptr) {
155 return pfjob ? &pfjob->
context :
nullptr;
160 Scene *scene = context->scene;
161 if (context->is_prefetch_render) {
163 if (context !=
nullptr) {
164 scene = context->scene;
172 Scene *scene = context->scene;
173 if (context->is_prefetch_render) {
175 if (context !=
nullptr) {
176 scene = context->scene;
209 if (pfjob ==
nullptr) {
216 *r_start = pfjob->
cfra;
255 int cfra = pfjob->
scene->
r.cfra;
258 if (cfra > pfjob->
cfra) {
259 int delta = cfra - pfjob->
cfra;
267 if (cfra < pfjob->cfra) {
276 for (
Scene *scene =
static_cast<Scene *
>(
G.main->scenes.first); scene;
277 scene =
static_cast<Scene *
>(scene->id.next))
309 context->preview_render_size,
320 context->preview_render_size,
340 pfjob->
scene = scene;
350 if (ms_orig !=
nullptr) {
405 scene, channels, seqbase, timeline_frame, 0);
408 for (
Strip *strip : rendered_strips) {
411 scene, &strip->channels, &strip->seqbase, scene_strips, timeline_frame))
417 strip->scene !=
nullptr)
419 const Scene *target_scene = strip->scene;
423 int target_timeline_frame =
give_frame_index(scene, strip, timeline_frame) +
424 target_scene->
r.sfra;
430 target_timeline_frame);
435 for (
Strip *seq_scene : scene_strips) {
540 if (!context->scene->ed) {
543 pfjob = MEM_new<PrefetchJob>(
"PrefetchJob");
544 context->scene->ed->prefetch_job = pfjob;
551 pfjob->
scene = context->scene;
552 pfjob->
seqbasep = context->scene->ed->seqbasep;
555 pfjob->
bmain = context->bmain;
576 Scene *scene = context->scene;
578 bool has_strips = bool(
ed->seqbasep->first);
580 if (!context->is_prefetch_render && !context->is_proxy_render) {
581 bool playing = context->is_playing;
582 bool scrubbing = context->is_scrubbing;
602 bool playing = screen->
animtimer !=
nullptr;
611 if (running && !playing && !suspended && showing_cache) {
AnimData * BKE_animdata_from_id(const ID *id)
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
void BKE_animsys_evaluate_animdata(struct ID *id, struct AnimData *adt, const struct AnimationEvalContext *anim_eval_context, eAnimData_Recalc recalc, bool flush_to_original)
bScreen * CTX_wm_screen(const bContext *C)
SpaceSeq * CTX_wm_space_seq(const bContext *C)
ViewLayer * BKE_view_layer_default_render(const Scene *scene)
void BKE_main_free(Main *bmain)
#define LISTBASE_FOREACH(type, var, list)
void BLI_mutex_end(ThreadMutex *mutex)
void BLI_threadpool_remove(struct ListBase *threadbase, void *callerdata)
void BLI_condition_wait(ThreadCondition *cond, ThreadMutex *mutex)
void BLI_threadpool_init(struct ListBase *threadbase, void *(*do_thread)(void *), int tot)
void BLI_mutex_init(ThreadMutex *mutex)
pthread_cond_t ThreadCondition
void BLI_condition_end(ThreadCondition *cond)
void BLI_threadpool_end(struct ListBase *threadbase)
void BLI_condition_notify_one(ThreadCondition *cond)
void BLI_condition_init(ThreadCondition *cond)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
void BLI_threadpool_insert(struct ListBase *threadbase, void *callerdata)
pthread_mutex_t ThreadMutex
Depsgraph * DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode)
void DEG_graph_free(Depsgraph *graph)
void DEG_evaluate_on_framechange(Depsgraph *graph, float frame, DepsgraphEvaluateSyncWriteback sync_writeback=DEG_EVALUATE_SYNC_WRITEBACK_NO)
void DEG_graph_build_for_render_pipeline(Depsgraph *graph)
void DEG_debug_name_set(Depsgraph *depsgraph, const char *name)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
@ SEQ_CACHE_PREFETCH_ENABLE
void IMB_freeImBuf(ImBuf *ibuf)
Read Guarded memory(de)allocation.
static void seq_prefetch_update_active_seqbase(PrefetchJob *pfjob)
void render_new_render_data(Main *bmain, Depsgraph *depsgraph, Scene *scene, int rectx, int recty, int preview_render_size, int for_render, RenderData *r_context)
void prefetch_stop(Scene *scene)
static blender::VectorSet< Strip * > query_scene_strips(ListBase *seqbase)
static PrefetchJob * seq_prefetch_job_get(Scene *scene)
ImBuf * render_give_ibuf(const RenderData *context, float timeline_frame, int chanshown)
bool seq_prefetch_job_is_running(Scene *scene)
ListBase * channels_displayed_get(const Editing *ed)
bool prefetch_need_redraw(const bContext *C, Scene *scene)
bool relations_render_loop_check(Strip *strip_main, Strip *strip)
static void seq_prefetch_update_depsgraph(PrefetchJob *pfjob)
static bool seq_prefetch_must_skip_frame(PrefetchJob *pfjob, ListBase *channels, ListBase *seqbase)
static void seq_prefetch_init_depsgraph(PrefetchJob *pfjob)
float give_frame_index(const Scene *scene, const Strip *strip, float timeline_frame)
Editing * editing_get(const Scene *scene)
void seq_prefetch_free(Scene *scene)
static PrefetchJob * seq_prefetch_start_ex(const RenderData *context, float cfra)
void active_seqbase_set(Editing *ed, ListBase *seqbase)
@ SEQ_TASK_PREFETCH_RENDER
static bool seq_prefetch_scene_strip_is_rendered(const Scene *scene, ListBase *channels, ListBase *seqbase, blender::Span< Strip * > scene_strips, int timeline_frame)
static void seq_prefetch_resume(Scene *scene)
static RenderData * get_original_context(const RenderData *context)
void seq_prefetch_start(const RenderData *context, float timeline_frame)
static float seq_prefetch_cfra(PrefetchJob *pfjob)
MetaStack * meta_stack_active_get(const Editing *ed)
static bool seq_prefetch_need_suspend(PrefetchJob *pfjob)
static void seq_prefetch_update_area(PrefetchJob *pfjob)
static AnimationEvalContext seq_prefetch_anim_eval_context(PrefetchJob *pfjob)
static bool seq_prefetch_job_is_waiting(Scene *scene)
Scene * prefetch_get_original_scene_and_strip(const RenderData *context, const Strip *&strip)
bool final_image_cache_evict(Scene *scene)
static void * seq_prefetch_frames(void *job)
static void seq_prefetch_do_suspend(PrefetchJob *pfjob)
bool is_cache_full(const Scene *scene)
static Strip * original_strip_get(const Strip *strip, ListBase *seqbase)
static void seq_prefetch_update_context(const RenderData *context)
ListBase * active_seqbase_get(const Editing *ed)
Vector< Strip * > seq_shown_strips_get(const Scene *scene, ListBase *channels, ListBase *seqbase, const int timeline_frame, const int chanshown)
static void seq_prefetch_update_scene(Scene *scene)
static void seq_prefetch_job_scrubbing_set(Scene *scene, bool is_scrubbing)
Scene * prefetch_get_original_scene(const RenderData *context)
static void seq_prefetch_free_depsgraph(PrefetchJob *pfjob)
void seq_prefetch_get_time_range(Scene *scene, int *r_start, int *r_end)
static bool seq_prefetch_is_cache_full(Scene *scene)
PrefetchJob * prefetch_job
struct SequencerCacheOverlay cache_overlay
struct wmTimer * animtimer
ThreadMutex prefetch_suspend_mutex
int num_frames_prefetched
ThreadCondition prefetch_suspend_cond