Blender  V3.3
prefetch.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #include <stddef.h>
9 #include <stdlib.h>
10 #include <string.h>
11 
12 #include "MEM_guardedalloc.h"
13 
14 #include "DNA_anim_types.h"
15 #include "DNA_scene_types.h"
16 #include "DNA_screen_types.h"
17 #include "DNA_sequence_types.h"
19 
20 #include "BLI_listbase.h"
21 #include "BLI_threads.h"
22 
23 #include "IMB_imbuf.h"
24 #include "IMB_imbuf_types.h"
25 
26 #include "BKE_anim_data.h"
27 #include "BKE_animsys.h"
28 #include "BKE_context.h"
29 #include "BKE_global.h"
30 #include "BKE_layer.h"
31 #include "BKE_lib_id.h"
32 #include "BKE_main.h"
33 #include "BKE_scene.h"
34 
35 #include "DEG_depsgraph.h"
36 #include "DEG_depsgraph_build.h"
37 #include "DEG_depsgraph_debug.h"
38 #include "DEG_depsgraph_query.h"
39 
40 #include "SEQ_channels.h"
41 #include "SEQ_iterator.h"
42 #include "SEQ_prefetch.h"
43 #include "SEQ_relations.h"
44 #include "SEQ_render.h"
45 #include "SEQ_sequencer.h"
46 
47 #include "image_cache.h"
48 #include "prefetch.h"
49 #include "render.h"
50 
51 typedef struct PrefetchJob {
52  struct PrefetchJob *next, *prev;
53 
54  struct Main *bmain;
55  struct Main *bmain_eval;
56  struct Scene *scene;
57  struct Scene *scene_eval;
59 
62 
64 
65  /* context */
66  struct SeqRenderData context;
68  struct ListBase *seqbasep;
70 
71  /* prefetch area */
72  float cfra;
74 
75  /* control */
76  bool running;
77  bool waiting;
78  bool stop;
80 
81 static bool seq_prefetch_is_playing(const Main *bmain)
82 {
83  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
84  if (screen->animtimer) {
85  return true;
86  }
87  }
88  return false;
89 }
90 
91 static bool seq_prefetch_is_scrubbing(const Main *bmain)
92 {
93 
94  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
95  if (screen->scrubbing) {
96  return true;
97  }
98  }
99  return false;
100 }
101 
103 {
104  if (scene && scene->ed) {
105  return scene->ed->prefetch_job;
106  }
107  return NULL;
108 }
109 
111 {
113 
114  if (!pfjob) {
115  return false;
116  }
117 
118  return pfjob->running;
119 }
120 
122 {
124 
125  if (!pfjob) {
126  return false;
127  }
128 
129  return pfjob->waiting;
130 }
131 
133 {
134  LISTBASE_FOREACH (Sequence *, seq_orig, seqbase) {
135  if (STREQ(seq->name, seq_orig->name)) {
136  return seq_orig;
137  }
138 
139  if (seq_orig->type == SEQ_TYPE_META) {
141  if (match != NULL) {
142  return match;
143  }
144  }
145  }
146 
147  return NULL;
148 }
149 
151 {
152  Editing *ed = scene->ed;
154 }
155 
157 {
158  PrefetchJob *pfjob = seq_prefetch_job_get(context->scene);
159 
160  return &pfjob->context;
161 }
162 
164 {
166 
167  if (!seq_cache_is_full()) {
168  return false;
169  }
170 
171  return seq_cache_recycle_item(pfjob->scene) == false;
172 }
173 
174 static float seq_prefetch_cfra(PrefetchJob *pfjob)
175 {
176  return pfjob->cfra + pfjob->num_frames_prefetched;
177 }
179 {
181 }
182 
183 void seq_prefetch_get_time_range(Scene *scene, int *start, int *end)
184 {
186 
187  *start = pfjob->cfra;
188  *end = seq_prefetch_cfra(pfjob);
189 }
190 
192 {
193  if (pfjob->depsgraph != NULL) {
194  DEG_graph_free(pfjob->depsgraph);
195  }
196  pfjob->depsgraph = NULL;
197  pfjob->scene_eval = NULL;
198 }
199 
201 {
203 }
204 
206 {
207  Main *bmain = pfjob->bmain_eval;
208  Scene *scene = pfjob->scene;
210 
211  pfjob->depsgraph = DEG_graph_new(bmain, scene, view_layer, DAG_EVAL_RENDER);
212  DEG_debug_name_set(pfjob->depsgraph, "SEQUENCER PREFETCH");
213 
214  /* Make sure there is a correct evaluated scene pointer. */
216 
217  /* Update immediately so we have proper evaluated scene. */
219 
221  pfjob->scene_eval->ed->cache_flag = 0;
222 }
223 
225 {
226  int cfra = pfjob->scene->r.cfra;
227 
228  /* rebase */
229  if (cfra > pfjob->cfra) {
230  int delta = cfra - pfjob->cfra;
231  pfjob->cfra = cfra;
232  pfjob->num_frames_prefetched -= delta;
233 
234  if (pfjob->num_frames_prefetched <= 1) {
235  pfjob->num_frames_prefetched = 1;
236  }
237  }
238 
239  /* reset */
240  if (cfra < pfjob->cfra) {
241  pfjob->cfra = cfra;
242  pfjob->num_frames_prefetched = 1;
243  }
244 }
245 
247 {
248  /* TODO(Richard): Use wm_jobs for prefetch, or pass main. */
249  for (Scene *scene = G.main->scenes.first; scene; scene = scene->id.next) {
251  }
252 }
253 
255 {
256  PrefetchJob *pfjob;
257  pfjob = seq_prefetch_job_get(scene);
258 
259  if (!pfjob) {
260  return;
261  }
262 
263  pfjob->stop = true;
264 
265  while (pfjob->running) {
267  }
268 }
269 
271 {
272  PrefetchJob *pfjob;
273  pfjob = seq_prefetch_job_get(context->scene);
274 
276  pfjob->depsgraph,
277  pfjob->scene_eval,
278  context->rectx,
279  context->recty,
280  context->preview_render_size,
281  false,
282  &pfjob->context_cpy);
283  pfjob->context_cpy.is_prefetch_render = true;
285 
287  pfjob->depsgraph,
288  pfjob->scene,
289  context->rectx,
290  context->recty,
291  context->preview_render_size,
292  false,
293  &pfjob->context);
294  pfjob->context.is_prefetch_render = false;
295 
296  /* Same ID as prefetch context, because context will be swapped, but we still
297  * want to assign this ID to cache entries created in this thread.
298  * This is to allow "temp cache" work correctly for both threads.
299  */
301 }
302 
304 {
306 
307  if (!pfjob) {
308  return;
309  }
310 
311  pfjob->scene = scene;
314 }
315 
317 {
319  Editing *ed_eval = SEQ_editing_get(pfjob->scene_eval);
320 
321  if (ms_orig != NULL) {
322  Sequence *meta_eval = seq_prefetch_get_original_sequence(ms_orig->parseq, pfjob->scene_eval);
323  SEQ_seqbase_active_set(ed_eval, &meta_eval->seqbase);
324  }
325  else {
326  SEQ_seqbase_active_set(ed_eval, &ed_eval->seqbase);
327  }
328 }
329 
331 {
333 
334  if (pfjob && pfjob->waiting) {
336  }
337 }
338 
340 {
342  if (!pfjob) {
343  return;
344  }
345 
347 
348  BLI_threadpool_remove(&pfjob->threads, pfjob);
349  BLI_threadpool_end(&pfjob->threads);
353  BKE_main_free(pfjob->bmain_eval);
354  MEM_freeN(pfjob);
356 }
357 
359  Sequence *seq,
360  bool can_have_final_image)
361 {
362  SeqRenderData *ctx = &pfjob->context_cpy;
363  float cfra = seq_prefetch_cfra(pfjob);
364 
365  ImBuf *ibuf = seq_cache_get(ctx, seq, cfra, SEQ_CACHE_STORE_PREPROCESSED);
366  if (ibuf != NULL) {
367  IMB_freeImBuf(ibuf);
368  return true;
369  }
370 
371  ibuf = seq_cache_get(ctx, seq, cfra, SEQ_CACHE_STORE_RAW);
372  if (ibuf != NULL) {
373  IMB_freeImBuf(ibuf);
374  return true;
375  }
376 
377  if (!can_have_final_image) {
378  return false;
379  }
380 
381  ibuf = seq_cache_get(ctx, seq, cfra, SEQ_CACHE_STORE_FINAL_OUT);
382  if (ibuf != NULL) {
383  IMB_freeImBuf(ibuf);
384  return true;
385  }
386 
387  return false;
388 }
389 
392  ListBase *seqbase,
393  SeqCollection *scene_strips,
394  bool is_recursive_check)
395 {
396  float cfra = seq_prefetch_cfra(pfjob);
397  Sequence *seq_arr[MAXSEQ + 1];
398  int count = seq_get_shown_sequences(pfjob->scene_eval, channels, seqbase, cfra, 0, seq_arr);
399 
400  /* Iterate over rendered strips. */
401  for (int i = 0; i < count; i++) {
402  Sequence *seq = seq_arr[i];
403  if (seq->type == SEQ_TYPE_META &&
404  seq_prefetch_scene_strip_is_rendered(pfjob, channels, &seq->seqbase, scene_strips, true)) {
405  return true;
406  }
407 
408  /* Disable prefetching 3D scene strips, but check for disk cache. */
409  if (seq->type == SEQ_TYPE_SCENE && (seq->flag & SEQ_SCENE_STRIPS) == 0 &&
410  !seq_prefetch_seq_has_disk_cache(pfjob, seq, !is_recursive_check)) {
411  return true;
412  }
413 
414  /* Check if strip is effect of scene strip or uses it as modifier. This is recursive check. */
415  Sequence *seq_scene;
416  SEQ_ITERATOR_FOREACH (seq_scene, scene_strips) {
417  if (SEQ_relations_render_loop_check(seq, seq_scene)) {
418  return true;
419  }
420  }
421  }
422  return false;
423 }
424 
426 {
427  SeqCollection *collection = SEQ_query_all_strips_recursive(seqbase);
428  LISTBASE_FOREACH (Sequence *, seq, seqbase) {
429  if (seq->type != SEQ_TYPE_SCENE || (seq->flag & SEQ_SCENE_STRIPS) != 0) {
430  SEQ_collection_remove_strip(seq, collection);
431  }
432  }
433  return collection;
434 }
435 
436 /* Prefetch must avoid rendering scene strips, because rendering in background locks UI and can
437  * make it unresponsive for long time periods. */
439 {
440  SeqCollection *scene_strips = query_scene_strips(seqbase);
441  if (seq_prefetch_scene_strip_is_rendered(pfjob, channels, seqbase, scene_strips, false)) {
442  SEQ_collection_free(scene_strips);
443  return true;
444  }
445  SEQ_collection_free(scene_strips);
446  return false;
447 }
448 
450 {
452  (seq_prefetch_cfra(pfjob) >= pfjob->scene->r.efra);
453 }
454 
456 {
458  while (seq_prefetch_need_suspend(pfjob) &&
459  (pfjob->scene->ed->cache_flag & SEQ_CACHE_PREFETCH_ENABLE) && !pfjob->stop) {
460  pfjob->waiting = true;
463  }
464  pfjob->waiting = false;
466 }
467 
468 static void *seq_prefetch_frames(void *job)
469 {
470  PrefetchJob *pfjob = (PrefetchJob *)job;
471 
472  while (seq_prefetch_cfra(pfjob) <= pfjob->scene->r.efra) {
473  pfjob->scene_eval->ed->prefetch_job = NULL;
474 
477  AnimationEvalContext anim_eval_context = seq_prefetch_anim_eval_context(pfjob);
479  &pfjob->context_cpy.scene->id, adt, &anim_eval_context, ADT_RECALC_ALL, false);
480 
481  /* This is quite hacky solution:
482  * We need cross-reference original scene with copy for cache.
483  * However depsgraph must not have this data, because it will try to kill this job.
484  * Scene copy don't reference original scene. Perhaps, this could be done by depsgraph.
485  * Set to NULL before return!
486  */
487  pfjob->scene_eval->ed->prefetch_job = pfjob;
488 
491  if (seq_prefetch_must_skip_frame(pfjob, channels, seqbase)) {
492  pfjob->num_frames_prefetched++;
493  continue;
494  }
495 
496  ImBuf *ibuf = SEQ_render_give_ibuf(&pfjob->context_cpy, seq_prefetch_cfra(pfjob), 0);
498  IMB_freeImBuf(ibuf);
499 
500  /* Suspend thread if there is nothing to be prefetched. */
502 
503  /* Avoid "collision" with main thread, but make sure to fetch at least few frames */
504  if (pfjob->num_frames_prefetched > 5 &&
505  (seq_prefetch_cfra(pfjob) - pfjob->scene->r.cfra) < 2) {
506  break;
507  }
508 
509  if (!(pfjob->scene->ed->cache_flag & SEQ_CACHE_PREFETCH_ENABLE) || pfjob->stop) {
510  break;
511  }
512 
514  pfjob->num_frames_prefetched++;
515  }
516 
518  pfjob->running = false;
519  pfjob->scene_eval->ed->prefetch_job = NULL;
520 
521  return NULL;
522 }
523 
525 {
526  PrefetchJob *pfjob = seq_prefetch_job_get(context->scene);
527 
528  if (!pfjob) {
529  if (context->scene->ed) {
530  pfjob = (PrefetchJob *)MEM_callocN(sizeof(PrefetchJob), "PrefetchJob");
531  context->scene->ed->prefetch_job = pfjob;
532 
536 
537  pfjob->bmain_eval = BKE_main_new();
538  pfjob->scene = context->scene;
540  }
541  }
542  pfjob->bmain = context->bmain;
543 
544  pfjob->cfra = cfra;
545  pfjob->num_frames_prefetched = 1;
546 
547  pfjob->waiting = false;
548  pfjob->stop = false;
549  pfjob->running = true;
550 
554 
555  BLI_threadpool_remove(&pfjob->threads, pfjob);
556  BLI_threadpool_insert(&pfjob->threads, pfjob);
557 
558  return pfjob;
559 }
560 
561 void seq_prefetch_start(const SeqRenderData *context, float timeline_frame)
562 {
563  Scene *scene = context->scene;
564  Editing *ed = scene->ed;
565  bool has_strips = (bool)ed->seqbasep->first;
566 
567  if (!context->is_prefetch_render && !context->is_proxy_render) {
568  bool playing = seq_prefetch_is_playing(context->bmain);
569  bool scrubbing = seq_prefetch_is_scrubbing(context->bmain);
570  bool running = seq_prefetch_job_is_running(scene);
572  /* conditions to start:
573  * prefetch enabled, prefetch not running, not scrubbing, not playing,
574  * cache storage enabled, has strips to render, not rendering, not doing modal transform -
575  * important, see D7820.
576  */
577  if ((ed->cache_flag & SEQ_CACHE_PREFETCH_ENABLE) && !running && !scrubbing && !playing &&
578  ed->cache_flag & SEQ_CACHE_ALL_TYPES && has_strips && !G.is_rendering && !G.moving) {
579 
580  seq_prefetch_start_ex(context, timeline_frame);
581  }
582  }
583 }
584 
586 {
587  bool playing = seq_prefetch_is_playing(bmain);
588  bool scrubbing = seq_prefetch_is_scrubbing(bmain);
589  bool running = seq_prefetch_job_is_running(scene);
590  bool suspended = seq_prefetch_job_is_waiting(scene);
591 
592  /* force redraw, when prefetching and using cache view. */
593  if (running && !playing && !suspended && scene->ed->cache_flag & SEQ_CACHE_VIEW_ENABLE) {
594  return true;
595  }
596  /* Sometimes scrubbing flag is set when not scrubbing. In that case I want to catch "event" of
597  * stopping scrubbing */
598  if (scrubbing) {
599  return true;
600  }
601  return false;
602 }
struct AnimData * BKE_animdata_from_id(const struct ID *id)
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time)
Definition: anim_sys.c:761
@ ADT_RECALC_ALL
Definition: BKE_animsys.h:291
void BKE_animsys_evaluate_animdata(struct ID *id, struct AnimData *adt, const struct AnimationEvalContext *anim_eval_context, eAnimData_Recalc recalc, bool flush_to_original)
struct ViewLayer * BKE_view_layer_default_render(const struct Scene *scene)
struct Main * BKE_main_new(void)
Definition: main.c:32
void BKE_main_free(struct Main *mainvar)
Definition: main.c:40
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void BLI_mutex_end(ThreadMutex *mutex)
Definition: threads.cc:388
void BLI_threadpool_remove(struct ListBase *threadbase, void *callerdata)
Definition: threads.cc:225
void BLI_condition_wait(ThreadCondition *cond, ThreadMutex *mutex)
Definition: threads.cc:579
void BLI_threadpool_init(struct ListBase *threadbase, void *(*do_thread)(void *), int tot)
Definition: threads.cc:134
void BLI_mutex_init(ThreadMutex *mutex)
Definition: threads.cc:368
pthread_cond_t ThreadCondition
Definition: BLI_threads.h:150
void BLI_condition_end(ThreadCondition *cond)
Definition: threads.cc:599
void BLI_threadpool_end(struct ListBase *threadbase)
Definition: threads.cc:262
void BLI_condition_notify_one(ThreadCondition *cond)
Definition: threads.cc:589
void BLI_condition_init(ThreadCondition *cond)
Definition: threads.cc:574
void BLI_mutex_lock(ThreadMutex *mutex)
Definition: threads.cc:373
void BLI_mutex_unlock(ThreadMutex *mutex)
Definition: threads.cc:378
void BLI_threadpool_insert(struct ListBase *threadbase, void *callerdata)
Definition: threads.cc:212
pthread_mutex_t ThreadMutex
Definition: BLI_threads.h:82
#define STREQ(a, b)
Depsgraph * DEG_graph_new(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, eEvaluationMode mode)
Definition: depsgraph.cc:267
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
@ DAG_EVAL_RENDER
Definition: DEG_depsgraph.h:46
void DEG_graph_free(Depsgraph *graph)
Definition: depsgraph.cc:295
void DEG_evaluate_on_framechange(Depsgraph *graph, float frame)
void DEG_graph_build_for_render_pipeline(struct Depsgraph *graph)
void DEG_debug_name_set(struct Depsgraph *depsgraph, const char *name)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ SEQ_TYPE_META
@ SEQ_TYPE_SCENE
@ SEQ_CACHE_ALL_TYPES
@ SEQ_CACHE_STORE_PREPROCESSED
@ SEQ_CACHE_STORE_RAW
@ SEQ_CACHE_STORE_FINAL_OUT
@ SEQ_CACHE_VIEW_ENABLE
@ SEQ_CACHE_PREFETCH_ENABLE
@ SEQ_SCENE_STRIPS
#define MAXSEQ
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
#define SEQ_ITERATOR_FOREACH(var, collection)
Definition: SEQ_iterator.h:35
@ SEQ_TASK_PREFETCH_RENDER
Definition: SEQ_render.h:24
ListBase * SEQ_channels_displayed_get(Editing *ed)
Definition: channels.c:23
Scene scene
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
bool seq_cache_is_full(void)
Definition: image_cache.c:919
void seq_cache_free_temp_cache(Scene *scene, short id, int timeline_frame)
Definition: image_cache.c:547
struct ImBuf * seq_cache_get(const SeqRenderData *context, Sequence *seq, float timeline_frame, int type)
Definition: image_cache.c:726
bool seq_cache_recycle_item(Scene *scene)
Definition: image_cache.c:446
int count
SeqCollection * SEQ_query_all_strips_recursive(ListBase *seqbase)
Definition: iterator.c:194
bool SEQ_collection_remove_strip(Sequence *seq, SeqCollection *collection)
Definition: iterator.c:128
void SEQ_collection_free(SeqCollection *collection)
Definition: iterator.c:81
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
#define G(x, y, z)
void seq_prefetch_get_time_range(Scene *scene, int *start, int *end)
Definition: prefetch.c:183
static bool seq_prefetch_scene_strip_is_rendered(PrefetchJob *pfjob, ListBase *channels, ListBase *seqbase, SeqCollection *scene_strips, bool is_recursive_check)
Definition: prefetch.c:390
void seq_prefetch_free(Scene *scene)
Definition: prefetch.c:339
bool seq_prefetch_job_is_running(Scene *scene)
Definition: prefetch.c:110
static bool seq_prefetch_must_skip_frame(PrefetchJob *pfjob, ListBase *channels, ListBase *seqbase)
Definition: prefetch.c:438
static void * seq_prefetch_frames(void *job)
Definition: prefetch.c:468
static void seq_prefetch_update_area(PrefetchJob *pfjob)
Definition: prefetch.c:224
bool SEQ_prefetch_need_redraw(Main *bmain, Scene *scene)
Definition: prefetch.c:585
void SEQ_prefetch_stop(Scene *scene)
Definition: prefetch.c:254
static PrefetchJob * seq_prefetch_job_get(Scene *scene)
Definition: prefetch.c:102
static bool seq_prefetch_job_is_waiting(Scene *scene)
Definition: prefetch.c:121
static void seq_prefetch_update_depsgraph(PrefetchJob *pfjob)
Definition: prefetch.c:200
static float seq_prefetch_cfra(PrefetchJob *pfjob)
Definition: prefetch.c:174
void SEQ_prefetch_stop_all(void)
Definition: prefetch.c:246
static void seq_prefetch_do_suspend(PrefetchJob *pfjob)
Definition: prefetch.c:455
void seq_prefetch_start(const SeqRenderData *context, float timeline_frame)
Definition: prefetch.c:561
static void seq_prefetch_update_context(const SeqRenderData *context)
Definition: prefetch.c:270
static SeqCollection * query_scene_strips(ListBase *seqbase)
Definition: prefetch.c:425
static bool seq_prefetch_seq_has_disk_cache(PrefetchJob *pfjob, Sequence *seq, bool can_have_final_image)
Definition: prefetch.c:358
static PrefetchJob * seq_prefetch_start_ex(const SeqRenderData *context, float cfra)
Definition: prefetch.c:524
Sequence * seq_prefetch_get_original_sequence(Sequence *seq, Scene *scene)
Definition: prefetch.c:150
static void seq_prefetch_update_active_seqbase(PrefetchJob *pfjob)
Definition: prefetch.c:316
static AnimationEvalContext seq_prefetch_anim_eval_context(PrefetchJob *pfjob)
Definition: prefetch.c:178
static void seq_prefetch_update_scene(Scene *scene)
Definition: prefetch.c:303
static bool seq_prefetch_is_playing(const Main *bmain)
Definition: prefetch.c:81
static void seq_prefetch_init_depsgraph(PrefetchJob *pfjob)
Definition: prefetch.c:205
static void seq_prefetch_resume(Scene *scene)
Definition: prefetch.c:330
static bool seq_prefetch_is_cache_full(Scene *scene)
Definition: prefetch.c:163
struct PrefetchJob PrefetchJob
static bool seq_prefetch_need_suspend(PrefetchJob *pfjob)
Definition: prefetch.c:449
static void seq_prefetch_free_depsgraph(PrefetchJob *pfjob)
Definition: prefetch.c:191
static Sequence * sequencer_prefetch_get_original_sequence(Sequence *seq, ListBase *seqbase)
Definition: prefetch.c:132
static bool seq_prefetch_is_scrubbing(const Main *bmain)
Definition: prefetch.c:91
SeqRenderData * seq_prefetch_get_original_context(const SeqRenderData *context)
Definition: prefetch.c:156
ImBuf * SEQ_render_give_ibuf(const SeqRenderData *context, float timeline_frame, int chanshown)
Definition: render.c:1925
void SEQ_render_new_render_data(Main *bmain, struct Depsgraph *depsgraph, Scene *scene, int rectx, int recty, int preview_render_size, int for_render, SeqRenderData *r_context)
Definition: render.c:205
int seq_get_shown_sequences(const Scene *scene, ListBase *channels, ListBase *seqbase, const int timeline_frame, const int chanshown, Sequence **r_seq_arr)
Definition: render.c:261
ListBase * SEQ_active_seqbase_get(const Editing *ed)
Definition: sequencer.c:388
MetaStack * SEQ_meta_stack_active_get(const Editing *ed)
Definition: sequencer.c:420
void SEQ_seqbase_active_set(Editing *ed, ListBase *seqbase)
Definition: sequencer.c:397
Editing * SEQ_editing_get(const Scene *scene)
Definition: sequencer.c:241
bool SEQ_relations_render_loop_check(Sequence *seq_main, Sequence *seq)
ListBase seqbase
struct PrefetchJob * prefetch_job
ListBase * seqbasep
void * next
Definition: DNA_ID.h:369
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
ListBase screens
Definition: BKE_main.h:183
Sequence * parseq
bool stop
Definition: prefetch.c:78
ListBase threads
Definition: prefetch.c:63
bool waiting
Definition: prefetch.c:77
struct PrefetchJob * next
Definition: prefetch.c:52
ThreadCondition prefetch_suspend_cond
Definition: prefetch.c:61
int num_frames_prefetched
Definition: prefetch.c:73
struct Main * bmain_eval
Definition: prefetch.c:55
struct ListBase * seqbasep_cpy
Definition: prefetch.c:69
float cfra
Definition: prefetch.c:72
struct PrefetchJob * prev
Definition: prefetch.c:52
struct Scene * scene_eval
Definition: prefetch.c:57
struct Depsgraph * depsgraph
Definition: prefetch.c:58
struct ListBase * seqbasep
Definition: prefetch.c:68
struct Scene * scene
Definition: prefetch.c:56
struct SeqRenderData context_cpy
Definition: prefetch.c:67
bool running
Definition: prefetch.c:76
struct SeqRenderData context
Definition: prefetch.c:66
ThreadMutex prefetch_suspend_mutex
Definition: prefetch.c:60
struct Main * bmain
Definition: prefetch.c:54
struct Editing * ed
struct RenderData r
struct Scene * scene
Definition: SEQ_render.h:30
bool is_prefetch_render
Definition: SEQ_render.h:40
eSeqTaskId task_id
Definition: SEQ_render.h:43
ListBase seqbase