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/makesdna
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/makesdna')
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h3
-rw-r--r--source/blender/makesdna/DNA_space_types.h9
-rw-r--r--source/blender/makesdna/DNA_view2d_types.h2
3 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 782b4ac34aa..25330acd486 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -518,7 +518,7 @@ enum {
SEQ_OVERLAP = (1 << 3),
SEQ_FILTERY = (1 << 4),
SEQ_MUTE = (1 << 5),
- SEQ_FLAG_UNUSED_6 = (1 << 6), /* cleared */
+ SEQ_FLAG_SKIP_THUMBNAILS = (1 << 6),
SEQ_REVERSE_FRAMES = (1 << 7),
SEQ_IPO_FRAME_LOCKED = (1 << 8),
SEQ_EFFECT_NOT_LOADED = (1 << 9),
@@ -724,6 +724,7 @@ enum {
SEQ_CACHE_PREFETCH_ENABLE = (1 << 10),
SEQ_CACHE_DISK_CACHE_ENABLE = (1 << 11),
+ SEQ_CACHE_STORE_THUMBNAIL = (1 << 12),
};
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 84dc58345e3..e849039fa93 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -598,6 +598,7 @@ typedef struct SequencerTimelineOverlay {
/* SequencerTimelineOverlay.flag */
typedef enum eSpaceSeq_SequencerTimelineOverlay_Flag {
SEQ_TIMELINE_SHOW_STRIP_OFFSETS = (1 << 1),
+ SEQ_TIMELINE_SHOW_THUMBNAILS = (1 << 2),
SEQ_TIMELINE_SHOW_FCURVES = (1 << 5),
SEQ_TIMELINE_ALL_WAVEFORMS = (1 << 7), /* draw all waveforms */
SEQ_TIMELINE_NO_WAVEFORMS = (1 << 8), /* draw no waveforms */
@@ -607,6 +608,13 @@ typedef enum eSpaceSeq_SequencerTimelineOverlay_Flag {
SEQ_TIMELINE_SHOW_GRID = (1 << 18),
} eSpaceSeq_SequencerTimelineOverlay_Flag;
+typedef struct SpaceSeqRuntime {
+ /** Required for Thumbnail job start condition. */
+ struct rctf last_thumbnail_area;
+ /** Stores lists of most recently displayed thumbnails. */
+ struct GHash *last_displayed_thumbnails;
+} SpaceSeqRuntime;
+
/* Sequencer */
typedef struct SpaceSeq {
SpaceLink *next, *prev;
@@ -650,6 +658,7 @@ typedef struct SpaceSeq {
char multiview_eye;
char _pad2[7];
+ SpaceSeqRuntime runtime;
} SpaceSeq;
/* SpaceSeq.mainb */
diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index c385ac04bd3..f8166305fd9 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -132,6 +132,8 @@ enum {
V2D_PIXELOFS_X = (1 << 2),
/* apply pixel offsets on y-axis when setting view matrices */
V2D_PIXELOFS_Y = (1 << 3),
+ /* zoom, pan or similar action is in progress */
+ V2D_IS_NAVIGATING = (1 << 9),
/* view settings need to be set still... */
V2D_IS_INIT = (1 << 10),
};