Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Y Jeppu <quantimoney>2021-09-21 11:38:15 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-09-21 11:55:04 +0300
commit997b5fe45dab8bd0e2976c8b673e56266134fc80 (patch)
treeb8813b36decf96908507f6633cf909717bcfa534 /source/blender/editors/space_sequencer/space_sequencer.c
parentfa2c1698b077f510175e79adf3dbf3e1602b1030 (diff)
VSE strip thumbnails
Draw thumbnails as strip overlay. This works for movie and image strips. To draw thumbnails, this overlay has to be enabled and strips must be tall enough. The thumbnails are loaded from source file using separate thread and stored in cache. Drawing code uses only images stored in cache, and if any is missing, background rendering job is started. If job can not render thumbnail, to prevent endless loop of creating job for missing image it sets `SEQ_FLAG_SKIP_THUMBNAILS` bit of `Sequence` flag. To prevent visual glitches during timeline panning and zooming, `View2D` flag `V2D_IS_NAVIGATING` is implemented. If bit is set, drawing code will look for set of evenly distributed thumbnails that should be guaranteed to exist and also set of previously displayed thumbnails. Due to volatile nature of cache these thumbnails can be missing anyway, in which case no new thumbnails will be drawn for particular strip. Cache capacity is limited to 5000 thumbnails and performs cleanup of non visible images when limit is reached. ref T89143 Reviewed By: ISS Differential Revision: https://developer.blender.org/D12266
Diffstat (limited to 'source/blender/editors/space_sequencer/space_sequencer.c')
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index cb5fe6f0ef3..0f23c61a2ca 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -32,6 +32,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
+#include "BLI_ghash.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
@@ -105,6 +106,9 @@ static SpaceLink *sequencer_create(const ScrArea *UNUSED(area), const Scene *sce
SEQ_TIMELINE_SHOW_STRIP_DURATION | SEQ_TIMELINE_SHOW_GRID |
SEQ_TIMELINE_SHOW_FCURVES;
+ BLI_rctf_init(&sseq->runtime.last_thumbnail_area, 0.0f, 0.0f, 0.0f, 0.0f);
+ sseq->runtime.last_displayed_thumbnails = NULL;
+
/* Tool header. */
region = MEM_callocN(sizeof(ARegion), "tool header for sequencer");
@@ -174,7 +178,7 @@ static SpaceLink *sequencer_create(const ScrArea *UNUSED(area), const Scene *sce
region->v2d.cur = region->v2d.tot;
region->v2d.min[0] = 10.0f;
- region->v2d.min[1] = 0.5f;
+ region->v2d.min[1] = 4.0f;
region->v2d.max[0] = MAXFRAMEF;
region->v2d.max[1] = MAXSEQ;
@@ -188,6 +192,8 @@ static SpaceLink *sequencer_create(const ScrArea *UNUSED(area), const Scene *sce
region->v2d.keeptot = 0;
region->v2d.align = V2D_ALIGN_NO_NEG_Y;
+ sseq->runtime.last_displayed_thumbnails = NULL;
+
return (SpaceLink *)sseq;
}
@@ -218,6 +224,12 @@ static void sequencer_free(SpaceLink *sl)
if (scopes->histogram_ibuf) {
IMB_freeImBuf(scopes->histogram_ibuf);
}
+
+ if (sseq->runtime.last_displayed_thumbnails) {
+ BLI_ghash_free(
+ sseq->runtime.last_displayed_thumbnails, NULL, last_displayed_thumbnails_list_free);
+ sseq->runtime.last_displayed_thumbnails = NULL;
+ }
}
/* Spacetype init callback. */