summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-09 19:34:30 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-09 19:34:30 +0200
commit5c6795a687cd9149e57985b632cf7a1c4a5c8310 (patch)
tree60f61ddbcd8aa96f04b9851029923d81d0b0be89
parent8a93561c8187058ae6278c9c6adb5ada7bedeff4 (diff)
parentd7a1d12f6147b53944a56117feae66d8e0e52fb1 (diff)
downloadmpv-5c6795a687cd9149e57985b632cf7a1c4a5c8310.tar.bz2
mpv-5c6795a687cd9149e57985b632cf7a1c4a5c8310.tar.xz
Merge svn changes up to r30494
Conflicts: libvo/vo_gl.c libvo/x11_common.c
-rw-r--r--Changelog1
-rw-r--r--DOCS/man/en/mplayer.13
-rw-r--r--libvo/geometry.c12
-rw-r--r--libvo/vo_gl.c67
-rw-r--r--libvo/x11_common.c1
-rw-r--r--loader/qtx/list.c21
-rw-r--r--loader/qtx/qtxload.c18
-rw-r--r--mp3lib/test.c17
-rw-r--r--mp3lib/test2.c18
9 files changed, 122 insertions, 36 deletions
diff --git a/Changelog b/Changelog
index 1695720b65..3ebf83f49f 100644
--- a/Changelog
+++ b/Changelog
@@ -27,6 +27,7 @@ MPlayer (1.0)
subsampling, 16 bit per component)
* Selectable YUV to RGB conversion standard for -vo gl
(-vo gl:colorspace=...:levelconv=...)
+ * -vo gl now tries to use yuv=2 by default if possible.
* -vo matrixview finally added
* add OS/2 KAI audio driver (-ao kai)
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 5e11048552..bf1e2ba71f 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -3842,8 +3842,9 @@ Use the GL_MESA_ycbcr_texture extension to convert YUV to RGB.
In most cases this is probably slower than doing software conversion to RGB.
.IPs yuv=<n>
Select the type of YUV to RGB conversion.
+The default is auto-detection deciding between values 0 and 2.
.RSss
-0: Use software conversion (default).
+0: Use software conversion.
Compatible with all OpenGL versions.
Provides brightness, contrast and saturation control.
.br
diff --git a/libvo/geometry.c b/libvo/geometry.c
index e8f0826bf9..056a05facb 100644
--- a/libvo/geometry.c
+++ b/libvo/geometry.c
@@ -25,10 +25,10 @@
#include "mp_msg.h"
/* A string of the form [WxH][+X+Y] or xpos[%]:ypos[%] */
-char *vo_geometry = NULL;
+char *vo_geometry;
// set when either width or height is changed
-int geometry_wh_changed = 0;
-int geometry_xy_changed = 0;
+int geometry_wh_changed;
+int geometry_xy_changed;
#define RESET_GEOMETRY width = height = xoff = yoff = xper = yper = INT_MIN;
@@ -96,10 +96,8 @@ int geometry(int *xpos, int *ypos, int *widw, int *widh, int scrw, int scrh)
if (width > 0 && widw) *widw = width;
if (height > 0 && widh) *widh = height;
- if (width > 0 || height > 0)
- geometry_wh_changed = 1;
- if (xoff != INT_MIN || yoff != INT_MIN)
- geometry_xy_changed = 1;
+ geometry_wh_changed = width > 0 || height > 0;
+ geometry_xy_changed = xoff != INT_MIN || yoff != INT_MIN;
}
return 1;
}
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index b962beabc8..3101d51d9a 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -456,11 +456,12 @@ static void autodetectGlExtensions(void) {
if (ati_hack == -1) ati_hack = ati_broken_pbo;
if (force_pbo == -1) force_pbo = strstr(extensions, "_pixel_buffer_object") ? is_ati : 0;
if (use_rectangle == -1) use_rectangle = strstr(extensions, "_texture_non_power_of_two") ? 0 : 0;
+ if (use_yuv == -1) use_yuv = strstr(extensions, "GL_ARB_fragment_program") ? 2 : 0;
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\n",
- ati_hack, force_pbo, use_rectangle);
+ 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);
}
/**
@@ -470,6 +471,9 @@ static void autodetectGlExtensions(void) {
static int initGl(uint32_t d_width, uint32_t d_height) {
int scale_type = mipmap_gen ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR;
autodetectGlExtensions();
+ gl_target = use_rectangle == 1 ? GL_TEXTURE_RECTANGLE : GL_TEXTURE_2D;
+ yuvconvtype = use_yuv | lscale << YUV_LUM_SCALER_SHIFT | cscale << YUV_CHROM_SCALER_SHIFT;
+
texSize(image_width, image_height, &texture_width, &texture_height);
Disable(GL_BLEND);
@@ -534,22 +538,8 @@ static int initGl(uint32_t d_width, uint32_t d_height) {
return 1;
}
-/* connect to server, create and map window,
- * allocate colors and (shared) memory
- */
-static int
-config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
+static int create_window(uint32_t d_width, uint32_t d_height, uint32_t flags, const char *title)
{
- int xs, ys;
- image_height = height;
- image_width = width;
- image_format = format;
- is_yuv = mp_get_chroma_shift(image_format, &xs, &ys) > 0;
- is_yuv |= (xs << 8) | (ys << 16);
- glFindFormat(format, NULL, &gl_texfmt, &gl_format, &gl_type);
-
- vo_flipped = !!(flags & VOFLAG_FLIPPING);
-
#ifdef CONFIG_GL_WIN32
if (glctx.type == GLTYPE_W32 && !vo_w32_config(d_width, d_height, flags))
return -1;
@@ -569,6 +559,27 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
"gl", title);
}
#endif
+ return 0;
+}
+
+/* connect to server, create and map window,
+ * allocate colors and (shared) memory
+ */
+static int
+config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
+{
+ int xs, ys;
+ image_height = height;
+ image_width = width;
+ image_format = format;
+ is_yuv = mp_get_chroma_shift(image_format, &xs, &ys) > 0;
+ is_yuv |= (xs << 8) | (ys << 16);
+ glFindFormat(format, NULL, &gl_texfmt, &gl_format, &gl_type);
+
+ vo_flipped = !!(flags & VOFLAG_FLIPPING);
+
+ if (create_window(d_width, d_height, flags, title) < 0)
+ return -1;
glconfig:
if (vo_config_count)
@@ -982,7 +993,6 @@ query_format(uint32_t format)
static void
uninit(void)
{
- if (!vo_config_count) return;
uninitGl();
if (custom_prog) free(custom_prog);
custom_prog = NULL;
@@ -1043,7 +1053,7 @@ static int preinit(const char *arg)
scaled_osd = 0;
use_aspect = 1;
use_ycbcr = 0;
- use_yuv = 0;
+ use_yuv = -1;
colorspace = -1;
levelconv = -1;
lscale = 0;
@@ -1138,19 +1148,26 @@ static int preinit(const char *arg)
"\n" );
return -1;
}
- if (use_rectangle == 1)
- gl_target = GL_TEXTURE_RECTANGLE;
- else
- gl_target = GL_TEXTURE_2D;
- yuvconvtype = use_yuv | lscale << YUV_LUM_SCALER_SHIFT | cscale << YUV_CHROM_SCALER_SHIFT;
if (many_fmts)
mp_msg(MSGT_VO, MSGL_INFO, "[gl] using extended formats. "
"Use -vo gl:nomanyfmts if playback fails.\n");
mp_msg(MSGT_VO, MSGL_V, "[gl] Using %d as slice height "
"(0 means image height).\n", slice_height);
- if (!init_mpglcontext(&glctx, gltype)) return -1;
+ if (!init_mpglcontext(&glctx, gltype))
+ goto err_out;
+ if (use_yuv == -1) {
+ if (create_window(320, 200, 0, NULL) < 0)
+ goto err_out;
+ if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED)
+ goto err_out;
+ autodetectGlExtensions();
+ }
return 0;
+
+err_out:
+ uninit();
+ return -1;
}
static const struct {
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 85ba55cc3f..3f10b164ca 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -1059,7 +1059,6 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y,
hint.width = width; hint.height = height;
hint.flags = PPosition | PSize;
XSetStandardProperties(mDisplay, x11->window, title, title, None, NULL, 0, &hint);
- vo_x11_sizehint(vo, x, y, width, height, 0);
if (!vo_border) vo_x11_decoration(vo, 0);
// map window
XMapWindow(mDisplay, x11->window);
diff --git a/loader/qtx/list.c b/loader/qtx/list.c
index 8c1ea6abe2..c4a72c1480 100644
--- a/loader/qtx/list.c
+++ b/loader/qtx/list.c
@@ -1,5 +1,22 @@
-/* to compile:
- edit ../win32.c, change the #if 0 to 1 at line 1326 to enabel quicktime fix!
+/*
+ * To compile edit loader/win32.c and change the #if 0 to 1 at line 1326
+ * to enable quicktime fix!
+ *
+ * This file is part of MPlayer.
+ *
+ * MPlayer is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MPlayer is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with MPlayer; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
diff --git a/loader/qtx/qtxload.c b/loader/qtx/qtxload.c
index 029fad2881..838399ba14 100644
--- a/loader/qtx/qtxload.c
+++ b/loader/qtx/qtxload.c
@@ -1,3 +1,21 @@
+/*
+ * This file is part of MPlayer.
+ *
+ * MPlayer is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MPlayer is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with MPlayer; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/mp3lib/test.c b/mp3lib/test.c
index 8ae1c68d41..446d454008 100644
--- a/mp3lib/test.c
+++ b/mp3lib/test.c
@@ -1,3 +1,20 @@
+/*
+ * This file is part of MPlayer.
+ *
+ * MPlayer is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MPlayer is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with MPlayer; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
#define DUMP_PCM
diff --git a/mp3lib/test2.c b/mp3lib/test2.c
index f9bcfc073f..ccedbecdbd 100644
--- a/mp3lib/test2.c
+++ b/mp3lib/test2.c
@@ -1,3 +1,21 @@
+/*
+ * This file is part of MPlayer.
+ *
+ * MPlayer is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * MPlayer is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with MPlayer; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>