Commit Graph

117 Commits

Author SHA1 Message Date
wm4 4b883505f6 gl_common: remove unused glValName()
Using helper programs like apitrace is better for debugging.
2012-03-31 02:58:53 +02:00
wm4 8793a4c77b gl_common: move header hacks into gl_header_fixes.h
Keep this horrible (but unfortunately necessary) kludge out of the main
code.
2012-03-31 02:58:53 +02:00
wm4 98052873da libvo: add vo_gl3
This new vo is heavily based on vo_gl.c. It provides better scale
filters, dithering, and optional color management with LittleCMS2.
It requires OpenGL 3.

Many features are enabled by default, so it will be slower than vo_gl.
However, it can be tuned to behave almost as vo_gl.
2012-03-31 02:58:52 +02:00
wm4 35c29bdd52 gl_common: slightly change win32 GL 3 context creation
The code used OpenGL 3 specific functions for querying the extension
string when the actual GL 3 context wasn't created yet. This appears to
work fine on nVidia, but could break otherwise. Remove the offending
getFunctions call and retrieve the needed function pointer manually.
(This way the wglCreateContextAttribsARB function pointer can be removed
from struct GL too.)

(Amusingly exposes a wine bug; they made the same mistake.)

Explicitly check the extension string whether the function is available,
although this probably doesn't matter in practice.

Also retrieve bit depth information on win32.
2012-03-31 02:58:52 +02:00
Kovensky 59125ce71e gl_common: OpenGL 3.x context support on windows
Also include GL/glext.h on windows:

Mingw's (and cygwin's) GL/gl.h has GL/glext.h's inclusion commented
out for some reason. Their glext.h is also ancient, so do yourself
a favor and replace your GL/glext.h with the one from
http://www.opengl.org/registry/api/glext.h .

A workaround is needed for NVidia's broken wglCreateContextAtrribsARB:

It'll return an error if the requested OpenGL version is previous to
3.2 *and* you request a profile... which is exactly *not* what the
wgl_create_context spec says should happen.

Handle it by removing the profile request from attribs[] and retrying
the context creation once more if the first try fails.

And after my first foray into OpenGL I already find a driver quirk.
Oh well.
2012-03-31 02:58:52 +02:00
wm4 666915a6f0 gl_common: add OpenGL 3.x context creation
Also add a bunch of GL functions to the function loader, which will be
needed by vo_gl3. Remove some unused legacy GL functions from the
loader.

Use the proper name for glGetProgramivARB. glGetProgramiv is a different
and incompatible function. The ARB variant is used for ARB shaders,
while the proper one is for GLSL.
2012-03-31 02:58:52 +02:00
wm4 4352f9feca vo_gl: add "backend" suboption to allow selecting the GUI backend
The "backend" suboption allows selecting the GUI backend used by vo_gl.
Normally, it's auto-selected, but sometimes it's desireable to explicitly
select it.

Remove the gl_sdl VO. This can now be done by using: --vo=gl:backend=sdl

This is based on svn commit 34438, and tries to be compatible with it. The
undocumented numeric backend names serve this purpose. (They are
undocumented because names are preferred.)
2012-02-09 04:58:41 +01:00
reimar 93ae55c2c3 vo_gl: minor cleanups
Fix spelling.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34006 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix disabled code.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34007 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove pointless pointer indirection for shader program strings.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34016 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove usage of glColor3f, there is not really a point in it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34149 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-02-09 04:58:27 +01:00
reimar 8767c060cf vo_gl: add noise filter
Add disabled feature: noise filter for vo_gl.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34014 b3059339-0415-0410-9bf9-f77b7e298cf2

Hook up -vo gl noise support.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34015 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-02-09 04:58:07 +01:00
wm4 adc85b0031 vo_gl: use generic eosd code
This is an experiment.

The change probably doesn't matter much.

One issue with the old code was that "large" images caused each sub-image
to be created and rendered as a new texture. "Large" in this case means
larger than 32x32 pixels, which actually isn't very large with screen
sizes beyond 1500x1000 pixels. This means rendering a simple subtitle for
a fullscreened video may allocate many small textures, one for each glyph.
On the other hand, the old code could be fixed by tuning the texture sizes
for "modern" work loads.

Also, the new code uses less deprecated OpenGL features and draws all
sub-images in one batch.

