summaryrefslogtreecommitdiffstats
path: root/libvo/gl_common.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'osd_changes' into masterwm42012-11-011-1/+46
|\ | | | | | | | | Conflicts: DOCS/man/en/options.rst
| * Merge branch 'master' into osd_changeswm42012-10-241-22/+9
| |\ | | | | | | | | | | | | Conflicts: libvo/vo_xv.c
| * | vo_corevideo: add screenshot capabilityStefano Pigozzi2012-10-241-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Added screenshot capability to the corevideo VO by sending back the raw data from the CVPixelBuffer. Also added "screenshot window" functionality from the other OpenGL based VOs, which uses glReadPixels to read image data back. This was moved to gl_common to avoid duplication.
| * | Merge branch 'master' into osd_changeswm42012-10-161-518/+686
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile command.c libvo/gl_common.c libvo/vo_corevideo.m libvo/vo_opengl.c libvo/vo_opengl_old.c libvo/vo_opengl_shaders.glsl sub/ass_mp.c sub/osd_libass.c sub/sd_ass.c
| * | | vo_gl3: move OSD code to gl_osd.cwm42012-10-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Other OpenGL-using VOs can use this. gl_osd.c includes some code for vo_gl.c. The next commit actually makes use of it.
| * | | vo_gl, options: remove doublebuffering option (--double)wm42012-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Useless. It complicated the code and caused flicker, and was useless otherwise. The manpage describes this option as "should not normally be used". One possibly useful effect from the point of view of the user was that vsync was disabled. You can do this with the --vsync option, or by changing X/driver settings directly.
| * | | vo_gl3: support RGBA EOSDwm42012-10-161-0/+26
| | | | | | | | | | | | | | | | | | | | This also adds support for multiple EOSD renderers. This capability is unused yet, but important for the following commits.
* | | | gl_common: add dummy initializationwm42012-11-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The uninitialized values are passed through some functions, but will be eventually unused. Initialize them anyway to avoid potential undefined behavior and for clarity.
* | | | gl_common: make glFmt2bpp() abort on unknown formatswm42012-11-011-1/+1
| |_|/ |/| | | | | | | | | | | | | | None of its callers actually checked the return value, and it's a given that they call it only if it can't fail. Replace the non-sense return value (0) by a call to abort().
* | | gl_common: remove useless cocoa wrapper functionsStefano Pigozzi2012-10-161-18/+3
| | |
* | | cocoa_common: use IOKit to perform power managementStefano Pigozzi2012-10-161-0/+2
| | | | | | | | | | | | | | | | | | This allows to remove the call to the deprecated `UpdateSystemActivity`. The additional benefit is power management is disabled only if the video is really playing. A paused video will not stop the system from idling.
* | | cocoa_common: save state in the vo structStefano Pigozzi2012-10-161-4/+4
| |/ |/| | | | | | | Save the cocoa state in an instance variable for the Objective-C part of the code and use a field in the vo struct for the raw C part of the code.
* | gl_common: require GLX 1.3 for vo_gl, remove old pre-1.3 codewm42012-10-031-123/+91
| | | | | | | | | | | | Now both GL3 (for vo_gl3) and legacy context context creation (for vo_gl) use the same code to create the X window. Only actual GL context creation is different.
* | vo_gl3: make it work on OpenGL 2.1wm42012-10-031-463/+665
|/ | | | | | | | | | | | | | | | | | | | Now vo_gl3 should work with standard OpenGL 2.1, as long as the GL_ARB_texture_rg extension is available. Optional features, which require features that are always in OpenGL 3.0, but are available as extensions only in OpenGL 2.1, are automatically disabled. The force-gl2 suboption, which was an unreliable hack to run vo_gl3 in an OpenGL 2.1 context, is removed. Significant changes are done to the extension loader to make it easier to identify optional OpenGL features. Context creation is a bit changed to simplify the code and to handle the fallback better if OpenGL 3 context creation fails, and creating an OpenGL legacy context is attempted. Based on the initial work by Rudolf Polzer <divverent@xonotic.org>, which included making the shader GLSL 1.20 compatible, and more.
* VO: remove old VO gluewm42012-08-071-1/+0
| | | | | | | This transition to a new VO API started over 4 years ago. It's time to finally end it, and get rid of the horrible hacks. Also removes some previously undetected dead code from spudec.c.
* libvo, libao: remove useless video and audio output driverswm42012-07-281-75/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of these have only limited use, and some of these have no use at all. Remove them. They make maintainance harder and nobody needs them. It's possible that many of the removed drivers were very useful a dozen of years ago, but now it's 2012. Note that some of these could be added back, in case they were more useful than I thought. But right now, they are just a burden. Reason for removal for each module: vo_3dfx, vo_dfbmga, vo_dxr3, vo_ivtv, vo_mga, vo_s3fb, vo_tdfxfb, vo_xmga, vo_tdfx_vid: All of these are for very specific and outdated hardware. Some of them require non-standard kernel drivers or do direct HW access. vo_dga: the most crappy and ancient way to get fast output on X. vo_aa: there's vo_caca for the same purpose. vo_ggi: this never lived, and is entirely useless. vo_mpegpes: for DVB cards, I can't test this and it's crappy. vo_fbdev, vo_fbdev2: there's vo_directfb2 vo_bl: what is this even? But it's neither important, nor alive. vo_svga, vo_vesa: you want to use this? You can't be serious. vo_wii: I can't test this, and who the hell uses this? vo_xvr100: some Sun thing. vo_xover: only useful in connection with xvr100. ao_nas: still alive, but I doubt it has any meaning today. ao_sun: Sun. ao_win32: use ao_dsound or ao_portaudio instead. ao_ivtv: removed along vo_ivtv. Also get rid of anything SDL related. SDL 1.x is total crap for video output, and will be replaced with SDL 2.x soon (perhaps), so if you want to use SDL, write output drivers for SDL 2.x. Additionally, I accidentally damaged Sun support, which made me completely remove Sun/Solaris support. Nobody cares about this anyway. Some left overs from previous commits removing modules were cleaned up.
* cocoa: gl3: support querying of colors bit depthStefano Pigozzi2012-05-151-0/+3
| | | | | Add support for querying the bit depth of the colors from the OpenGL context. This allows to perform dithering correctly.
* Merge remote-tracking branch 'origin/master'wm42012-04-291-2/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h libvo/cocoa_common.m libvo/gl_common.c libvo/video_out.c mplayer.c screenshot.c sub/subassconvert.c Merge of cocoa_common.m done by pigoz. Picking my version of screenshot.c. The fix in commit aadf1002f8a will be redone in a follow-up commit, as the original commit causes too many conflicts with the work done locally in this branch, and other work in progress.
| * cocoa_common, gl_common: add OSX specific getProcAddressStefano Pigozzi2012-04-261-1/+1
| | | | | | | | | | | | | | | | 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 outputStefano Pigozzi2012-04-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | gl_common: do not call glXGetClientString() and glXGetServerString()wm42012-04-161-34/+12
| | | | | | | | | | | | | | | | | | | | Only call glXGetClientString(), which contains all supported GLX extensions. Extensions only returned by glXGetClientString() or glXGetServerString() are not necessarily actually supported. This essentially reverts svn commit 29721 (git fe3b9a88ce62ab). It is not known whether this commit actually fixed anything, such as working around a broken OpenGL driver.
* | win32: move global variables into a struct & some refactoringwm42012-04-141-27/+16
| | | | | | | | | | | | | | | | | | | | This reflects the changes done to x11_common in mplayer2 some years ago. It makes it possible to open multiple VOs at once. The removed defines are probably for ancient versions of MinGW with incomplete headers. Remove some minor code duplication.
* | Merge remote-tracking branch 'origin/master'wm42012-04-011-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h etc/input.conf input/input.c input/input.h libao2/ao_pulse.c libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c libvo/gl_common.c libvo/x11_common.c mixer.c mixer.h mplayer.c
| * vo_gl: cocoa: add support for --ontopStefano Pigozzi2012-03-251-0/+1
| | | | | | | | | | Make the cocoa backend change the non-fullscreen window level according to the value of the ontop property.
* | gl_common: minor cleanup/refactorwm42012-03-311-36/+42
| | | | | | | | | | | | | | | | | | Remove all platform/GUI specific includes from gl_common.h. Get rid of the ugly union in MPGLContext. Use function pointers instead of an ifdef ridden switch statement in uninit_mpglcontext(). Always include glext.h, not only on Windows. None of this should actually change any functionality.
* | gl_common: remove unused glValName()wm42012-03-311-56/+0
| | | | | | | | Using helper programs like apitrace is better for debugging.
* | libvo: add vo_gl3wm42012-03-311-0/+16
| | | | | | | | | | | | | | | | | | 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.
* | gl_common: cocoa: add OpenGL 3.2 context creation codeStefano Pigozzi2012-03-311-1/+12
| | | | | | | | | | Add a new option to the cocoa window creation code in order to decide which OpenGL context to create.
* | gl_common: slightly change win32 GL 3 context creationwm42012-03-311-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | gl_common: OpenGL 3.x context support on windowsKovensky2012-03-311-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | gl_common: add OpenGL 3.x context creationwm42012-03-311-96/+341
| | | | | | | | | | | | | | | | | | | | 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.
* | vo_gl: add "backend" suboption to allow selecting the GUI backendwm42012-02-091-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | 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.)
* | vo_gl: minor cleanupsreimar2012-02-091-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | vo_gl: add noise filterreimar2012-02-091-12/+74
| | | | | | | | | | | | | | | | | | | | 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
* | vo_gl: use generic eosd codewm42011-12-251-0/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* vo_gl: cocoa: point swapinterval to cocoa_common functionStefano Pigozzi2011-12-061-0/+2
| | | | | | | | 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_commonStefano Pigozzi2011-12-061-2/+6
| | | | | | 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.configwm42011-12-061-11/+7
| | | | | | | | | | 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_glStefano Pigozzi2011-11-261-0/+61
| | | | | | | | |