summaryrefslogtreecommitdiffstats
path: root/video/zimg.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-04-24 14:41:50 +0200
committerwm4 <wm4@nowhere>2020-04-24 14:41:50 +0200
commit71295fb872ba6593c8591cff7398498e05afb298 (patch)
treed205cb839328edbc2ce87609ca8fa7f244c8d3b9 /video/zimg.c
parent8909bf3317b26f35265efa7dae534f430c636bb3 (diff)
downloadmpv-71295fb872ba6593c8591cff7398498e05afb298.tar.bz2
mpv-71295fb872ba6593c8591cff7398498e05afb298.tar.xz
video: add alpha type metadata
This is mostly for testing. It adds passing through the metadata through the video chain. The metadata can be manipulated with vf_format. Support for zimg alpha conversion (if built with zimg after it gained alpha support) is implemented. Support premultiplied input in vo_gpu. Some things still seem to be buggy.
Diffstat (limited to 'video/zimg.c')
-rw-r--r--video/zimg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/zimg.c b/video/zimg.c
index 635696f686..2f52537c07 100644
--- a/video/zimg.c
+++ b/video/zimg.c
@@ -1137,7 +1137,8 @@ static bool setup_format_ne(zimg_image_format *zfmt, struct mp_zimg_repack *r,
r->z_planes[3] = n; // alpha, always plane 4 in zimg
#if HAVE_ZIMG_ALPHA
- zfmt->alpha = ZIMG_ALPHA_STRAIGHT;
+ zfmt->alpha = fmt.alpha == MP_ALPHA_PREMUL
+ ? ZIMG_ALPHA_PREMULTIPLIED : ZIMG_ALPHA_STRAIGHT;
#else
return false;
#endif