summaryrefslogtreecommitdiffstats
path: root/libvo
Commit message (Collapse)AuthorAgeFilesLines
* spudec: use csputils for color conversionwm42012-10-242-0/+22
| | | | | | | | | | | | | | | | Just to get rid of that conversion copy&pasted from the internet. R and G are swapped for unknown reasons. Testing various subtitles seem to yield the same results as VLC. The sub-bitmap renderers output the correct colors. The colorspace conversion is used without problems for vo_gl, vo_gl3 and vo_vdpau. The problem is most likely that apparently, the DVD palette read from the subtitle track extradata is converted to YUV using vobsub_palette_to_yuv(), and swapped in the process. Or in other words, the YUV colors spu->global_palette are encoded with R and G swapped. Add some utility definition to csputils.c/h to make converting single color values easier.
* Remove things related to old OSDwm42012-10-249-647/+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.
* vo_x11: use new OSD APIwm42012-10-241-60/+26
|
* vo_xv: simplify screenshot codewm42012-10-241-35/+5
| | | | | | We now have a simple function to get a XvImage buffer as mp_image. Return that as screenshot. We don't even need to copy the image (we allocate a mp_image struct only, no image data).
* vo_xv: use new OSD APIwm42012-10-241-101/+38
| | | | | | | | | | | | | Aspect ratio stuff needs to be fixed later. "Fixing" the position of OSD elements outside of the screen due to panscan needs to be added back as well (what the removed fixup_osd_position() function did). The amount of data needed to "backup" an image when OSD is rendered increases. This is because we support color OSD/subtitles now. The old code rendered into the Y plane only, while the new code touches all 3 planes. For YV12, which is probably the only format supported not considering chroma-swapped and packed formats, 0.5 times more memory is copied when the OSD is used in pause mode.
* vo_lavc: use new OSD APIRudolf Polzer2012-10-241-83/+50
| | | | Merged by wm4 from commits c93978f17b76 and following.
* csputils: cosmetic changeswm42012-10-241-15/+5
|
* sub: add helper to draw sub-bitmaps into an imageRudolf Polzer2012-10-242-0/+64
| | | | | Merged by wm4 from commits 93978f17b76d..13211ef5fc20. Changed copyright header in draw_bmp.c to "mpv", and removed the one in draw_bmp.h.
* libmpcodecs: move vf_scale.c swscale helper functions to sws_utils.cRudolf Polzer2012-10-241-2/+1
| | | | | Extracted/rebased by wm4 from commits 93978f17b76d..13211ef5fc20. Actual mp_image_swscale is added in a later commit.
* Merge branch 'master' into osd_changeswm42012-10-1614-844/+1146
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * input: track location info for input commandswm42012-10-141-1/+1
| | | | | | | | | | | | If parsing a command fails, its location is printed. The location is the path to the input.conf, and the line number of the key binding and the associated input command.
| * 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).
| * Merge branch 'input_changes' into masterwm42012-10-121-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: DOCS/man/en/vo.rst etc/input.conf input/input.c m_property.c
| | * input: verify input.conf on loadingwm42012-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When input.conf is loaded, verify each command and print a warning if it's invalid or uses legacy commands. This is done for both the user's and the embedded config files. The diff is a bit noisy, because mp_input_parse_cmd() is changed to take a bstr as argument instead of a char*.
| * | Rename to "mpv"wm42012-10-126-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
| * | gl_common: allow compilation on Mac OS 10.6Stefano Pigozzi2012-10-072-1/+18
| | | | | | | | | | | | | | | Define just enough constants to allow compilation on OS X Snow Leopard. mpv's OpenGL autodetection features should make the rest.
| * | 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-032-7/+31
| | | | | | | | | | | | | | | | | | | | | | | | 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-032-37/+24
| | | | | | | | | | | | | | | 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-033-39/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-032-2/+2
| | |
| * | VO: rename file: vo_gl3.c -> vo_opengl.cwm42012-10-031-0/+0
| | |
| * | VO: rename file: vo_gl.c -> vo_opengl_old.cwm42012-10-031-0/+0
| | |
| * | 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-037-642/+956
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | encode: fix -ocopyts with certain DVD imagesRudolf Polzer2012-09-291-56/+50
| |/ | | | | | | | | | | When timestamps jump by more than 30 seconds, assume an unexpected discontinuity. Fixes encoding aborts (i.e. no more frames written) at DVD cell switches.
* | sub: switch to premultiplied alphawm42012-10-163-2/+14
| | | | | | | | | | | | | | | | | | | | Fixes problems with ugly borders. Note that at least in the DVD sub case, we could have just set all transparent pixels to black to solve this. vo_direct3d.c change untested, because mingw is a miserable pile of crap.
* | sub: never decode subs to old OSD formatwm42012-10-163-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, sd_lavc.c and spudec.c (the two image sub decoders) always output indexed/paletted images. For this purpose, add SUBBITMAP_INDEXED, and convert the subs to RGBA in img_convert.c instead. If a VO is used that supports the old OSD format only, the indexed bitmaps are converted to the old OSD format by abusing spudec.c in a similar way sd_lavc.c used to do. The main reason why spudec.c is used is because the images must not only be converted to the old format, but also properly scaled, cropped, and aligned (the asm code in libvo/osd.c requires this alignment). Remove support for the old format (packed variant) from the OpenGL VOs. (The packed formats were how the actual OSD format was handled in some GPU-driven VOs for a while.) Remove all conversions from old to new formats. Now all subtitle decoders and OSD renderers produce the new formats only. Add an evil hack to convert the new format (scaled+indexed bitmaps) to the old format. It creates a new spudec instance to convert images to grayscale and to scale them. This is temporary for VOs which don't support new OSD formats yet (vo_xv, vo_x11, vo_lavc).
* | sub: cosmetics: move things aroundwm42012-10-165-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move sub-bitmap definitions from dec_sub.h to sub.h. While it's a bit odd that OSD data structures are in a file named sub.h, it's definitely way too strange to have them in a file about subtitle decoding. (Maybe sub.h/.c and the sub/ directory should be split out and renamed "osd" at a later point.) Remove including ass_mp.h (and the libass headers) where possible. Remove typedefs for mp_eosd_res and sub_bitmaps structs. Store a mp_eosd_res struct in osd_state instead of just w/h. Note that sbtitles might be rendered using different sizes/margins when filters are involved (the subtitle renderer is not supposed to use the OSD res directly, and the "dim" member removed in the previous commit is something different).
* | sub, VO: remove vo_osd_resized() functionwm42012-10-165-7/+1
| | | | | | | | | | | | | | | | | | | | | | VOs which could render the OSD in window size (as opposed to video size, like vo_xv) and which could cache the OSD called this when the window size changed. This was needed, because VOs used another OSD function to check whether the OSD changed before passing the new window size to the OSD code. This was really just an artifact of OSD change detection, and now that the affected VOs use the new OSD rendering API, it's done automatically.
* | libvo: remove eosd_packer.cwm42012-10-162-329/+0
| | | | | | | | | | | | | | | | This contains about the same code as bitmap_packer.c. eosd_packer.c was added first, and then not merged for a year - then it was added as bitmap_packer.c with slightly different and incompatible interface. Now replacing eosd_packer.c with bitmap_packer.c is finally done. So much wasted work...
* | vo_direct3d: use new OSD APIwm42012-10-161-287/+145
| |
* | vo_corevideo: add EOSDwm42012-10-161-101/+22
| | | | | | | | Completely untested.
* | vo_gl: use gl_osd.cwm42012-10-163-295/+27
| | | | | | | | | | | | | | | | Side effect: no direct support for old OSD format anymore. Instead, sub.c converts sub-images in that format to the packed, alpha-inverted version. osd-color suboption is broken.
* | vo_gl3: move OSD code to gl_osd.cwm42012-10-166-200/+448
| | | | | | | | | | | | | | 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.
* | sub: remove logic for disabling hinting on scaled EOSDwm42012-10-164-4/+4
| | | | | | | | | | | | | | | | | | | | | | This was an extremely obscure setting, as it was used only with vo_gl if its scaled-osd suboption was used. If you really want this, you can set the desired ass-hinting value directly, and there will be literally no loss in functionality. Note that this didn't actually test whether the EOSD was scaled. Basically, it only checked whether vo_gl had the scaled-osd suboption set.
* | vo_gl, options: remove doublebuffering option (--double)wm42012-10-164-26/+11
| | | | | | | | | | | | | | | | | | | | 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.
* | sub, vo_gl3, vo_vdpau: exit early if there are no sub-images to drawwm42012-10-162-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | libass may always return a full change if no subtitle images are rendered in some cases (empty tracks). Also, a full change despite empty sub-images list may be reported on initialization. Avoid invoking odd special cases in the VO code by always exiting early if the sub-image list is empty. Note that at least for OSD, the code in sub.c doesn't even send a request VOCTRL_DRAW_EOSD if the image list is empty. But the subtitle rendering code in vf_vo.c is independent from this (at least for now).
* | sub: cleanup: remove vo_osd_probar_type/value global variableswm42012-10-161-3/+3
| |
* | vo_vdpau: use new EOSD for OSD, remove support for old OSD formatwm42012-10-161-180/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |