summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-18 18:37:24 +0200
committerwm4 <wm4@nowhere>2015-10-18 18:37:24 +0200
commite3de309804d27d3ed41a45f37ca6a37ba3d4a267 (patch)
treed637aaf30e590404bcad324e92d0a3179948f1a3 /video/out/opengl/video.c
parent9ca312b4b1d8ccd2c3e28527b5a02dd27d911186 (diff)
downloadmpv-e3de309804d27d3ed41a45f37ca6a37ba3d4a267.tar.bz2
mpv-e3de309804d27d3ed41a45f37ca6a37ba3d4a267.tar.xz
vo_opengl: support all kinds of GBRP formats
Adds support for AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP, and AV_PIX_FMT_GBRAP16. (Not that it matters, because nobody uses these anyway.)
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r--video/out/opengl/video.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index fb339992cc..baa660de51 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -2278,13 +2278,16 @@ static bool init_format(int fmt, struct gl_video *init)
init->has_alpha = false;
// YUV/planar formats
- if (desc.flags & MP_IMGFLAG_YUV_P) {
+ if (desc.flags & (MP_IMGFLAG_YUV_P | MP_IMGFLAG_RGB_P)) {
int bits = desc.component_bits;
if ((desc.flags & MP_IMGFLAG_NE) && bits >= 8 && bits <= 16) {
init->has_alpha = desc.num_planes > 3;
plane_format[0] = find_tex_format(gl, (bits + 7) / 8, 1);
for (int p = 1; p < desc.num_planes; p++)
plane_format[p] = plane_format[0];
+ // RGB/planar
+ if (desc.flags & MP_IMGFLAG_RGB_P)
+ snprintf(init->color_swizzle, sizeof(init->color_swizzle), "brga");
goto supported;
}
}
@@ -2300,15 +2303,6 @@ static bool init_format(int fmt, struct gl_video *init)
goto supported;
}
- // RGB/planar
- if (fmt == IMGFMT_GBRP) {
- snprintf(init->color_swizzle, sizeof(init->color_swizzle), "brga");
- plane_format[0] = find_tex_format(gl, 1, 1);
- for (int p = 1; p < desc.num_planes; p++)
- plane_format[p] = plane_format[0];
- goto supported;
- }
-
// XYZ (same organization as RGB packed, but requires conversion matrix)
if (fmt == IMGFMT_XYZ12) {
plane_format[0] = find_tex_format(gl, 2, 3);