summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_ass.c
Commit message (Collapse)AuthorAgeFilesLines
* vf_ass: use correct height when copying imagewm42012-08-031-1/+1
| | | | | | | The target image can be larger than the image size the video filter was configured for. Based on mplayer-svn commit 34973.
* vf_ass: request a sufficiently large image for direct renderingmplayer-svn2012-08-031-1/+3
| | | | | | | | | | | | Request a sufficiently large image for direct rendering. Due to alignment and similar, we might need a buffer larger than the output of the ASS filter. Fixes out of bound writes and/or broken video near the borders. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34970 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* osd: use libass for OSD renderingwm42012-07-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OSD will now be rendered with libass. The old rendering code, which used freetype/fontconfig and did text layout manually, is disabled. To re-enable the old code, use the --disable-libass-osd configure switch. Some switches do nothing with the new code enabled, such as -subalign, -sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that the code for rendering unstyled subtitles with libass doesn't make any attempts to support them. Some of them could be supported in theory.) Teletext rendering is not implemented in the new OSD rendering code. I don't have any teletext sources for testing, and since teletext is being phased out world-wide, the need for this is questionable. Note that rendering is extremely inefficient, mostly because the libass output is blended with the extremely strange mplayer OSD format. This could be improved at a later point. Remove most OSD rendering from vo_aa.c, because that was extremely hacky, can't be made work with osd_libass, and didn't work anyway in my tests. Internally, some cleanup is done. Subtitle and OSD related variable declarations were literally all over the place. Move them to sub.h and sub.c, which were hoarding most of these declarations already. Make the player core in mplayer.c free of concerns like bitmap font loading. The old OSD rendering code has been moved to osd_ft.c. The font_load.c and font_load_ft.c are only needed and compiled if the old OSD rendering code is configured.
* Merge remote-tracking branch 'origin/master'wm42012-04-011-1/+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
| * timeline: subs: keep subtitle tracks in source timeUoti Urpala2012-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timeline handling converted the pts values from demuxed subtitles to timeline scale. Change the code to do most subtitle handling in original subtitle source pts, and instead convert current playback timeline pts to those units when deciding which subtitle to show. The main functionality changes are that now demuxed subtitles which overlap chapter boundaries are handled correctly (at least for libass subtitles), and external subtitles are assumed to use same pts scale as current source (this needs improvements later). Before, a video subtitle that had a duration continuing past the end of the chapter would continue to be shown for the original duration, even if the chapter ended and playback switched to a position in the source where the subtitle shouldn't exist. Now, the subtitle will correctly end. Before, external subtitle files were interpreted as specifying pts values in timeline scale. Now, they're interpreted as specifying pts values in source file time scale, for _every_ source file. This is probably more likely to be what the user wants for the "main" source file in case there is one, but almost certainly not quite right for multiple source files where the same subs could be shown over different scenes. If the user wants them to match some main source file, it's probably still better to have incorrect extra subs for video from some files than to have every subtitle appearing at the wrong time. The new code makes it easier to change the interpretation of the subtitle times, and some configurability should be added in the future.
* | subtitles: create only one instance of ASS_Render instead of twowm42012-01-181-31/+19
|/ | | | | | This simplifies the code. It also can make loading of mkv files faster, as initializing two ASS_Render instances required scanning mkv font attachments twice.
* core, vo: modify OSD redraw architecture, support EOSDUoti Urpala2011-12-061-1/+1
| | | | | | | | | | | | | | | | Previously the core sent VFCTRL_REDRAW_OSD to change OSD contents over the current frame. Change this to VFCTRL_REDRAW_FRAME followed by normal EOSD and OSD drawing calls, then vo_flip_page(). The new version supports changing EOSD contents for libass-rendered subtitles and simplifies the redraw support code needed per VO. vo_xv doesn't support EOSD changes because it relies on vf_ass to render EOSD contents earlier in the filter chain. vo_xv logic is additionally simplified because the previous commit removed the need to track the status of current and next images separately (now each frame is guaranteed to become "visible" soon after we receive it as "next", with no VO code running in the interval between).
* options: move libass-related options to structUoti Urpala2011-09-031-19/+24
|
* options, subs: add --ass-vsfilter-aspect-compatharklu2011-08-121-2/+3
| | | | | | | | | Add option --ass-vsfilter-aspect-compat and corresponding property ass_vsfilter_aspect_compat. The setting controls whether to enable the emulation of traditional VSFilter behavior where subtitles are stretched if the video is anamorphic (previously always enabled for native SSA/ASS subtitles). Enabled by default. Add 'V' as a new default keybinding to toggle the property.
* subs: libass: apply option changes to all track typesUoti Urpala2011-08-081-1/+5
| | | | | | | | | Libass rendering uses two renderer objects to support both VSFilter aspect ratio (mis)behavior emulation and correct rendering. When option values were changed during playback the changes were applied to the renderer used for the currently active track only, and old values could be used if the user then switched to a track using the other renderer object. Fix to update both renderers.
* cleanup: move global ass_force_reload to struct osd_stateUoti Urpala2011-08-081-6/+8
|
* sub/OSD: move some related files to sub/Uoti Urpala2011-01-261-2/+2
|
* cleanup: rename ass_* functions to mp_ass_*Uoti Urpala2011-01-261-7/+7
| | | | | | | | The various ass_* functions were created when libass was part of the MPlayer tree and the distinction between MPlayer-specific and other functions was less clear. Now that libass is a clearly separate library, using the same ass_* namespace for player functions is ugly. Rename the functions to use mp_ass_ prefix instead.
* subs: use correct font aspect ratio for libass + converted subsUoti Urpala2011-01-261-12/+28
| | | | | | | | | | | | | | | | | | | | | | Rendering of ASS subtitles tries to be bug compatible with VSFilter and stretches fonts when the video is anamorphic (some scripts try to compensate for this VSFilter behavior, so trying to render them "correctly" would give the wrong result). However this behavior is not appropriate for subtitles we converted to ASS format ourselves for libass rendering, as they certainly don't have VSFilter bug workarounds. Change the code to use different behavior for "native" ASS tracks and converted ones. It's questionable whether the VSFilter-compatible behavior is appropriate for external .ass files either, as there could be anamorphic and non-anamorphic versions of the same video and the bug-compatible behavior can only be correct for one alternative at most. However it's probably better to keep it as a default at least, so that extracting a muxed subtitle track and using that does not give behavior different from the original muxed one. The aspect ratio setting is per ASS_Renderer, and changing it resets libass caches. For that reason this commit adds separate renderer instances to use for the "correct" and "VSFilter bug compatible" cases.
* subtitles: move global ass_track to struct osd_stateUoti Urpala2011-01-151-4/+8
|
* cosmetics: Remove vim/emacs coding style hints from sourcesdiego2010-11-021-2/+0
| | | | | | The hints are inconsistent and pointless if only present in a few files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32223 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: reformat vf_ass to K&R styleUoti Urpala2010-11-021-289/+318
|
* cosmetics: "struct vf_instance* vf" -> "struct vf_instance *vf"Uoti Urpala2010-05-291-10/+10
| | | | | | | Change 'struct vf_instance' pointer arguments to more standard style as in the subject. Also some other minor formatting fixes. Patch by Diego Biurrun.
* Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* Merge svn changes up to r30683Uoti Urpala2010-03-101-2/+2
|\
| * Rename open() vf initialization function to vf_open().diego2010-02-211-2/+2
| | | | | | | | | | | | | | This avoids clashes with fcntl.h under certain circumstances. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30680 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cosmetics: Remove pointless empty lines at EOF.diego2010-02-201-1/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30675 b3059339-0415-0410-9bf9-f77b7e298cf2
| * libass: fix PAR correctiongreg2010-02-091-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30530 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Some ugly hacks to make compiling against a newer external version of libass ↵reimar2009-12-241-0/+4
| | | | | | | | | | | | work. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30107 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove more direct includes of libass/ass.hreimar2009-12-241-1/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30105 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Fix stupid, off-by-one, mistakes in assert() expressions.eugeni2009-07-271-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29448 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Make sure clip coordinates are inside the screen area.eugeni2009-07-181-0/+4
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29425 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-10/+10
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Avoid misleading error "ASS: cannot add video filter"Uoti Urpala2010-01-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using libass with a VO that has direct EOSD support the vf_ass video filter is unnecessary and is not added automatically, but the code that adds the filter when it is needed produced misleading output messages in this case. The following two messages were printed at MSGL_ERR level, making it look like an error condition: Couldn't open video filter 'ass'. ASS: cannot add video filter Add a version of vf_open_plugin() called vf_open_plugin_noerr() that does not itself print an error message if opening a vf fails and that returns the exact status code returned by the vf open() function. Make vf_ass return a different status code depending on whether there was an actual error or if it determined a filter would be redundant. Use the _noerr function in the code adding the filter to avoid the first message and check the status code to avoid the second.
* | Change type names to match upstream libassGrigori Goronzy2009-08-071-6/+6
| |
* | Remove internal libass treeUoti Urpala2009-07-261-3/+2
| | | | | | | | | | Remove the libass/ directory and use the newest standalone version of the library instead.
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-11/+10
| |
* | Translation system changes part 2: replace macros by stringsAmar Takhar2009-07-071-2/+2
| | | | | | | | | | Replace all MSGTR_ macros in the source by the corresponding English string.
* | Translation system changes part 1: wrap translated stringsAmar Takhar2009-07-071-2/+2
| | | | | | | | | | Replace mp_msg() calls which have a translated string as the format argument with mp_tmsg and add _() around all other translated strings.
* | vf_ass: Free private data at uninitUoti Urpala2009-03-311-0/+1
| |
* | vf_ass: Copy less unnecessary data to/from work areaUoti Urpala2008-07-251-48/+50
| | | | | | | | | | | | | | | | | | | | The filter copied the chroma planes from every potentially changed row of the original image to its non-subsampled work area. Change it to calculate the minimum and maximum x coordinate for each chroma row and only copy the part between those. The performance increase is only minor (though observable), but I think the resulting code is no more complex than the original.
* | vf_ass: Optimize alpha multiplyUoti Urpala2008-07-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The effect of alpha blending was calculated as color = orig_color * alpha / 255 where alpha and color range from 0 to 255. Change this to color = (orig_color * alpha + 255) / 256 where the "/ 256" can be expressed as a shift whereas the compiler would probably generate a multiply+shift for the original "/ 255". This formula gives a result that is too high by 1 for some inputs. However it gives the exact result if alpha is 0 or 255 which is probably the case where small errors would matter most.
* | Merge svn changes up to r26783Uoti Urpala2008-05-151-16/+18
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile common.mak configure libmpcodecs/vd_ffmpeg.c libmpdemux/demux_mkv.c libvo/vo_xv.c mplayer.c
| * Use standard license headers.diego2008-05-131-16/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26759 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Move opt_screen_size_[x|y] to options structUoti Urpala2008-04-251-4/+3
| |
* | Remove _s/_st suffix from some struct namesUoti Urpala2008-04-251-10/+10
|/ | | | | Since the names are always used after the keyword "struct" having a suffix as in "struct demuxer_st" is almost completely pointless.
* Add global ass_force_reload flag.eugeni2008-01-231-1/+1
| | | | | | | If it is set, renderer is reconfigured before the next frame. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25841 b3059339-0415-0410-9bf9-f77b7e298cf2
* begin moving const filter data to .text/.rodata sectionsrfelker2007-11-091-6/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24997 b3059339-0415-0410-9bf9-f77b7e298cf2
* Replace stdint.h #include by functionally equivalent inttypes.h.diego2007-09-181-1/+1
| | | | | | | | The use of inttypes.h is more common throughout MPlayer and stdint.h can create problems on obscure systems like HP-UX, see Bugzilla #831. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24565 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add -ass-hinting option for setting font hinting method.eugeni2007-04-271-1/+1
| | | | | | | | | It is possible to separately configure hinting for scaled and unscaled osd. The default is native hinter for unscaled osd (only vo_gl at this point), no hinting for vf_ass. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23152 b3059339-0415-0410-9bf9-f77b7e298cf2
* Mark m_struct_t defaults as constreimar2007-01-281-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22045 b3059339-0415-0410-9bf9-f77b7e298cf2
* Speed up ASS subtitles display by detecting changes between two consecutiveeugeni2006-12-061-1/+1
| | | | | | | rendering results. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21522 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix incorrect stride used in vf_ass.eugeni2006-11-221-6/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21170 b3059339-0415-0410-9bf9-f77b7e298cf2
* Initialize fontconfig in VFCTRL_INIT_EOSD handler.eugeni2006-11-051-1/+3
| | | | | | | | | | Recent libass api changes moved fontconfig initialization to filter's config() function. It is bad, because cache update can take a long time, resulting in unpleasant sound effects. This change restores the original behaviour. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20722 b3059339-0415-0410-9bf9-f77b7e298cf2
* ass renderer absolutely needs readable target mpi.reimar2006-11-041-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20672 b3059339-0415-0410-9bf9-f77b7e298cf2
* Introduce MSGT_ASS, use it for all libass messages.eugeni2006-11-031-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20645 b3059339-0415-0410-9bf9-f77b7e298cf2
* Libass interface reworked:eugeni2006-10-281-3/+3
| | | | | | | | | - ass_instance_t renamed to ass_renderer_t - ass_library_t introduced - use of mplayer-specific global variables limited to ass_mp.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20493 b3059339-0415-0410-9bf9-f77b7e298cf2
* Split ass_configure() into several smaller functions.eugeni2006-10-261-13/+2
| | | | | | | FontConfig initialization moved from ass_init() to ass_set_fonts(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20462 b3059339-0415-0410-9bf9-f77b7e298cf2
* Simplify and optimize bitmap blending.eugeni2006-10-021-31/+12
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20018 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add copyright notice and vim/emacs comments to libass and vf_ass.c.eugeni2006-10-011-0/+20
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20014 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add -(no)ass-use-margins option.eugeni2006-08-281-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19569 b3059339-0415-0410-9bf9-f77b7e298cf2
* Zero fill ass_settings_t before use.eugeni2006-08-271-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19556 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add VFCTRL_DRAW_EOSD.eugeni2006-08-241-1/+5