Blender V4.3
blender::seq Namespace Reference

Classes

struct  MediaPresence
 
class  ThumbGenerationJob
 
struct  ThumbnailCache
 

Functions

static const char * get_seq_base_path (const Sequence *seq)
 
static bool check_sound_media_missing (const bSound *sound, const Sequence *seq)
 
static bool check_media_missing (const Sequence *seq)
 
static MediaPresenceget_media_presence_cache (Scene *scene)
 
bool media_presence_is_missing (Scene *scene, const Sequence *seq)
 
void media_presence_set_missing (Scene *scene, const Sequence *seq, bool missing)
 
void media_presence_invalidate_strip (Scene *scene, const Sequence *seq)
 
void media_presence_invalidate_sound (Scene *scene, const bSound *sound)
 
void media_presence_free (Scene *scene)
 
static ThumbnailCacheensure_thumbnail_cache (Scene *scene)
 
static ThumbnailCachequery_thumbnail_cache (Scene *scene)
 
bool strip_can_have_thumbnail (const Scene *scene, const Sequence *seq)
 
static std::string get_path_from_seq (Scene *scene, const Sequence *seq, float timeline_frame)
 
static void image_size_to_thumb_size (int &r_width, int &r_height)
 
static ImBufmake_thumb_for_image (const Scene *scene, const ThumbnailCache::Request &request)
 
static void scale_to_thumbnail_size (ImBuf *ibuf)
 
static ImBufquery_thumbnail (ThumbnailCache &cache, const std::string &key, int frame_index, float timeline_frame, const bContext *C, const Sequence *seq)
 
ImBufthumbnail_cache_get (const bContext *C, Scene *scene, const Sequence *seq, float timeline_frame)
 
void thumbnail_cache_invalidate_strip (Scene *scene, const Sequence *seq)
 
void thumbnail_cache_maintain_capacity (Scene *scene)
 
void thumbnail_cache_discard_requests_outside (Scene *scene, const rctf &rect)
 
void thumbnail_cache_clear (Scene *scene)
 
void thumbnail_cache_destroy (Scene *scene)
 

Variables

static ThreadMutex presence_lock = BLI_MUTEX_INITIALIZER
 
static constexpr int MAX_THUMBNAILS = 5000
 
static std::mutex thumb_cache_mutex
 
static constexpr int SEQ_THUMB_SIZE = 256
 

Function Documentation

◆ check_media_missing()

◆ check_sound_media_missing()

static bool blender::seq::check_sound_media_missing ( const bSound * sound,
const Sequence * seq )
static

◆ ensure_thumbnail_cache()

static ThumbnailCache * blender::seq::ensure_thumbnail_cache ( Scene * scene)
static

Definition at line 141 of file thumbnail_cache.cc.

Referenced by thumbnail_cache_get().

◆ get_media_presence_cache()

static MediaPresence * blender::seq::get_media_presence_cache ( Scene * scene)
static

Definition at line 88 of file media_presence.cc.

Referenced by media_presence_is_missing(), and media_presence_set_missing().

◆ get_path_from_seq()

static std::string blender::seq::get_path_from_seq ( Scene * scene,
const Sequence * seq,
float timeline_frame )
static

◆ get_seq_base_path()

static const char * blender::seq::get_seq_base_path ( const Sequence * seq)
static

◆ image_size_to_thumb_size()

static void blender::seq::image_size_to_thumb_size ( int & r_width,
int & r_height )
static

Definition at line 194 of file thumbnail_cache.cc.

References float, round_fl_to_int(), and SEQ_THUMB_SIZE.

Referenced by scale_to_thumbnail_size().

◆ make_thumb_for_image()

static ImBuf * blender::seq::make_thumb_for_image ( const Scene * scene,
const ThumbnailCache::Request & request )
static

◆ media_presence_free()

void blender::seq::media_presence_free ( Scene * scene)

Free media presence cache, if it was created.

Definition at line 178 of file media_presence.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), and presence_lock.

Referenced by SEQ_editing_free(), and sequencer_refresh_all_exec().

◆ media_presence_invalidate_sound()

void blender::seq::media_presence_invalidate_sound ( Scene * scene,
const bSound * sound )

Invalidate media presence cache for the given sound.

