diff options
author | wm4 <wm4@nowhere> | 2012-11-10 02:02:24 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-13 17:39:32 +0100 |
commit | d77d9fb933e0e7dc34de02f3d0c13791ddd80114 (patch) | |
tree | ca45e0f9d753e7ee7b5bd142eb2aed1638bf391c /video/mp_image.h | |
parent | 1568161aadf24ee3a6d982612b7380f8b1dc4a58 (diff) | |
download | mpv-d77d9fb933e0e7dc34de02f3d0c13791ddd80114.tar.bz2 mpv-d77d9fb933e0e7dc34de02f3d0c13791ddd80114.tar.xz |
mp_image: require using mp_image_set_size() for setting w/h
Setting the size of a mp_image must be done with mp_image_set_size()
now. Do this to guarantee that the redundant fields (like chroma_width)
are updated consistently. Replacing the redundant fields by function
calls would probably be better, but there are too many uses of them,
and is a bit less convenient.
Most code actually called mp_image_setfmt(), which did this as well.
This commit just makes things a bit more explicit.
Warning: the video filter chain still sets up mp_images manually,
and vf_get_image() is not updated.
Diffstat (limited to 'video/mp_image.h')
-rw-r--r-- | video/mp_image.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/video/mp_image.h b/video/mp_image.h index c57d0a63e9..2fb693eb65 100644 --- a/video/mp_image.h +++ b/video/mp_image.h @@ -166,6 +166,9 @@ void mp_image_make_writeable(struct mp_image *img); void mp_image_setrefp(struct mp_image **p_img, struct mp_image *new_value); void mp_image_unrefp(struct mp_image **p_img); +void mp_image_set_size(struct mp_image *mpi, int w, int h); +void mp_image_set_display_size(struct mp_image *mpi, int dw, int dh); + struct mp_image *mp_image_new_empty(int w, int h); void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt); void mp_image_alloc_planes(struct mp_image *mpi); |