struct ImBuf * seq_stripelem_cache_get( SeqRenderData context, struct Sequence * seq, float cfra, seq_stripelem_ibuf_t type) { seqCacheKey key; seqCacheEntry * e; if (!seq) { return NULL; } if (!entrypool) { seq_stripelem_cache_init(); } key.seq = seq; key.context = context; key.cfra = cfra - seq->start; key.type = type; e = (seqCacheEntry*) BLI_ghash_lookup(hash, &key); if (e && e->ibuf) { IMB_refImBuf(e->ibuf); MEM_CacheLimiter_touch(e->c_handle); return e->ibuf; } return NULL; }
ImBuf *IMB_moviecache_get(MovieCache *cache, void *userkey) { MovieCacheKey key; MovieCacheItem *item; key.cache_owner = cache; key.userkey = userkey; item = (MovieCacheItem *)BLI_ghash_lookup(cache->hash, &key); if (item) { if (item->ibuf) { BLI_mutex_lock(&limitor_lock); MEM_CacheLimiter_touch(item->c_handle); BLI_mutex_unlock(&limitor_lock); IMB_refImBuf(item->ibuf); return item->ibuf; } } return NULL; }