Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/sequencer.c
| Show First 20 Lines • Show All 3,149 Lines • ▼ Show 20 Lines | static ImBuf *seq_render_image_strip(const SeqRenderData *context, | ||||
| } | } | ||||
| s_elem->orig_width = ibuf->x; | s_elem->orig_width = ibuf->x; | ||||
| s_elem->orig_height = ibuf->y; | s_elem->orig_height = ibuf->y; | ||||
| return ibuf; | return ibuf; | ||||
| } | } | ||||
| static ImBuf *seq_render_movie_strip_custom_file_proxy(const SeqRenderData *context, | |||||
| Sequence *seq, | |||||
| int cfra) | |||||
| { | |||||
| char name[PROXY_MAXFILE]; | |||||
| StripProxy *proxy = seq->strip->proxy; | |||||
| if (proxy->anim == NULL) { | |||||
| if (seq_proxy_get_custom_file_fname(seq, name, context->view_id)) { | |||||
| proxy->anim = openanim(name, IB_rect, 0, seq->strip->colorspace_settings.name); | |||||
| } | |||||
| if (proxy->anim == NULL) { | |||||
| return NULL; | |||||
| } | |||||
| } | |||||
| int frameno = (int)BKE_sequencer_give_stripelem_index(seq, cfra) + seq->anim_startofs; | |||||
| return IMB_anim_absolute(proxy->anim, frameno, IMB_TC_NONE, IMB_PROXY_NONE); | |||||
| } | |||||
| /** | /** | ||||
| * Render individual view for multi-view or single (default view) for mono-view. | * Render individual view for multi-view or single (default view) for mono-view. | ||||
| */ | */ | ||||
| static ImBuf *seq_render_movie_strip_view(const SeqRenderData *context, | static ImBuf *seq_render_movie_strip_view(const SeqRenderData *context, | ||||
| Sequence *seq, | Sequence *seq, | ||||
| float nr, | float nr, | ||||
| float cfra, | |||||
| StripAnim *sanim, | StripAnim *sanim, | ||||
| bool *r_is_proxy_image) | bool *r_is_proxy_image) | ||||
| { | { | ||||
| ImBuf *ibuf = NULL; | ImBuf *ibuf = NULL; | ||||
| IMB_Proxy_Size psize = seq_rendersize_to_proxysize(context->preview_render_size); | IMB_Proxy_Size psize = seq_rendersize_to_proxysize(context->preview_render_size); | ||||
| IMB_anim_set_preseek(sanim->anim, seq->anim_preseek); | IMB_anim_set_preseek(sanim->anim, seq->anim_preseek); | ||||
| if (seq_can_use_proxy(seq, psize)) { | if (seq_can_use_proxy(seq, psize)) { | ||||
| /* Try to get a proxy image. | |||||
| * Movie proxies are handled by ImBuf module with exception of `custom file` setting. */ | |||||
| if (context->scene->ed->proxy_storage != SEQ_EDIT_PROXY_DIR_STORAGE && | |||||
| seq->strip->proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE) { | |||||
| ibuf = seq_render_movie_strip_custom_file_proxy(context, seq, cfra); | |||||
| } | |||||
| else { | |||||
| ibuf = IMB_anim_absolute(sanim->anim, | ibuf = IMB_anim_absolute(sanim->anim, | ||||
| nr + seq->anim_startofs, | nr + seq->anim_startofs, | ||||
| seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN, | seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN, | ||||
| psize); | psize); | ||||
| } | |||||
| if (ibuf != NULL) { | if (ibuf != NULL) { | ||||
| *r_is_proxy_image = true; | *r_is_proxy_image = true; | ||||
| } | } | ||||
| } | } | ||||
| /* Fetching for requested proxy size failed, try fetching the original instead. */ | /* Fetching for requested proxy size failed, try fetching the original instead. */ | ||||
| if (ibuf == NULL) { | if (ibuf == NULL) { | ||||
| ibuf = IMB_anim_absolute(sanim->anim, | ibuf = IMB_anim_absolute(sanim->anim, | ||||
| Show All 32 Lines | if (is_multiview_render) { | ||||
| ImBuf **ibuf_arr; | ImBuf **ibuf_arr; | ||||
| int totviews = BKE_scene_multiview_num_views_get(&context->scene->r); | int totviews = BKE_scene_multiview_num_views_get(&context->scene->r); | ||||
| ibuf_arr = MEM_callocN(sizeof(ImBuf *) * totviews, "Sequence Image Views Imbufs"); | ibuf_arr = MEM_callocN(sizeof(ImBuf *) * totviews, "Sequence Image Views Imbufs"); | ||||
| int ibuf_view_id; | int ibuf_view_id; | ||||
| for (ibuf_view_id = 0, sanim = seq->anims.first; sanim; sanim = sanim->next, ibuf_view_id++) { | for (ibuf_view_id = 0, sanim = seq->anims.first; sanim; sanim = sanim->next, ibuf_view_id++) { | ||||
| if (sanim->anim) { | if (sanim->anim) { | ||||
| ibuf_arr[ibuf_view_id] = seq_render_movie_strip_view( | ibuf_arr[ibuf_view_id] = seq_render_movie_strip_view( | ||||
| context, seq, nr, sanim, r_is_proxy_image); | context, seq, nr, cfra, sanim, r_is_proxy_image); | ||||
| } | } | ||||
| } | } | ||||
| if (seq->views_format == R_IMF_VIEWS_STEREO_3D) { | if (seq->views_format == R_IMF_VIEWS_STEREO_3D) { | ||||
| if (ibuf_arr[0] == NULL) { | if (ibuf_arr[0] == NULL) { | ||||
| /* Probably proxy hasn't been created yet. */ | /* Probably proxy hasn't been created yet. */ | ||||
| MEM_freeN(ibuf_arr); | MEM_freeN(ibuf_arr); | ||||
| return NULL; | return NULL; | ||||
| Show All 20 Lines | for (int view_id = 0; view_id < totviews; view_id++) { | ||||
| if (ibuf_arr[view_id] != ibuf) { | if (ibuf_arr[view_id] != ibuf) { | ||||
| IMB_freeImBuf(ibuf_arr[view_id]); | IMB_freeImBuf(ibuf_arr[view_id]); | ||||
| } | } | ||||
| } | } | ||||
| MEM_freeN(ibuf_arr); | MEM_freeN(ibuf_arr); | ||||
| } | } | ||||
| else { | else { | ||||
| ibuf = seq_render_movie_strip_view(context, seq, nr, sanim, r_is_proxy_image); | ibuf = seq_render_movie_strip_view(context, seq, nr, cfra, sanim, r_is_proxy_image); | ||||
| } | } | ||||
| if (ibuf == NULL) { | if (ibuf == NULL) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| seq->strip->stripdata->orig_width = ibuf->x; | seq->strip->stripdata->orig_width = ibuf->x; | ||||
| seq->strip->stripdata->orig_height = ibuf->y; | seq->strip->stripdata->orig_height = ibuf->y; | ||||
| ▲ Show 20 Lines • Show All 2,900 Lines • Show Last 20 Lines | |||||