summaryrefslogtreecommitdiffstats
path: root/libvo/vo_opengl.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename directories, move files (step 1 of 2) (does not compile)wm42012-11-121-2419/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code.
* vo_opengl: fix compatibility with OpenGL 2.1wm42012-11-121-0/+8
| | | | | | | | | | | | | | | | | The srgb_compand() function passes bvec to mix(), which is apparently not available on GL 2.1 / GLSL 1.20: 0:0(0): error: no matching function for call to `mix(vec3, vec3, bvec3)' 0:0(0): error: candidates are: float mix(float, float, float) 0:0(0): error: vec2 mix(vec2, vec2, vec2) 0:0(0): error: vec3 mix(vec3, vec3, vec3) 0:0(0): error: vec4 mix(vec4, vec4, vec4) 0:0(0): error: vec2 mix(vec2, vec2, float) 0:0(0): error: vec3 mix(vec3, vec3, float) 0:0(0): error: vec4 mix(vec4, vec4, float) Also add back disabling color management on older GL, as the srgb_compand() function is needed for that.
* vo_opengl: fix srgb for subtitlesnand2012-11-111-1/+4
| | | | | | | | | | | | | | Based on a patch by nand. This is needed, because sRGB mode changes the video over-all gamma. This has to be done for subtitles as well. The final srgb_compand() call in the OSD shader compensates for the fact that in ed8fad729d04 framebuffer use was replaced with doing sRGB conversion manually by srgb_compand(). This only affects subtitles rendered with libass. Nothing is changed for RGB subs. Also change the USE_ flags for OSD shaders to USE_OSD_ to make the difference between video and OSD rendering more apparent.
* vo_opengl: disable extended downscaling by defaultwm42012-11-111-1/+0
| | | | | | | | To simplify implementation, the same filter kernel was used for both directions, even when the scaling factors were different. It turns out that people actually did this, and that the resulting rendering errors were rather visible. Disable this feature by default, as fixing it would require structural changes, and it's a useless anyway.
* vo_opengl: add manual sRGB companding to not artifact when ditheringnand2012-11-111-14/+2
| | | | | | Patch by nand. Modified not to use macros in the GLSL, and also remove the checks for framebuffer presence. (Disabling ICC if no sRGB framebuffer is available was probably a bug.)
* VO: remove code duplication for setting up mp_osd_reswm42012-11-011-41/+29
| | | | | | | | | | | | | | | | vo_opengl, vo_vdpau, vo_direct3d had the code for setting up mp_osd_res duplicated. Make things simpler by making calc_src_dst_rects() setup the full mp_osd_res structure, instead of just "borders". Also, rename that function to vo_get_src_dst_rects(), and make it use mp_rect. Remove vo_rect, which was annoying because it contains redundant members (width/height additional to right/bottom). Add code to print the video rect etc. in verbose mode. There should be no actual change how the video rects are calculated. The only exception are the bottom/right subtitle margins, which are now computed slightly differently, but that shouldn't matter.
* vo_opengl, vo_opengl_old: remove -wid/viewport special casewm42012-11-011-6/+0
| | | | | | | | | For reasons unknown to me, vo_gl had a special case for when the -wid option (slave mode embedding) and -geometry was used. This adjusted the viewport in a way different from normal operation. It's unknown what this was needed for (if it's sane at all), but since no other VOs use this special case, and since we broke slave mode compatibility anyway, remove it.
* screenshot: remove hack for passing anamorphic image sizewm42012-11-011-5/+4
| | | | | | | | | | With anamorphic video (display with non-1:1 PAR, e.g. DVD), the display size was passed using the mp_image fields w/h, which was blatantly incorrect. w/h are the normal image dimensions, while width/height are the "uncropped" storage size (used internally by vf.c). Add a display_w/h, and use that for the display size. Make all VOs that can do screenshots use it.
* screenshot: let VOs pass colorspace information via mp_imagewm42012-11-011-0/+2
| | | | | | | | | This removes the hack that screenshot_save() got the colorspace information from the decoder. Instead, require the VOs to set the colorspace information on the mp_images used to pass around the screenshot data. This is more correct, as the image may have been converted/modified in the video filter chain, although there's nothing yet in the video filter chain which does this correctly.
* Merge branch 'master' into osd_changeswm42012-10-241-1/+11
|\ | | | | | | | | Conflicts: libvo/vo_xv.c
| * vo_opengl: fix help output typowm42012-10-231-1/+1
| |
| * cocoa_common: use IOKit to perform power managementStefano Pigozzi2012-10-161-0/+10
| | | | | | | | | | | | 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.
* | vo_corevideo: add screenshot capabilityStefano Pigozzi2012-10-241-18/+1
| | | | | | | | | | | | | | | | | | 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.
* | VO, sub: refactorwm42012-10-241-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove VFCTRL_DRAW_OSD, VFCAP_EOSD_FILTER, VFCAP_EOSD_RGBA, VFCAP_EOSD, VOCTRL_DRAW_EOSD, VOCTRL_GET_EOSD_RES, VOCTRL_QUERY_EOSD_FORMAT. Remove draw_osd_with_eosd(), which rendered the OSD by calling VOCTRL_DRAW_EOSD. Change VOs to call osd_draw() directly, which takes a callback as argument. (This basically works like the old OSD API, except multiple OSD bitmap formats are supported and caching is possible.) Remove all mentions of "eosd". It's simply "osd" now. Make OSD size per-OSD-object, as they can be different when using vf_sub. Include display_par/video_par in resolution change detection. Fix the issue with margin borders in vo_corevideo.
* | Remove things related to old OSDwm42012-10-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To ease changing all the VOs to the new OSD rendering, fallbacks, conversions, support code etc. was left all over the code. Now that all VOs have been changed, all that code is inactive. Remove it. Strip down spudec.c. We don't need the old grayscale and scaling stuff anymore. (Not removing spudec itself yet - I'm not confident that the libavcodec DVD sub decoder is sufficient, and it would also require some hacks to get DVD palette and resolution information from libdvdread to libavcodec.) The option --spuaa, --spualign, --spugauss were used with the old sub scaling code, and don't do anything anymore.
* | Merge branch 'master' into osd_changeswm42012-10-161-235/+84
|/ | | | | | | | | | | | | | 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
* manpage: improvements to vo_opengl documentationwm42012-10-151-7/+7
| | | | | | | | Mention the FBO format chaos. Some other things were not entirely correct anymore. Also update the "builtin" documentation in vo_opengl.c.
* vo_opengl: fix filter reinitializationwm42012-10-141-4/+4
| | | | | | | The second scaling filter (cscale) was never reset correctly due to a fatal oversight. In particular, this could lead to OpenGL errors, if the new filter needs a 2D texture, but the old texture was 1D (because init_scaler reuses the texture).
* Rename to "mpv"wm42012-10-121-3/+3
| | | | | | | | | | | | | | | | | | This changes the name of this project to mpv. Most user-visible mentions of "MPlayer" and "mplayer" are changed to "mpv". The binary name and the default config file location are changed as well. The new default config file location is: ~/.mpv/ Remove etc/mplayer.desktop. Apparently this was for the MPlayer GUI, which has been removed from mplayer2 ages ago. We don't have a logo, and the MS Windows resource files sort-of require one, so leave etc/mplayer.ico/.xpm as-is. Remove the debian and rpm packaging scripts. These contained outdated dependencies and likely were more harmful than useful. (Patches which add working and well-tested packaging are welcome.)
* vo_opengl: don't try to map an empty bufferwm42012-10-031-1/+1
| | | | | | | | The change detection signalled a full re-upload on initialization, but no texture reallocation. Binding the uninitialized buffer caused an OpenGL error. Fixes error messages on start with "opengl-hq".
* vo_opengl: change default FBO formatwm42012-10-031-1/+1
| | | | | | | | | GL_RGB16 doesn't seem to work universally (e.g. Intel). Use GL_RGB by default, and use GL_RGB16 for "opengl-hq" only. This may require users of Intel GPUs to manually experiment with the fbo-format suboption when using "opengl-hq", as GL_RGB16 doesn't seem to work there in some cases (black screen).
* vo_opengl: use PBOs by default with opengl-hqwm42012-10-031-1/+1
| | | | | | | | | | It's not really known whether PBO use causes problems of any kind (most likely not). They should slightly increase performance. Use them by default with "opengl-hq". Even though PBOs don't have anything to do with rendering quality, "opengl-hq" provides a test bed for features that should be enabled by default, but aren't out of fear for regressions.
* vo_opengl: use low quality default settings, add opengl-hq aliaswm42012-10-031-6/+26
| | | | | | | | Change the default settings for vo_opengl to highest performance and compatibility, but lowest quality. Use bilinear as default scaler. Add "opengl-hq" as alias for high quality settings. This alias uses exactly the same settings as vo_opengl did before this commit.
* VO: add mechanism to replace old VO names, use it with "gl" and "gl3"wm42012-10-031-19/+0
| | | | | Rather than duplicating the VO driver structs to add aliases, replace them textually when searching for the VO on initialization.
* vo_opengl: always check GL errors in first 5 frameswm42012-10-031-1/+5
| | | | | | | | | | | | Normally, we don't want to call glGetError() all the time, because this supposedly causes slowdowns. (I could not measure any on Linux with nVidia binary drivers; maybe it's due to the fact that we have only a few, expensive calls per frame.) However, having to ask users to add the "debug" suboption when trying to diagnose problems is very annoying. Since most errors happen during initialization only, enabling it for the first 5 frames only is an interesting compromise.
* VO: actually rename VOs gl -> opengl-old, gl3 -> openglwm42012-10-031-5/+24
| | | | | | | | | | | | | This renames vo_gl3 to vo_opengl, and makes it the default. The old vo_gl is still available under "opengl-old". We keep "gl3" as alias to "opengl" for short-term compatibility. For OSX/Cocoa, the autoprobe order changes (prefer the "opengl" over "opengl-old"). Remove "gl_nosw". This was a compatibility alias for "opengl-old", and there's no point in keeping it.
* VO: rename file: vo_gl3_shaders.glsl -> vo_opengl_shaders.glslwm42012-10-031-2/+2
|
* VO: rename file: vo_gl3.c -> vo_opengl.cwm42012-10-031-0/+2573