There are two possible issues the new code could cause:
- Drivers could have performance issues with the larger texture sizes and
  the number of glTexSubImage2D calls on it
- There is only one EOSD texture, which could become full (it's enlarged
  on demand, but restricted by driver texture size limitations)

It has been reported that this is faster on OSX with ATI GPUs than the old
code.
2011-12-25 20:42:58 +01:00
wm4 d4de92e808 libvo: remove title argument from struct vo_driver.config
This affects only the "new" VO API. The config() title argument was barely
used, and it's hardcoded to "MPlayer" in vf_vo.c. The X11 and the Cocoa
GUI backends, which are the only ones properly supporting window titles,
ignored this argument. Remove the title argument.

Add the vo_get_window_title function. All GUI VOs are supposed to use it
for the window title.
2011-12-06 20:32:33 +01:00
Stefano Pigozzi 421c840b3c vo_gl: add native mac osx Cocoa backend for vo_gl
Add native Cocoa code to display an OpenGL window. Some of the code is
based on the OpenGL parts of vo_corevideo but I took the time to remove
old code based on Carbon.

There is autodetection in the configure script but you can use
--enable[disable]-cocoa to enable[disable] this.
2011-11-26 20:04:16 +02:00
wm4 046692d90b vo_gl: fix 10 bit with Mesa drivers (Intel/Nouveau on Linux)
The GL_LUMINANCE16 texture format had only 8 bit precision on Mesa
based drivers. This caused heavy degradation of the image when playing
formats with more than 8 bits per pixel, such as 10 bit h264. Use
GL_R16 instead, which at least Mesa and Nvidia drivers actually
implement as 16 bit textures. Since sampling from this texture format
doesn't return anything meaningful in the other color components
(unlike luminance textures), the shader code has to be slightly
changed.

GL_R16 requires the GL_ARB_texture_rg extension. Check for it, and fall
back to the old texture format if it's not available.

The low precision of the GL_LUMINANCE16 format has just been fixed in
upstream Mesa, but it'll take a while before that fix is available in
distros.
2011-11-25 23:59:49 +02:00
wm4 28eaf11cf3 vo_gl: implement screenshots 2011-11-25 23:56:28 +02:00
wm4 2123bff6fa vo_gl: remove support for nvidia register combiners (yuv=1)
The register combiner color conversion is broken and seems to use a
slightly incorrect color matrix (the image looks gray-ish). Completely
remove all code related to nVidia register combiners.

Unless you have an ancient nVidia GPU, there's no reason to prefer register
combiners over fragment shaders. Users with ancient GPUs without fragment
shader support can just use -vo xv.

Passing yuv=1 (register combiners) as sub option will print a warning and
use yuv=2 (fragment shaders) instead.
2011-10-24 08:36:17 +03:00
wm4 64f44ad316 vo_gl: remove mesa-buffer suboption
This option enabled using Mesa specific functions, which have never been
widely supported, and were removed from Mesa in 2010.

http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb2a66fd0c095fe03be5aaf88c8d48f5867425d3
2011-10-24 07:31:09 +03:00
wm4 3eeca4838d vo_gl: move window creation functions from vo_gl.c into gl_common.c
Now all windowing specific code is in gl_common.c.

init_mpglcontext() used to set dummy callbacks for non-optional windowing
callbacks. Remove these, as they only lead to confusion.
2011-10-24 07:19:29 +03:00
wm4 c852246cdf vo_gl: convert to new API, clean up code
Reformat vo_gl.c, gl_common.c, gl_common.h.
Remove all global variables and move them into a context struct (the
Windows and SDL backends still refer to global_vo though).
Change vo_gl.c to use the "new" VO API.
2011-10-24 06:13:17 +03:00
reimar 48fdd3d926 vo_gl: Support 9- and 10-bit YUV input for OpenGL VOs
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33502 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix clear/border color of chroma texture for 9- and 10-bit formats.
Avoids pink borders for those formats.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33504 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 07:31:54 +03:00
reimar 2c7488fe91 vo_gl: Request GL_LUMINANCE16 for 16-bit YUV input
Request GL_LUMINANCE16 as internal format for > 8 bit YUV formats.
Have yet to find a system that actually provides that though.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33453 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-06-29 10:49:52 +03:00
reimar 93336619b2 vo_gl: add helper macros to build the yuv conversion type number
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31742 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:44 +02:00
reimar 7de77cdb11 gl_common.h: Add () around macro arguments.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31741 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:44 +02:00
reimar ccb6675fbd vo_gl: Add initial stereo support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31633 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:20 +02:00
reimar be6a58d455 vo_gl, csputils: dual-license under LGPL v2.1
Dual-license gl_common and vo_gl under the LGPL v2.1 or later as
an alternative to the GPL license.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31375 b3059339-0415-0410-9bf9-f77b7e298cf2

