changeset 35008:bfbacc1ef3bb

Add autodetection of ycbcr option.
author reimar
date Sat, 18 Aug 2012 16:17:31 +0000
parents 36997c82536f
children 4ba5b32b61ac
files DOCS/man/en/mplayer.1 libvo/vo_gl.c
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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=<n>
 Select the type of YUV to RGB conversion.
--- 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. "