Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/proxy.c
| Show All 28 Lines | |||||
| #include "DNA_anim_types.h" | #include "DNA_anim_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_sequence_types.h" | #include "DNA_sequence_types.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "BLI_fileops.h" | #include "BLI_fileops.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_path_util.h" | #include "BLI_path_util.h" | ||||
| #include "BLI_session_uuid.h" | |||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #ifdef WIN32 | #ifdef WIN32 | ||||
| # include "BLI_winstuff.h" | # include "BLI_winstuff.h" | ||||
| #else | #else | ||||
| # include <unistd.h> | # include <unistd.h> | ||||
| #endif | #endif | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_image.h" | #include "BKE_image.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "IMB_colormanagement.h" | #include "IMB_colormanagement.h" | ||||
| #include "IMB_imbuf.h" | #include "IMB_imbuf.h" | ||||
| #include "IMB_imbuf_types.h" | #include "IMB_imbuf_types.h" | ||||
| #include "IMB_metadata.h" | #include "IMB_metadata.h" | ||||
| #include "SEQ_iterator.h" | |||||
| #include "SEQ_proxy.h" | #include "SEQ_proxy.h" | ||||
| #include "SEQ_relations.h" | #include "SEQ_relations.h" | ||||
| #include "SEQ_render.h" | #include "SEQ_render.h" | ||||
| #include "SEQ_sequencer.h" | #include "SEQ_sequencer.h" | ||||
| #include "multiview.h" | #include "multiview.h" | ||||
| #include "proxy.h" | #include "proxy.h" | ||||
| #include "render.h" | #include "render.h" | ||||
| Show All 9 Lines | typedef struct SeqIndexBuildContext { | ||||
| int quality; | int quality; | ||||
| bool overwrite; | bool overwrite; | ||||
| int view_id; | int view_id; | ||||
| Main *bmain; | Main *bmain; | ||||
| Depsgraph *depsgraph; | Depsgraph *depsgraph; | ||||
| Scene *scene; | Scene *scene; | ||||
| Sequence *seq, *orig_seq; | Sequence *seq, *orig_seq; | ||||
| SessionUUID orig_seq_uuid; | |||||
| } SeqIndexBuildContext; | } SeqIndexBuildContext; | ||||
| int SEQ_rendersize_to_proxysize(int render_size) | int SEQ_rendersize_to_proxysize(int render_size) | ||||
| { | { | ||||
| switch (render_size) { | switch (render_size) { | ||||
| case SEQ_RENDER_SIZE_PROXY_25: | case SEQ_RENDER_SIZE_PROXY_25: | ||||
| return IMB_PROXY_25; | return IMB_PROXY_25; | ||||
| case SEQ_RENDER_SIZE_PROXY_50: | case SEQ_RENDER_SIZE_PROXY_50: | ||||
| ▲ Show 20 Lines • Show All 363 Lines • ▼ Show 20 Lines | for (i = 0; i < num_files; i++) { | ||||
| context->size_flags = nseq->strip->proxy->build_size_flags; | context->size_flags = nseq->strip->proxy->build_size_flags; | ||||
| context->quality = nseq->strip->proxy->quality; | context->quality = nseq->strip->proxy->quality; | ||||
| context->overwrite = (nseq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) == 0; | context->overwrite = (nseq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) == 0; | ||||
| context->bmain = bmain; | context->bmain = bmain; | ||||
| context->depsgraph = depsgraph; | context->depsgraph = depsgraph; | ||||
| context->scene = scene; | context->scene = scene; | ||||
| context->orig_seq = seq; | context->orig_seq = seq; | ||||
| context->orig_seq_uuid = seq->runtime.session_uuid; | |||||
| context->seq = nseq; | context->seq = nseq; | ||||
| context->view_id = i; /* only for images */ | context->view_id = i; /* only for images */ | ||||
| if (nseq->type == SEQ_TYPE_MOVIE) { | if (nseq->type == SEQ_TYPE_MOVIE) { | ||||
| seq_open_anim_file(scene, nseq, true); | seq_open_anim_file(scene, nseq, true); | ||||
| sanim = BLI_findlink(&nseq->anims, i); | sanim = BLI_findlink(&nseq->anims, i); | ||||
| ▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | for (timeline_frame = seq->startdisp + seq->startstill; | ||||
| *do_update = true; | *do_update = true; | ||||
| if (*stop || G.is_break) { | if (*stop || G.is_break) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static bool seq_orig_free_anims(Sequence *seq_iter, void *data) | |||||
| { | |||||
| SessionUUID orig_seq_uuid = ((SeqIndexBuildContext *)data)->orig_seq_uuid; | |||||
| if (BLI_session_uuid_is_equal(&seq_iter->runtime.session_uuid, &orig_seq_uuid)) { | |||||
| for (StripAnim *sanim = seq_iter->anims.first; sanim; sanim = sanim->next) { | |||||
| IMB_close_anim_proxies(sanim->anim); | |||||
| } | |||||
| } | |||||
| return true; | |||||
| } | |||||
| void SEQ_proxy_rebuild_finish(SeqIndexBuildContext *context, bool stop) | void SEQ_proxy_rebuild_finish(SeqIndexBuildContext *context, bool stop) | ||||
| { | { | ||||
| if (context->index_context) { | if (context->index_context) { | ||||
| StripAnim *sanim; | StripAnim *sanim; | ||||
| for (sanim = context->seq->anims.first; sanim; sanim = sanim->next) { | for (sanim = context->seq->anims.first; sanim; sanim = sanim->next) { | ||||
| IMB_close_anim_proxies(sanim->anim); | IMB_close_anim_proxies(sanim->anim); | ||||
| } | } | ||||
| for (sanim = context->orig_seq->anims.first; sanim; sanim = sanim->next) { | /* `context->seq_orig` may have been removed during building. */ | ||||
| IMB_close_anim_proxies(sanim->anim); | SEQ_for_each_callback(&context->scene->ed->seqbase, seq_orig_free_anims, context); | ||||
| } | |||||
| IMB_anim_index_rebuild_finish(context->index_context, stop); | IMB_anim_index_rebuild_finish(context->index_context, stop); | ||||
| } | } | ||||
| seq_free_sequence_recurse(NULL, context->seq, true, true); | seq_free_sequence_recurse(NULL, context->seq, true, true); | ||||
| MEM_freeN(context); | MEM_freeN(context); | ||||
| } | } | ||||
| Show All 35 Lines | |||||