Allow LGPL for csputils as well, they were previously part of gl_common
and are still an important part of it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31376 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:07:42 +02:00
Uoti Urpala eee666c3b5 Merge svn changes up to r31133 2010-05-07 21:19:53 +03:00
reimar 9d3c096045 Avoid duplicating the GL/gl.h include.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31107 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-04-30 19:03:13 +00:00
Uoti Urpala f38efd166e Merge svn changes up to r31097 2010-04-26 19:23:32 +03:00
Uoti Urpala 7795726e0f Merge svn changes up to r31033 2010-04-26 18:25:34 +03:00
Uoti Urpala 837c48ddee Merge svn changes up to r31020 2010-04-26 18:06:00 +03:00
Uoti Urpala e913d6c5da Merge svn changes up to r31004 2010-04-26 17:55:05 +03:00
reimar a9ff7793e3 Support for auto-selecting the OpenGL backend.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31086 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-04-25 10:53:01 +00:00
reimar e9ef1cbda0 Missing gl.h include for SDL backend.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31070 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-04-24 22:35:39 +00:00
reimar 6e4458ffa3 First steps to support -vo gl with SDL-based Window handling.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31062 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-04-24 16:46:47 +00:00
reimar 8305385bb7 Add some fallback OpenGL defines to fix compilation on Windows.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31027 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-04-07 19:36:23 +00:00
reimar b8a7ed8a79 Factor out the YUV->RGB conversion auto-selection and also
enable auto-selection of ATI fragment shaders since they
should do accurate conversions now.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31006 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-04-04 16:56:30 +00:00
reimar 269b96d75e Implement OpenGL-based YUV to RGB version for Radeon 9200 class
cards on OS X.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30993 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-04-03 19:58:06 +00:00
reimar 2cebf8eeb7 Add mpgl prefix to all OpenGL-related function pointers.
This is necessary because at least the GetString symbol
causes clashes on PPC OSX 10.4, causing -vo gl to always
crash.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30987 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-04-03 07:08:07 +00:00
Uoti Urpala b390b9b28f Merge svn changes up to r30185 2010-01-08 01:36:05 +02:00
Uoti Urpala 231b33a02f Merge svn changes up to r30165 2010-01-08 01:05:30 +02:00
reimar f06aa83a83 Add pointers to a few more standard OpenGL functions to ease future extensions.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30179 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-03 12:55:09 +00:00
reimar 0ecf324ac5 Extract functions to generate yuv->rgb matrices and lookup tables into a
separate file.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30150 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-12-31 18:25:35 +00:00
reimar c4c806a9d7 Put the colourspace-related variables into a separate struct to ease
extracting the code and sharing with other vos.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30149 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-12-31 18:07:37 +00:00
reimar 8e35068138 Support all planar YUV formats in OpenGL vos.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30139 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-12-30 11:32:24 +00:00
Uoti Urpala dc7f183022 Merge svn changes up to r30104
Ignore the broken correct-pts change in r30100.
2009-12-30 00:14:20 +02:00
Uoti Urpala 67b40bd219 Merge svn changes up to r30065 2009-12-29 23:57:14 +02:00
reimar 763402d423 Define GL_GENERATE_MIPMAP ourselves if necessary.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30074 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-12-19 21:07:42 +00:00
reimar f97fd3eff0 Rename GL_* defines to CONFIG_GL_*
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30065 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-12-19 13:49:44 +00:00
reimar 140de2a9e2 Make the check for X11 and WIN32 backends for OpenGL separate.
This fixes compilation on Windows with X11 but no GLX available.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30063 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-12-19 10:52:32 +00:00
Uoti Urpala efcc9ad712 Merge svn changes up to r30055 2009-12-18 18:54:42 +02:00
reimar c13aaf85d1 Prefer GLAPIENTRY over APIENTRY, it is the better name and used more by OpenGL headers.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29983 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-12-09 17:36:55 +00:00