aboutsummaryrefslogtreecommitdiffhomepage
path: root/libvo/gl_common.c
Commit message (Collapse)AuthorAge
* cocoa_common, gl_common: add OSX specific getProcAddressGravatar Stefano Pigozzi2012-04-26
| | | | | | | | Run dlopen on the OpenGL dynamic library instead of on the binary. This should prevent crashes due to function conflicts when X11/lGL is linked. Remove mutual exclusion of the X11 and Cocoa backends.
* vo_corevideo: restructure this video outputGravatar Stefano Pigozzi2012-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restructure this video output to be similar to vo_gl, even if simpler and less feature complete (for example it's still missing EOSD support). Ideally, it should act as a decent fallback in the case where something breaks in the OSX support of vo_gl. Here's a summary of what changed: * Remove the shared buffer code since it wasn't using any function from the CoreVideo API. Moreover, its presence in vo_corevideo was forcing the non-GUI related code to perform more image copies than necessary. Equivalent shared-buffer functionality will be added in a separate new VO in the next commit (this means OSX GUIs will need to specify a different VO). * Clean up the code to conform a bit more to the mplayer2 conventions. Enforce 80 column wrapping, use a private struct for file variables, use the new libvo api. * Add OSD rendering using OpenGL instead of writing directly on the video image data. * Simplify the logic for the rendering function when dealing with panscan. * Add VOCTRL_REDRAW_FRAME support. * Add colormatrix support by using the built-in API provided by CoreVideo.
* vo_gl: cocoa: add support for --ontopGravatar Stefano Pigozzi2012-03-25
| | | | | Make the cocoa backend change the non-fullscreen window level according to the value of the ontop property.
* vo_gl: cocoa: point swapinterval to cocoa_common functionGravatar Stefano Pigozzi2011-12-06
| | | | | | | | Currently there is no way to set the swap interval with a function that has a signature compatible with other platforms' gl extensions. Make a wrapper function around the gui toolkit method of setting the swap interval property, and point gl->SwapInterval to it.
* vo_gl: cocoa: decouple cocoa_common from gl_commonGravatar Stefano Pigozzi2011-12-06
| | | | | | Remove the useless dependency on MPGLContext from cocoa_common, since it was used just to access the vo struct. Change gl_common to pass the vo struct directly to all the cocoa_common functions.
* libvo: remove title argument from struct vo_driver.configGravatar wm42011-12-06
| | | | | | | | | | 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.
* vo_gl: add native mac osx Cocoa backend for vo_glGravatar Stefano Pigozzi2011-11-26
| | | | | | | | | 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.
* vo_gl: fix cscale=4 and cscale=5 doing nothingGravatar wm42011-11-25
| | | | | | | | | | | | | | | | The ARB shader code generated at the end of the shaders for scaling mode 4 and 5 was something like: MAD yuv.g, b.r, {0.5}, a.r; This appears to be semantically equivalent with: MAD yuv.g, b.rrrr, {0.5, 0, 0, 0}, a.rrrr; This has the consequence that the result register, yuv.g, will not contain the value computed by the scale filter, but a.r. a.r is the unchanged value sampled from the normal texture coordinates, so the filter did effectively nothing and behaved as if cscale=0 was specified. The basic mistake here is that yuv.g does not specify a single register, but it specifies the full vector register yuv, with writing enabled on the g channel. This means yuv.g will assigned the g channel of the the result vector computed by the MAD instruction.
* vo_gl: fix 10 bit with Mesa drivers (Intel/Nouveau on Linux)Gravatar wm42011-11-25
| | | | | | | | | | | | | | | | | | 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.
* vo_gl: make shader code generation easier to deal withGravatar wm42011-11-25
| | | | | | | | | The shader code was generated from very long strings with lots of format specifiers with snprintf calls. It was almost impossible to quickly tell what variables were inserted where in the shader. Make this more readable by implementing a kind of simple variable substitution, which allows replacing the format specifiers in the code templates with with variable names.
* vo_gl: implement screenshotsGravatar wm42011-11-25
|
* vo_gl: remove support for nvidia register combiners (yuv=1)Gravatar wm42011-10-24
| | | | | | | | | | | | | 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.
* vo_gl: remove mesa-buffer suboptionGravatar wm42011-10-24
| | | | | | | 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
* vo_gl: move window creation functions from vo_gl.c into gl_common.cGravatar wm42011-10-24
| | | | | | | 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.
* vo_gl/sdl: use desktop resolution for fullscreen modeGravatar wm42011-10-24
| | | | | Before the SDL code would change screen resolution when switching to fullscreen. Try to keep existing desktop resolution instead.
* vo_gl: convert to new API, clean up codeGravatar wm42011-10-24
| | | | | | | 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.
* vo_gl: fix YUY2/YVYU colorspace mixupGravatar reimar2011-07-06
| | | | | | Second GL_YCBCR_MESA format is YVYU, not YUY2. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33694 b3059339-0415-0410-9bf9-f77b7e298cf2
* vo_gl: Request GL_LUMINANCE16 for 16-bit YUV inputGravatar reimar2011-06-29
| | | | | | | 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
* vo_gl: don't accept 9/10-bit formats as inputGravatar reimar2011-06-29
| | | | | | | | | Make mp_get_chroma_shift() simpler/more generic and add an argument to get the per-component bit depth. Use this to check more properly for supported formats in gl and gl2 vos (only 8 and 16 bit are supported, 9 and 10 are not). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33452 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: remove NULL checks before free() all over the codeGravatar cboesch2010-11-14
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32624 b3059339-0415-0410-9bf9-f77b7e298cf2
* vo_gl: Move the read_pnm function into a separate fileGravatar cigaes2010-11-02
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32513 b3059339-0415-0410-9bf9-f77b7e298cf2
* vo_gl: Extract code to read a pnm file into a separate functionGravatar reimar2010-11-02
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32479 b3059339-0415-0410-9bf9-f77b7e298cf2
* vo_gl: Add initial stereo supportGravatar reimar2010-11-02
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31633 b3059339-0415-0410-9bf9-f77b7e298cf2
* vo_gl, csputils: dual-license under LGPL v2.1Gravatar reimar2010-11-02
| | | | | | | | | | | | 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
* Merge svn changes up to r31145Gravatar Uoti Urpala2010-05-30
|\
| * Handle chroma texture size becoming 0, e.g. due to bad rounding.Gravatar reimar2010-05-09
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31143 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r31097Gravatar Uoti Urpala2010-04-26
|\|
* | Merge svn changes up to r31020Gravatar Uoti Urpala2010-04-26
|\ \
* \ \ Merge svn changes up to r31004Gravatar Uoti Urpala2010-04-26
|\ \ \
* \ \ \ Merge svn changes up to r30907Gravatar Uoti Urpala2010-04-26
|\ \ \ \
| | | | * Support for auto-selecting the OpenGL backend.Gravatar reimar2010-04-25
| | | | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31086 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Add reinitialization support. Necessary for fullscreen on OSX.Gravatar reimar2010-04-25
| | | | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31085 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Missing space in error message.Gravatar reimar2010-04-25
| | | | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31083 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Share SDL initialization code.Gravatar reimar2010-04-25
| | | | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31079 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Fullscreen support for -vo gl using SDL.Gravatar reimar2010-04-25
| | | | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31077 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Window resizing support for -vo gl with SDL backend.Gravatar reimar2010-04-25
| | | | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31075 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Add sdl_common file and use it to share the input handling between -vo glGravatar reimar2010-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with SDL backend and -vo sdl. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31074 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Use SDL_GL_ProcAddress to work around conflicts between -lGLGravatar reimar2010-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and -framework OpenGL. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31073 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Update copyright and email address.Gravatar reimar2010-04-25
| | | | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31072 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Clarify that the GL_TEXT_FRAGMENT_SHADER_ATI bug workaround is for OSX,Gravatar reimar2010-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and which versions are known good/known bad. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31071 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Add workaroound for yuv=7 mode - does hurt speed but not muchGravatar reimar2010-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and this code should only be used when it is the only option. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31068 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Try harder to find linked OpenGL functions.Gravatar reimar2010-04-24
| | | | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31066 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * Some crash-resilience fixes.Gravatar reimar2010-04-24
| | | | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31063 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | | * First steps to support -vo gl with SDL-based Window handling.Gravatar reimar2010-04-24
| | | |/ | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31062 b3059339-0415-0410-9bf9-f77b7e298cf2
| | | * Factor out the YUV->RGB conversion auto-selection and alsoGravatar reimar2010-04-04
| | |/ | | | | | | | | | | | | | | | | | | | | | 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
| | * Share more code between the two ATI fragment shader YUV to RGBGravatar reimar2010-04-04
| | | | | | | | | | | | | | | | | | | | | | | | conversion methods and extend them to support more accurate conversion (though at the cost of some speed). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30995 b3059339-0415-0410-9bf9-f77b7e298cf2
| | * Try to detect and work around broken glXGetProcAddress on atGravatar reimar2010-04-03
| | | | | | | | | | | | | | | | | | | | | least PPC OS X 10.4. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30994 b3059339-0415-0410-9bf9-f77b7e298cf2
| | * Implement OpenGL-based YUV to RGB version for Radeon 9200 classGravatar reimar2010-04-03
| | | | | | | | | | | | | | | | | | | | | cards on OS X. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30993 b3059339-0415-0410-9bf9-f77b7e298cf2
| | * Indentation fix.Gravatar reimar2010-04-03
| | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30988 b3059339-0415-0410-9bf9-f77b7e298cf2
| | * Add mpgl prefix to all OpenGL-related function pointers.Gravatar reimar2010-04-03
| |/ | | | | | | | | | | | | | | | | 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