Blender  V3.3
IMB_moviecache.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. All rights reserved. */
3 
4 #pragma once
5 
10 #include "BLI_ghash.h"
11 #include "BLI_utildefines.h"
12 
13 /* Cache system for movie data - now supports storing ImBufs only
14  * Supposed to provide unified cache system for movie clips, sequencer and
15  * other movie-related areas */
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 struct ImBuf;
22 struct MovieCache;
23 
24 typedef void (*MovieCacheGetKeyDataFP)(void *userkey, int *framenr, int *proxy, int *render_flags);
25 
26 typedef void *(*MovieCacheGetPriorityDataFP)(void *userkey);
27 typedef int (*MovieCacheGetItemPriorityFP)(void *last_userkey, void *priority_data);
28 typedef void (*MovieCachePriorityDeleterFP)(void *priority_data);
29 
30 void IMB_moviecache_init(void);
31 void IMB_moviecache_destruct(void);
32 
33 struct MovieCache *IMB_moviecache_create(const char *name,
34  int keysize,
43 
44 void IMB_moviecache_put(struct MovieCache *cache, void *userkey, struct ImBuf *ibuf);
45 bool IMB_moviecache_put_if_possible(struct MovieCache *cache, void *userkey, struct ImBuf *ibuf);
46 struct ImBuf *IMB_moviecache_get(struct MovieCache *cache, void *userkey, bool *r_is_cached_empty);
47 void IMB_moviecache_remove(struct MovieCache *cache, void *userkey);
48 bool IMB_moviecache_has_frame(struct MovieCache *cache, void *userkey);
49 void IMB_moviecache_free(struct MovieCache *cache);
50 
52  bool(cleanup_check_cb)(struct ImBuf *ibuf,
53  void *userkey,
54  void *userdata),
55  void *userdata);
56 
61  struct MovieCache *cache, int proxy, int render_flags, int *r_totseg, int **r_points);
62 
63 struct MovieCacheIter;
64 struct MovieCacheIter *IMB_moviecacheIter_new(struct MovieCache *cache);
65 void IMB_moviecacheIter_free(struct MovieCacheIter *iter);
66 bool IMB_moviecacheIter_done(struct MovieCacheIter *iter);
67 void IMB_moviecacheIter_step(struct MovieCacheIter *iter);
68 struct ImBuf *IMB_moviecacheIter_getImBuf(struct MovieCacheIter *iter);
69 void *IMB_moviecacheIter_getUserKey(struct MovieCacheIter *iter);
70 
71 #ifdef __cplusplus
72 }
73 #endif
bool(* GHashCmpFP)(const void *a, const void *b)
Definition: BLI_ghash.h:36
unsigned int(* GHashHashFP)(const void *key)
Definition: BLI_ghash.h:34
bool IMB_moviecache_has_frame(struct MovieCache *cache, void *userkey)
Definition: moviecache.cc:432
struct MovieCache * IMB_moviecache_create(const char *name, int keysize, GHashHashFP hashfp, GHashCmpFP cmpfp)
Definition: moviecache.cc:265
struct ImBuf * IMB_moviecache_get(struct MovieCache *cache, void *userkey, bool *r_is_cached_empty)
Definition: moviecache.cc:401
int(* MovieCacheGetItemPriorityFP)(void *last_userkey, void *priority_data)
void IMB_moviecache_set_getdata_callback(struct MovieCache *cache, MovieCacheGetKeyDataFP getdatafp)
Definition: moviecache.cc:292
void IMB_moviecacheIter_free(struct MovieCacheIter *iter)
Definition: moviecache.cc:585
void IMB_moviecache_remove(struct MovieCache *cache, void *userkey)
Definition: moviecache.cc:393
void IMB_moviecache_cleanup(struct MovieCache *cache, bool(cleanup_check_cb)(struct ImBuf *ibuf, void *userkey, void *userdata), void *userdata)
struct MovieCacheIter * IMB_moviecacheIter_new(struct MovieCache *cache)
Definition: moviecache.cc:575
void IMB_moviecache_destruct(void)
Definition: moviecache.cc:257
void IMB_moviecache_put(struct MovieCache *cache, void *userkey, struct ImBuf *ibuf)
Definition: moviecache.cc:367
void IMB_moviecache_free(struct MovieCache *cache)
Definition: moviecache.cc:444
void IMB_moviecache_get_cache_segments(struct MovieCache *cache, int proxy, int render_flags, int *r_totseg, int **r_points)
Definition: moviecache.cc:489
bool IMB_moviecacheIter_done(struct MovieCacheIter *iter)
Definition: moviecache.cc:590
bool IMB_moviecache_put_if_possible(struct MovieCache *cache, void *userkey, struct ImBuf *ibuf)
Definition: moviecache.cc:372
void IMB_moviecacheIter_step(struct MovieCacheIter *iter)
Definition: moviecache.cc:595
void(* MovieCachePriorityDeleterFP)(void *priority_data)
void IMB_moviecache_set_priority_callback(struct MovieCache *cache, MovieCacheGetPriorityDataFP getprioritydatafp, MovieCacheGetItemPriorityFP getitempriorityfp, MovieCachePriorityDeleterFP prioritydeleterfp)
Definition: moviecache.cc:297
void IMB_moviecache_init(void)
Definition: moviecache.cc:249
void * IMB_moviecacheIter_getUserKey(struct MovieCacheIter *iter)
Definition: moviecache.cc:606
struct ImBuf * IMB_moviecacheIter_getImBuf(struct MovieCacheIter *iter)
Definition: moviecache.cc:600
void *(* MovieCacheGetPriorityDataFP)(void *userkey)
void(* MovieCacheGetKeyDataFP)(void *userkey, int *framenr, int *proxy, int *render_flags)
SyclQueue void void size_t num_bytes void
void * userdata
MovieCacheGetKeyDataFP getdatafp
Definition: moviecache.cc:52
GHashHashFP hashfp
Definition: moviecache.cc:50
void * last_userkey
Definition: moviecache.cc:64
MovieCacheGetItemPriorityFP getitempriorityfp
Definition: moviecache.cc:55
MovieCachePriorityDeleterFP prioritydeleterfp
Definition: moviecache.cc:56
int render_flags
Definition: moviecache.cc:66
char name[64]
Definition: moviecache.cc:47
GHashCmpFP cmpfp
Definition: moviecache.cc:51
MovieCacheGetPriorityDataFP getprioritydatafp
Definition: moviecache.cc:54