summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-28 21:02:53 +0100
committerwm4 <wm4@nowhere>2013-03-28 21:46:17 +0100
commit69c4baad91b953afbd0ea9b76b57a7040812bb24 (patch)
tree4ee2a28fd5dbad12c7ea95d73a6d014335e5d3d5 /video
parent4221417875a67a3040de6fc01ba8c20b286855df (diff)
downloadmpv-69c4baad91b953afbd0ea9b76b57a7040812bb24.tar.bz2
mpv-69c4baad91b953afbd0ea9b76b57a7040812bb24.tar.xz
gl_video: always upload all planes
When displaying YUV with alpha plane (an extremely rare special case), we didn't upload the alpha plane, because we don't do anything with it. This actually created some annoying special cases, so upload the alpha planes as well, even if they're unused.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_video.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 8f69c37ccd..6bc78e6b4e 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -103,7 +103,7 @@ struct texplane {
};
struct video_image {
- struct texplane planes[3];
+ struct texplane planes[4];
bool image_flipped;
};
@@ -1363,13 +1363,6 @@ struct mp_image *gl_video_download_image(struct gl_video *p)
mp_image_t *image = mp_image_alloc(p->image_format, p->texture_w,
p->texture_h);
- // NOTE about image formats with alpha plane: we don't even have the alpha
- // anymore. We never upload it to any texture, as it would be a waste of
- // time. On the other hand, we can't find a "similar", non-alpha image
- // format easily. So we just leave the alpha plane of the newly allocated
- // image as-is, and hope that the alpha is ignored by the receiver of the
- // screenshot. (If not, code should be added to make it fully opaque.)
-
for (int n = 0; n < p->plane_count; n++) {
struct texplane *plane = &vimg->planes[n];
gl->ActiveTexture(GL_TEXTURE0 + n);
@@ -1651,13 +1644,7 @@ static bool init_format(int fmt, struct gl_video *init)
init->is_yuv = desc.flags & MP_IMGFLAG_YUV;
init->is_linear_rgb = false;
-
- // NOTE: we throw away the additional alpha plane, if one exists.
- // (2 plane formats with a 2nd alpha plane don't exist)
- init->plane_count = FFMIN(desc.num_planes, 3);
- assert(desc.num_planes >= init->plane_count);
- assert(desc.num_planes <= init->plane_count + 1);
-
+ init->plane_count = desc.num_planes;
init->image_desc = desc;
return true;