# HG changeset patch # User reimar # Date 1345306651 0 # Node ID bfbacc1ef3bbd37606209870f75929b787613c9f # Parent 36997c82536f400b7bddeab62f215d931a4e06bc Add autodetection of ycbcr option. diff -r 36997c82536f -r bfbacc1ef3bb DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Sat Aug 18 15:59:49 2012 +0000 +++ b/DOCS/man/en/mplayer.1 Sat Aug 18 16:17:31 2012 +0000 @@ -4190,6 +4190,7 @@ With some (most/all?) implementations this only works in fullscreen mode. .IPs ycbcr Use the GL_APPLE_ycbcr_422 extension to convert YUV to RGB. +Default is disabled if yuv= is specified, auto-detected otherwise. Note that this will enable a few special settings to get into a special driver fast-path. .IPs yuv= Select the type of YUV to RGB conversion. diff -r 36997c82536f -r bfbacc1ef3bb libvo/vo_gl.c --- a/libvo/vo_gl.c Sat Aug 18 15:59:49 2012 +0000 +++ b/libvo/vo_gl.c Sat Aug 18 16:17:31 2012 +0000 @@ -524,11 +524,13 @@ !glYUVSupportsAlphaTex(use_yuv)) use_yuv = 0; } + if (use_ycbcr == -1) + use_ycbcr = extensions && strstr(extensions, "ycbcr_422"); if (is_ati && (lscale == 1 || lscale == 2 || cscale == 1 || cscale == 2)) mp_msg(MSGT_VO, MSGL_WARN, "[gl] Selected scaling mode may be broken on ATI cards.\n" "Tell _them_ to fix GL_REPEAT if you have issues.\n"); - mp_msg(MSGT_VO, MSGL_V, "[gl] Settings after autodetection: ati-hack = %i, force-pbo = %i, rectangle = %i, yuv = %i\n", - ati_hack, force_pbo, use_rectangle, use_yuv); + mp_msg(MSGT_VO, MSGL_V, "[gl] Settings after autodetection: ati-hack = %i, force-pbo = %i, rectangle = %i, yuv = %i, ycbcr = %i\n", + ati_hack, force_pbo, use_rectangle, use_yuv, use_ycbcr); } static GLint get_scale_type(int chroma) { @@ -1232,7 +1234,7 @@ use_osd = -1; scaled_osd = 0; use_aspect = 1; - use_ycbcr = 0; + use_ycbcr = -1; use_yuv = -1; colorspace = -1; levelconv = -1; @@ -1357,6 +1359,9 @@ if (!allow_sw && isSoftwareGl()) goto err_out; autodetectGlExtensions(); + } else if (use_ycbcr == -1) { + // rare feature, not worth creating a window to detect + use_ycbcr = 0; } if (many_fmts) mp_msg(MSGT_VO, MSGL_INFO, "[gl] using extended formats. "