summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/video.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/out/gpu/video.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/out/gpu/video.c')
-rw-r--r--video/out/gpu/video.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index 9d5df7c739..4d14eb8019 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -2357,9 +2357,11 @@ static void pass_convert_yuv(struct gl_video *p)
p->components = 3;
if (!p->has_alpha || p->opts.alpha_mode == ALPHA_NO) {
GLSL(color.a = 1.0;)
- } else { // alpha present in image
+ } else if (p->image_params.alpha == MP_ALPHA_PREMUL) {
p->components = 4;
- GLSL(color = vec4(color.rgb * color.a, color.a);)
+ } else {
+ p->components = 4;
+ GLSL(color = vec4(color.rgb * color.a, color.a);) // straight -> premul
}
}