summaryrefslogtreecommitdiffstats
path: root/video/out/opengl
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-05-10 21:11:58 +0200
committerwm4 <wm4@nowhere>2016-05-10 21:12:57 +0200
commit1f6e71c7faed4b44ec2c50519f8c1f6734d81eea (patch)
tree189b57ca2a08b20a1960213f4c5d2bb1393c01df /video/out/opengl
parenta3d416c3d3f578e9359fcc145989b26ccf58d190 (diff)
downloadmpv-1f6e71c7faed4b44ec2c50519f8c1f6734d81eea.tar.bz2
mpv-1f6e71c7faed4b44ec2c50519f8c1f6734d81eea.tar.xz
vo_opengl: fix passing along swizzle from hwdec interop
In theory this was needed for the previous commit (but wasn't in practice, since for hwdec the LUMINANCE_ALPHA mangling is not applied anymore, and ANGLE uses RG textures in absence of GL_ARB_texture_rg for whatever crazy reasons). In practice this caused funky colors on OSX with the uyvy422 format, which is also fixed in this commit.
Diffstat (limited to 'video/out/opengl')
-rw-r--r--video/out/opengl/hwdec_osx.c2
-rw-r--r--video/out/opengl/video.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec_osx.c b/video/out/opengl/hwdec_osx.c
index 2c1ffc71ae..6ddfa66e0a 100644
--- a/video/out/opengl/hwdec_osx.c
+++ b/video/out/opengl/hwdec_osx.c
@@ -246,6 +246,8 @@ static int map_frame(struct gl_hwdec *hw, struct mp_image *hw_image,
.tex_w = IOSurfaceGetWidthOfPlane(surface, i),
.tex_h = IOSurfaceGetHeightOfPlane(surface, i),
};
+ snprintf(out_frame->planes[i].swizzle, sizeof(out_frame->planes[i].swizzle),
+ "%s", f->gl[i].swizzle);
}
return 0;
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 948eefe096..c636d12135 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -2571,6 +2571,8 @@ static void gl_video_upload_image(struct gl_video *p, struct mp_image *mpi)
.gl_target = plane->gl_target,
.gl_texture = plane->gl_texture,
};
+ snprintf(vimg->planes[n].swizzle, sizeof(vimg->planes[n].swizzle),
+ "%s", plane->swizzle);
}
} else {
MP_FATAL(p, "Mapping hardware decoded surface failed.\n");