Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/prefetch.c
| Show First 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | |||||
| static void seq_prefetch_update_scene(Scene *scene) | static void seq_prefetch_update_scene(Scene *scene) | ||||
| { | { | ||||
| PrefetchJob *pfjob = seq_prefetch_job_get(scene); | PrefetchJob *pfjob = seq_prefetch_job_get(scene); | ||||
| if (!pfjob) { | if (!pfjob) { | ||||
| return; | return; | ||||
| } | } | ||||
| pfjob->scene = scene; | |||||
| seq_prefetch_free_depsgraph(pfjob); | seq_prefetch_free_depsgraph(pfjob); | ||||
| seq_prefetch_init_depsgraph(pfjob); | seq_prefetch_init_depsgraph(pfjob); | ||||
| } | } | ||||
| static void seq_prefetch_resume(Scene *scene) | static void seq_prefetch_resume(Scene *scene) | ||||
| { | { | ||||
| PrefetchJob *pfjob = seq_prefetch_job_get(scene); | PrefetchJob *pfjob = seq_prefetch_job_get(scene); | ||||
| ▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | if (!pfjob) { | ||||
| if (context->scene->ed) { | if (context->scene->ed) { | ||||
| pfjob = (PrefetchJob *)MEM_callocN(sizeof(PrefetchJob), "PrefetchJob"); | pfjob = (PrefetchJob *)MEM_callocN(sizeof(PrefetchJob), "PrefetchJob"); | ||||
| context->scene->ed->prefetch_job = pfjob; | context->scene->ed->prefetch_job = pfjob; | ||||
| BLI_threadpool_init(&pfjob->threads, seq_prefetch_frames, 1); | BLI_threadpool_init(&pfjob->threads, seq_prefetch_frames, 1); | ||||
| BLI_mutex_init(&pfjob->prefetch_suspend_mutex); | BLI_mutex_init(&pfjob->prefetch_suspend_mutex); | ||||
| BLI_condition_init(&pfjob->prefetch_suspend_cond); | BLI_condition_init(&pfjob->prefetch_suspend_cond); | ||||
| pfjob->bmain = context->bmain; | |||||
| pfjob->bmain_eval = BKE_main_new(); | pfjob->bmain_eval = BKE_main_new(); | ||||
| pfjob->scene = context->scene; | pfjob->scene = context->scene; | ||||
| seq_prefetch_init_depsgraph(pfjob); | seq_prefetch_init_depsgraph(pfjob); | ||||
| } | } | ||||
| } | } | ||||
| seq_prefetch_update_scene(context->scene); | seq_prefetch_update_scene(context->scene); | ||||
| seq_prefetch_update_context(context); | seq_prefetch_update_context(context); | ||||
| pfjob->bmain = context->bmain; | |||||
| pfjob->cfra = cfra; | pfjob->cfra = cfra; | ||||
| pfjob->num_frames_prefetched = 1; | pfjob->num_frames_prefetched = 1; | ||||
| pfjob->waiting = false; | pfjob->waiting = false; | ||||
| pfjob->stop = false; | pfjob->stop = false; | ||||
| pfjob->running = true; | pfjob->running = true; | ||||
| ▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines | |||||