diff options
author | wm4 <wm4@nowhere> | 2013-03-28 21:02:41 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-03-28 21:46:17 +0100 |
commit | 120d6bf57cbed1be4d909b0633908fc32fed7013 (patch) | |
tree | d3c01290b46b1342dc282c4c016ddfbe68119b4a /video/out/gl_video.c | |
parent | 1df2edda3a1ae400a09244f3d7e6c7d69e3a43ac (diff) | |
download | mpv-120d6bf57cbed1be4d909b0633908fc32fed7013.tar.bz2 mpv-120d6bf57cbed1be4d909b0633908fc32fed7013.tar.xz |
gl_video: add support for NV12
There's really no reason for this, but it feels nice being able to
support a weird pixel format.
Diffstat (limited to 'video/out/gl_video.c')
-rw-r--r-- | video/out/gl_video.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index ee2cdffe6f..18991923f4 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -690,7 +690,12 @@ static void compile_shaders(struct gl_video *p) bool convert_input_to_linear = !p->is_linear_rgb && (p->opts.srgb || p->use_lut_3d); - shader_def_opt(&header_conv, "USE_PLANAR", p->plane_count > 1); + if (p->image_format == IMGFMT_NV12) { + shader_def(&header_conv, "USE_CONV", "CONV_NV12"); + } else if (p->plane_count > 1) { + shader_def(&header_conv, "USE_CONV", "CONV_PLANAR"); + } + shader_def_opt(&header_conv, "USE_GBRP", p->image_format == IMGFMT_GBRP); shader_def_opt(&header_conv, "USE_YGRAY", p->is_yuv && p->plane_count == 1); shader_def_opt(&header_conv, "USE_COLORMATRIX", p->is_yuv); @@ -1603,6 +1608,13 @@ static bool init_format(int fmt, struct gl_video *init) } } + // YUV/half-packed + if (!supported && fmt == IMGFMT_NV12) { + supported = true; + plane_format[0] = IMGFMT_Y8; + plane_format[1] = IMGFMT_YA8; + } + // RGB/planar if (!supported && fmt == IMGFMT_GBRP) { supported = true; |