Definition at line 169 of file media_presence.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), and presence_lock.

◆ media_presence_invalidate_strip()

void blender::seq::media_presence_invalidate_strip ( Scene * scene,
const Sequence * seq )

Invalidate media presence cache for the given strip.

Definition at line 160 of file media_presence.cc.

References BLI_mutex_lock(), BLI_mutex_unlock(), and presence_lock.

Referenced by sequence_invalidate_cache().

◆ media_presence_is_missing()

bool blender::seq::media_presence_is_missing ( Scene * scene,
const Sequence * seq )

◆ media_presence_set_missing()

◆ query_thumbnail()

◆ query_thumbnail_cache()

◆ scale_to_thumbnail_size()

static void blender::seq::scale_to_thumbnail_size ( ImBuf * ibuf)
static

Definition at line 224 of file thumbnail_cache.cc.

References image_size_to_thumb_size(), IMB_scale(), Nearest, ImBuf::x, and ImBuf::y.

◆ strip_can_have_thumbnail()

bool blender::seq::strip_can_have_thumbnail ( const Scene * scene,
const Sequence * seq )

◆ thumbnail_cache_clear()

void blender::seq::thumbnail_cache_clear ( Scene * scene)

◆ thumbnail_cache_destroy()

void blender::seq::thumbnail_cache_destroy ( Scene * scene)

◆ thumbnail_cache_discard_requests_outside()

void blender::seq::thumbnail_cache_discard_requests_outside ( Scene * scene,
const rctf & rect )

Discard in-flight thumbnail loading requests that are outside of the given view (X coordinate: timeline frames, Y coordinate: channels).

Definition at line 585 of file thumbnail_cache.cc.

References lock, query_thumbnail_cache(), blender::seq::ThumbnailCache::requests_, thumb_cache_mutex, thumbnail_cache_discard_requests_outside(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by draw_seq_strips(), and thumbnail_cache_discard_requests_outside().

◆ thumbnail_cache_get()

ImBuf * blender::seq::thumbnail_cache_get ( const bContext * C,
Scene * scene,
const Sequence * seq,
float timeline_frame )

Get a thumbnail image for given strip seq at timeline_frame.

The function can return null if a strip type does not have a thumbnail, a source media file is not found, or the thumbnail has not been loaded yet.

A "closest" thumbnail if there is no exact match can also be returned, e.g. for a movie strip the closest frame that has a thumbnail already.

When there is no exact match, a request to load a thumbnail will be internally added and processed in the background.

Definition at line 482 of file thumbnail_cache.cc.

References Sequence::anim_startofs, ensure_thumbnail_cache(), get_path_from_seq(), IMB_refImBuf(), lock, query_thumbnail(), blender::math::round(), SEQ_give_frame_index(), SEQ_TYPE_MOVIE, strip_can_have_thumbnail(), thumb_cache_mutex, thumbnail_cache_get(), and Sequence::type.

Referenced by get_seq_strip_thumbnails(), and thumbnail_cache_get().

◆ thumbnail_cache_invalidate_strip()

◆ thumbnail_cache_maintain_capacity()

void blender::seq::thumbnail_cache_maintain_capacity ( Scene * scene)

If total amount of resident thumbnails is too large, try to remove oldest-used ones to keep the cache size in check.

Definition at line 542 of file thumbnail_cache.cc.

References IMB_freeImBuf(), lock, blender::seq::ThumbnailCache::logical_time_, blender::seq::ThumbnailCache::map_, MAX_THUMBNAILS, query_thumbnail_cache(), blender::seq::ThumbnailCache::remove_entry(), thumb_cache_mutex, and thumbnail_cache_maintain_capacity().

Referenced by draw_seq_strips(), and thumbnail_cache_maintain_capacity().

Variable Documentation

◆ MAX_THUMBNAILS

int blender::seq::MAX_THUMBNAILS = 5000
staticconstexpr

Definition at line 34 of file thumbnail_cache.cc.

Referenced by thumbnail_cache_maintain_capacity().

◆ presence_lock

◆ SEQ_THUMB_SIZE

int blender::seq::SEQ_THUMB_SIZE = 256
staticconstexpr

◆ thumb_cache_mutex