Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_clip/clip_ops.c
| Show First 20 Lines • Show All 1,361 Lines • ▼ Show 20 Lines | if (!*queue->stop && queue->cfra <= queue->efra) { | ||||
| *queue->do_update = 1; | *queue->do_update = 1; | ||||
| *queue->progress = (float)(queue->cfra - queue->sfra) / (queue->efra - queue->sfra); | *queue->progress = (float)(queue->cfra - queue->sfra) / (queue->efra - queue->sfra); | ||||
| } | } | ||||
| BLI_spin_unlock(&queue->spin); | BLI_spin_unlock(&queue->spin); | ||||
| return mem; | return mem; | ||||
| } | } | ||||
| static void proxy_task_func(TaskPool *__restrict pool, void *task_data, int UNUSED(threadid)) | static void proxy_task_func(TaskPool *__restrict pool, void *task_data) | ||||
| { | { | ||||
| ProxyThread *data = (ProxyThread *)task_data; | ProxyThread *data = (ProxyThread *)task_data; | ||||
| ProxyQueue *queue = (ProxyQueue *)BLI_task_pool_user_data(pool); | ProxyQueue *queue = (ProxyQueue *)BLI_task_pool_user_data(pool); | ||||
| uchar *mem; | uchar *mem; | ||||
| size_t size; | size_t size; | ||||
| int cfra; | int cfra; | ||||
| while ((mem = proxy_thread_next_frame(queue, data->clip, &size, &cfra))) { | while ((mem = proxy_thread_next_frame(queue, data->clip, &size, &cfra))) { | ||||
| Show All 29 Lines | static void do_sequence_proxy(void *pjv, | ||||
| int build_undistort_count, | int build_undistort_count, | ||||
| short *stop, | short *stop, | ||||
| short *do_update, | short *do_update, | ||||
| float *progress) | float *progress) | ||||
| { | { | ||||
| ProxyJob *pj = pjv; | ProxyJob *pj = pjv; | ||||
| MovieClip *clip = pj->clip; | MovieClip *clip = pj->clip; | ||||
| Scene *scene = pj->scene; | Scene *scene = pj->scene; | ||||
| TaskScheduler *task_scheduler = BLI_task_scheduler_get(); | |||||
| TaskPool *task_pool; | TaskPool *task_pool; | ||||
| int sfra = SFRA, efra = EFRA; | int sfra = SFRA, efra = EFRA; | ||||
| ProxyThread *handles; | ProxyThread *handles; | ||||
| int i, tot_thread = BLI_task_scheduler_num_threads(task_scheduler); | int i, tot_thread = BLI_task_scheduler_num_threads(); | ||||
| int width, height; | int width, height; | ||||
| ProxyQueue queue; | ProxyQueue queue; | ||||
| if (build_undistort_count) { | if (build_undistort_count) { | ||||
| BKE_movieclip_get_size(clip, NULL, &width, &height); | BKE_movieclip_get_size(clip, NULL, &width, &height); | ||||
| } | } | ||||
| BLI_spin_init(&queue.spin); | BLI_spin_init(&queue.spin); | ||||
| queue.cfra = sfra; | queue.cfra = sfra; | ||||
| queue.sfra = sfra; | queue.sfra = sfra; | ||||
| queue.efra = efra; | queue.efra = efra; | ||||
| queue.stop = stop; | queue.stop = stop; | ||||
| queue.do_update = do_update; | queue.do_update = do_update; | ||||
| queue.progress = progress; | queue.progress = progress; | ||||
| task_pool = BLI_task_pool_create(task_scheduler, &queue, TASK_PRIORITY_LOW); | task_pool = BLI_task_pool_create(&queue, TASK_PRIORITY_LOW); | ||||
| handles = MEM_callocN(sizeof(ProxyThread) * tot_thread, "proxy threaded handles"); | handles = MEM_callocN(sizeof(ProxyThread) * tot_thread, "proxy threaded handles"); | ||||
| for (i = 0; i < tot_thread; i++) { | for (i = 0; i < tot_thread; i++) { | ||||
| ProxyThread *handle = &handles[i]; | ProxyThread *handle = &handles[i]; | ||||
| handle->clip = clip; | handle->clip = clip; | ||||
| handle->build_count = build_count; | handle->build_count = build_count; | ||||
| handle->build_sizes = build_sizes; | handle->build_sizes = build_sizes; | ||||
| ▲ Show 20 Lines • Show All 451 Lines • Show Last 20 Lines | |||||