1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-20 05:42:19 +00:00
mpv/video/mp_image_pool.h
wm4 06b30cc81f vaapi: use libavutil functions for copying hw surfaces to memory
Makes va_surface_download() call mp_image_hw_download() for
libavutil-allocated surfaces, which in turn calls
av_hwframe_transfer_data().

mp_image_hw_download() is actually not specific to vaapi, and can be
used for any hw surface allocated by libavutil.
2017-01-12 13:58:28 +01:00

33 lines
1.2 KiB
C

#ifndef MPV_MP_IMAGE_POOL_H
#define MPV_MP_IMAGE_POOL_H
#include <stdbool.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);
// the reference to "new" is transferred to the pool
void mp_image_pool_add(struct mp_image_pool *pool, struct mp_image *new);
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);
bool mp_image_pool_make_writeable(struct mp_image_pool *pool,
struct mp_image *img);
struct mp_image *mp_image_hw_download(struct mp_image *img,
struct mp_image_pool *swpool);
#endif