static void *do_proxy_thread(void *data_v) { ProxyThread *data = (ProxyThread *) data_v; unsigned char *mem; size_t size; int cfra; while ((mem = proxy_thread_next_frame(data->queue, data->clip, &size, &cfra))) { ImBuf *ibuf; ibuf = IMB_ibImageFromMemory(mem, size, IB_rect | IB_multilayer | IB_alphamode_detect, NULL, "proxy frame"); BKE_movieclip_build_proxy_frame_for_ibuf(data->clip, ibuf, NULL, cfra, data->build_sizes, data->build_count, FALSE); BKE_movieclip_build_proxy_frame_for_ibuf(data->clip, ibuf, data->distortion, cfra, data->build_undistort_sizes, data->build_undistort_count, TRUE); IMB_freeImBuf(ibuf); MEM_freeN(mem); } return NULL; }
static void proxy_task_func(TaskPool *pool, void *task_data, int UNUSED(threadid)) { ProxyThread *data = (ProxyThread *)task_data; ProxyQueue *queue = (ProxyQueue *)BLI_task_pool_userdata(pool); unsigned char *mem; size_t size; int cfra; while ((mem = proxy_thread_next_frame(queue, data->clip, &size, &cfra))) { ImBuf *ibuf; ibuf = IMB_ibImageFromMemory(mem, size, IB_rect | IB_multilayer | IB_alphamode_detect, data->clip->colorspace_settings.name, "proxy frame"); BKE_movieclip_build_proxy_frame_for_ibuf(data->clip, ibuf, NULL, cfra, data->build_sizes, data->build_count, false); BKE_movieclip_build_proxy_frame_for_ibuf(data->clip, ibuf, data->distortion, cfra, data->build_undistort_sizes, data->build_undistort_count, true); IMB_freeImBuf(ibuf); MEM_freeN(mem); } }