Blender V4.3
moviecache.cc File Reference
#include <cstdlib>
#include <memory.h>
#include <mutex>
#include "MEM_CacheLimiterC-Api.h"
#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
#include "BLI_mempool.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "IMB_moviecache.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"

Go to the source code of this file.

Classes

struct  MovieCache
 
struct  MovieCacheKey
 
struct  MovieCacheItem
 

Macros

#define PRINT(format, ...)
 

Functions

static uint moviecache_hashhash (const void *keyv)
 
static bool moviecache_hashcmp (const void *av, const void *bv)
 
static void moviecache_keyfree (void *val)
 
static void moviecache_valfree (void *val)
 
static void check_unused_keys (MovieCache *cache)
 
static int compare_int (const void *av, const void *bv)
 
static void moviecache_destructor (void *p)
 
static size_t get_size_in_memory (ImBuf *ibuf)
 
static size_t get_item_size (void *p)
 
static int get_item_priority (void *item_v, int default_priority)
 
static bool get_item_destroyable (void *item_v)
 
void IMB_moviecache_init ()
 
void IMB_moviecache_destruct ()
 
MovieCacheIMB_moviecache_create (const char *name, int keysize, GHashHashFP hashfp, GHashCmpFP cmpfp)
 
void IMB_moviecache_set_getdata_callback (MovieCache *cache, MovieCacheGetKeyDataFP getdatafp)
 
void IMB_moviecache_set_priority_callback (MovieCache *cache, MovieCacheGetPriorityDataFP getprioritydatafp, MovieCacheGetItemPriorityFP getitempriorityfp, MovieCachePriorityDeleterFP prioritydeleterfp)
 
static void do_moviecache_put (MovieCache *cache, void *userkey, ImBuf *ibuf, bool need_lock)
 
void IMB_moviecache_put (MovieCache *cache, void *userkey, ImBuf *ibuf)
 
bool IMB_moviecache_put_if_possible (MovieCache *cache, void *userkey, ImBuf *ibuf)
 
void IMB_moviecache_remove (MovieCache *cache, void *userkey)
 
ImBufIMB_moviecache_get (MovieCache *cache, void *userkey, bool *r_is_cached_empty)
 
bool IMB_moviecache_has_frame (MovieCache *cache, void *userkey)
 
void IMB_moviecache_free (MovieCache *cache)
 
void IMB_moviecache_cleanup (MovieCache *cache, bool(cleanup_check_cb)(ImBuf *ibuf, void *userkey, void *userdata), void *userdata)
 
void IMB_moviecache_get_cache_segments (MovieCache *cache, int proxy, int render_flags, int *r_totseg, int **r_points)
 
MovieCacheIter * IMB_moviecacheIter_new (MovieCache *cache)
 
void IMB_moviecacheIter_free (MovieCacheIter *iter)
 
bool IMB_moviecacheIter_done (MovieCacheIter *iter)
 
void IMB_moviecacheIter_step (MovieCacheIter *iter)
 
ImBufIMB_moviecacheIter_getImBuf (MovieCacheIter *iter)
 
void * IMB_moviecacheIter_getUserKey (MovieCacheIter *iter)
 

Variables

static MEM_CacheLimiterClimitor = nullptr
 
static std::recursive_mutex limitor_lock
 

Macro Definition Documentation

◆ PRINT

Function Documentation

◆ check_unused_keys()

◆ compare_int()

static int compare_int ( const void * av,
const void * bv )
static

Definition at line 162 of file moviecache.cc.

References b.

Referenced by IMB_moviecache_get_cache_segments().

◆ do_moviecache_put()

◆ get_item_destroyable()

static bool get_item_destroyable ( void * item_v)
static

Definition at line 232 of file moviecache.cc.

References IB_BITMAPDIRTY, IB_PERSISTENT, MovieCacheItem::ibuf, and ImBuf::userflags.

Referenced by IMB_moviecache_init().

◆ get_item_priority()

static int get_item_priority ( void * item_v,
int default_priority )
static

◆ get_item_size()

static size_t get_item_size ( void * p)
static

Definition at line 197 of file moviecache.cc.

References get_size_in_memory(), MovieCacheItem::ibuf, and size().

Referenced by IMB_moviecache_init().

◆ get_size_in_memory()

static size_t get_size_in_memory ( ImBuf * ibuf)
static

◆ IMB_moviecache_cleanup()

◆ IMB_moviecache_create()

◆ IMB_moviecache_destruct()

◆ IMB_moviecache_free()

◆ IMB_moviecache_get()

◆ IMB_moviecache_get_cache_segments()

void IMB_moviecache_get_cache_segments ( MovieCache * cache,
int proxy,
int render_flags,
int * r_totseg,
int ** r_points )

◆ IMB_moviecache_has_frame()

bool IMB_moviecache_has_frame ( MovieCache * cache,
void * userkey )

◆ IMB_moviecache_init()

◆ IMB_moviecache_put()

void IMB_moviecache_put ( MovieCache * cache,
void * userkey,
ImBuf * ibuf )

Definition at line 367 of file moviecache.cc.

References do_moviecache_put().

Referenced by colormanage_cache_put(), imagecache_put(), and put_imbuf_cache().

◆ IMB_moviecache_put_if_possible()

bool IMB_moviecache_put_if_possible ( MovieCache * cache,
void * userkey,
ImBuf * ibuf )

◆ IMB_moviecache_remove()

void IMB_moviecache_remove ( MovieCache * cache,
void * userkey )

◆ IMB_moviecache_set_getdata_callback()

void IMB_moviecache_set_getdata_callback ( MovieCache * cache,
MovieCacheGetKeyDataFP getdatafp )

Definition at line 292 of file moviecache.cc.

References MovieCache::getdatafp.

Referenced by imagecache_put(), and put_imbuf_cache().

◆ IMB_moviecache_set_priority_callback()

void IMB_moviecache_set_priority_callback ( MovieCache * cache,
MovieCacheGetPriorityDataFP getprioritydatafp,
MovieCacheGetItemPriorityFP getitempriorityfp,
MovieCachePriorityDeleterFP prioritydeleterfp )

◆ IMB_moviecacheIter_done()

◆ IMB_moviecacheIter_free()

◆ IMB_moviecacheIter_getImBuf()

◆ IMB_moviecacheIter_getUserKey()

void * IMB_moviecacheIter_getUserKey ( MovieCacheIter * iter)

Definition at line 606 of file moviecache.cc.

References BLI_ghashIterator_getKey(), and MovieCacheKey::userkey.

Referenced by BKE_image_merge().

◆ IMB_moviecacheIter_new()

◆ IMB_moviecacheIter_step()

◆ moviecache_destructor()

static void moviecache_destructor ( void * p)
static

◆ moviecache_hashcmp()

static bool moviecache_hashcmp ( const void * av,
const void * bv )
static

Definition at line 91 of file moviecache.cc.

References b.

Referenced by IMB_moviecache_create().

◆ moviecache_hashhash()

static uint moviecache_hashhash ( const void * keyv)
static

◆ moviecache_keyfree()

◆ moviecache_valfree()

Variable Documentation

◆ limitor

◆ limitor_lock

std::recursive_mutex limitor_lock
static