summaryrefslogtreecommitdiffstats
path: root/video/mp_image.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-23 09:31:27 +0200
committerwm4 <wm4@nowhere>2017-07-23 09:31:27 +0200
commit9e7665b21b530cbbfeb187521dc9db78c2ca60db (patch)
tree1aa5b516a45c51cfaed1e59f200e8a1bbd8ba455 /video/mp_image.h
parent0ce3dce03aaea3e777ebf68504d5afb3f5e3f9e1 (diff)
downloadmpv-9e7665b21b530cbbfeb187521dc9db78c2ca60db.tar.bz2
mpv-9e7665b21b530cbbfeb187521dc9db78c2ca60db.tar.xz
mp_image: expose some image allocation code as helpers, refactor
Refactor the image allocation code, and expose part of it as helper code. This aims towards allowing callers to easily allocate mp_image references from custom-allocated linear buffers. This is exposing only as much as what should be actually required.
Diffstat (limited to 'video/mp_image.h')
-rw-r--r--video/mp_image.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/video/mp_image.h b/video/mp_image.h
index 56ce2257f4..e949b9b81f 100644
--- a/video/mp_image.h
+++ b/video/mp_image.h
@@ -104,6 +104,12 @@ typedef struct mp_image {
int mp_chroma_div_up(int size, int shift);
+int mp_image_get_alloc_size(int imgfmt, int w, int h, int stride_align);
+struct mp_image *mp_image_from_buffer(int imgfmt, int w, int h, int stride_align,
+ uint8_t *buffer, int buffer_size,
+ void *free_opaque,
+ void (*free)(void *opaque, uint8_t *data));
+
struct mp_image *mp_image_alloc(int fmt, int w, int h);
void mp_image_copy(struct mp_image *dmpi, struct mp_image *mpi);
void mp_image_copy_gpu(struct mp_image *dst, struct mp_image *src);