mirror of
https://github.com/mpv-player/mpv
synced 2024-12-18 21:06:00 +00:00
88aa3b8c98
The plan is to get rid of the custom VAAPI and possibly VDPAU surface allocators. Add custom surface allocation, because hwaccel surfaces are allocated completely differently from software surfaces. Add optional LRU allocation, which is (probably) helpful for hwaccel, but (probably) less optimal for software surfaces. mp_image_pool_get_no_alloc() is specifically for VAAPI, which can't allocate new decoder surfaces after decoder init.
26 lines
987 B
C
26 lines
987 B
C
#ifndef MPV_MP_IMAGE_POOL_H
|
|
#define MPV_MP_IMAGE_POOL_H
|
|
|
|
struct mp_image_pool;
|
|
|
|
struct mp_image_pool *mp_image_pool_new(int max_count);
|
|
struct mp_image *mp_image_pool_get(struct mp_image_pool *pool, int fmt,
|
|
int w, int h);
|
|
void mp_image_pool_clear(struct mp_image_pool *pool);
|
|
|
|
void mp_image_pool_set_lru(struct mp_image_pool *pool);
|
|
|
|
struct mp_image *mp_image_pool_get_no_alloc(struct mp_image_pool *pool, int fmt,
|
|
int w, int h);
|
|
|
|
typedef struct mp_image *(*mp_image_allocator)(void *data, int fmt, int w, int h);
|
|
void mp_image_pool_set_allocator(struct mp_image_pool *pool,
|
|
mp_image_allocator cb, void *cb_data);
|
|
|
|
struct mp_image *mp_image_pool_new_copy(struct mp_image_pool *pool,
|
|
struct mp_image *img);
|
|
void mp_image_pool_make_writeable(struct mp_image_pool *pool,
|
|
struct mp_image *img);
|
|
|
|
#endif
|