Commit Graph

52 Commits

Author SHA1 Message Date
wm4 1c65428d6f sub: do not copy the target image if there is no OSD/subs
It's not easy to tell whether the OSD/subs are empty, or if something is
drawn. In general you have to use osd_draw() with a custom callback. If
nothing is visible, the callback is never invoked. (The actual reason
why this is so "hard" is the implementation of osd_libass.c, which
doesn't allow separating rendering and drawing of OSD elements, because
all OSD elements share the same ASS_Renderer.)

To simplify avoiding copies, make osd_draw_on_image() instead of the
caller use mp_image_make_writeable(). Introduce osd_draw_on_image_p(),
which works like osd_draw_on_image(), but gets the new image allocation
from an image pool. This is supposed to be an optimization, because it
reduces the frequency of large allocations/deallocations for image data.

The result of this is that the frequency of copies needed in conjunction
with vf_sub, screenshots, and vo_lavc (encoding) should be reduced.
vf_sub now always does true pass-through if no subs are shown.

Drop the pts check from vf_sub. This didn't make much sense.
2013-01-13 20:04:12 +01:00
wm4 844bba6645 sub: add ASS to RGBA conversion
This makes implementing new VOs easier, because they don't have to
support the ASS format.
2012-12-28 08:30:15 +01:00
Uoti Urpala 72205635ab subs: remove --utf8, simplify code
Remove the options --utf8 and --unicode which had no effect any more
(what they once did should be doable with --subcp). The only use of
corresponding variables left in code was subreader.c code using
sub_utf8 as a flag indicating whether iconv conversion was active.
Change the code to test the existence of iconv context instead.

Conflicts:
	DOCS/man/en/options.rst
	core/cfg-mplayer.h
	sub/sub.c
	sub/sub.h
	sub/subreader.c

Merged from mplayer2 commit ea7311.

Note: --unicode was already removed
2012-12-03 21:08:52 +01:00
wm4 5d5ddb2ad0 sub: add --sub-gray option to display image subs in grayscale
MPlayer/mplayer2 still show DVD subtitles in gray. Depending on who you
ask, this can be considered a bug or a feature. Include rendering in
gray as explicit feature, so the user can decide what is better.

This affects all indexed sub bitmaps entering the OSD rendering path.
Currently, this means all image subs are affected by this option, but
nothing else.
2012-11-25 23:40:07 +01:00
wm4 24bfa82a91 sub: reimplement -spugauss as --sub-gauss
Apparently the -spugauss option was popular. The code originally
implementing this is gone (scaler stuff in spudec.c). Reimplement it
using libswscale to scale and blur image subtitles if the --sub-gauss
option is set.

The code does some rather lazy padding to allow the blur to spread
pixels past the original image bounding box. (This problem exists with
normal bilinear scaling too, but is barely noticable.)

Technically, this doesn't just blur subtitles, but anything RGBA (or
indexed) that enters the OSD rendering path. But only image subtitles
produce these OSD formats currently, so no explicit check is done to
prevent blurring in other cases.
2012-11-25 23:40:07 +01:00
wm4 ea4332daf4 vo_xv: don't require frame stepping to remove OSD or subs
In order to improve performance, vo_xv didn't create a backup of the
video frame before drawing OSD and subtitles during normal playback. It
required the frontend to do frame stepping if it wanted to redraw the
OSD, but no backup of the video frame was available. (Consider the
following use case: enable the OSD permanently with --osd-level=3, then
pause during playback and do something that shows an OSD message. The
player will advance the video by one frame at the time the new OSD
message is first drawn.)

This also meant that taking a screenshot during playback with vo_xv
would include OSD and subtitles in the resulting image.

Fix this by always creating a backup before drawing OSD or subtitles.
In order to avoid having to create a full copy of the whole image frame,
introduce a complex scheme that tries to backup only the changed
regions.

It's unclear whether the additional complexity in draw_bmp.c for
backing up only the changed areas of the frame is worth it. Possibly
a simpler implementation would suffice, such as tracking only Y ranges
of changed image data, or even just copying the full frame.

vo_xv's get_screenshot() now always creates a copy in order not to
modify the currently displayed frame.
2012-11-21 19:56:59 +01:00
wm4 80270218cb osd: make the OSD and sub font more customizable
Make more aspects of the OSD font customizable. This also affects the
font used for unstyled subtitles (such as SRT), or when using the
--no-ass option. This adds back some customizability that was lost with
commit 74e7a1 (osd: use libass for OSD rendering).

Removed options:
--ass-border-color
--ass-color
--font
--subfont
--subfont-text-scale

Added options:
--osd-color
--osd-border
--osd-back-color
--osd-shadow-color
--osd-font
--osd-font-size
--osd-border-size
--osd-margin-x
--osd-margin-y
--osd-shadow-offset
--osd-spacing
--sub-scale

The font size is now specified in pixels as it would be rendered on a
window with a height of 720 pixels. OSD and subtitles are always scaled
with the window height, so specifying or expecting an absolute font
size doesn't make sense.

Such scaled pixel units are used to specify font border etc. as well.

(Note: the font size is directly passed to libass. How the fonts are
actually rasterized is outside of our control, but in theory ASS font
sizes map to "script" pixels and then are scaled to screen size.)

The default settings should be about the same, with slight difference
due to rounding to the new scales.

The OSD and subtitle fonts are not separately configurable. It has
limited use and would double the number of newly added options, which
would be more confusing than helpful. It could be easily added later,
should the need arise.

Other small details that change:
- ASS_Style.Encoding is not set to -1 for subs anymore
  (assuming subs use VSFilter direction in -no-ass mode too)
- use a different WrapStyle for OSD
- ASS forced styles are not applied to OSD
2012-11-20 18:00:15 +01:00
wm4 4873b32c59 Rename directories, move files (step 2 of 2)
Finish renaming directories and moving files. Adjust all include
statements to make the previous commit compile.

The two commits are separate, because git is bad at tracking renames
and content changes at the same time.

Also take this as an opportunity to remove the separation between
"common" and "mplayer" sources in the Makefile. ("common" used to be
shared between mplayer and mencoder.)
2012-11-12 20:08:18 +01:00
wm4 9ba52ea6ef screenshot, draw_bmp: use colorspace passed with mp_image
Remove the explicit struct mp_csp_details parameters from all related
functions, and use mp_image.colorspace/levels instead.
2012-11-01 02:07:45 +01:00
wm4 18d4eebedb draw_bmp: cosmetics, refactor
Mostly pedantic bikeshedding issues.

Move some code around, so that the sub_bitmap_to_mp_images() function
can be split into two parts. This is better than having a big function
with many input and outputs, of which only half are used in each code
path.

Also, try to make code simpler by using a mp_rect type.
2012-10-28 15:31:31 +01:00
wm4 3d98e8c674 options: remove --ffactor switch
This controlled the generation of the palette for DVD subs if no palette
was found. The option name and description is confusing, and it was
probably barely useful. Remove the option, and hardcode the behavior to
the option's default value.
2012-10-24 21:56:35 +02:00
wm4 a8824f12dd options: remove --subfont-autoscale (changes default font scale)
The code for this option attempted to emulate the old as-documented
behavior. It wasn't very good at it, and now that the old OSD code has
been removed, it's entirely pointless.

This removes the factor 1.7 with which --subfont-text-scale was
multiplied.
2012-10-24 21:56:35 +02:00
wm4 2afd7ebb4e options: remove subtitle related options that did nothing
Most of these cased working when the OSD was switched to libass, or
didn't do anything even before that.

Also don't recursively include subreader.h in sub.h.
2012-10-24 21:56:35 +02:00
wm4 0c49ddc818 sub: simplify OSD redrawing logic
Normally, we can redraw the OSD any time. But some drivers don't support
OSD redrawing (vo_null etc.), or only "sometimes" (vo_xv). For that,
some additional logic is needed. Simplify that logic. This might also
fix subtle bugs with the OSD not updating or endless frame stepping in
unforseen corner cases.

Do this by adding a new flag, which tells whether the OSD should be
redrawn.

Remove some minor code duplication.
2012-10-24 21:56:34 +02:00
wm4 4d11f32162 VO, sub: refactor
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.
2012-10-24 21:56:34 +02:00
wm4 bf68634d15 sub: add cache to mp_draw_sub_bitmaps()
This caches scaled RGBA sub-bitmaps.
2012-10-24 21:56:34 +02:00
wm4 97c6425140 sub, vf_ass: allow rendering RGBA subs, replace old vf_ass rendering
Do this by replacing all the old vf_ass drawing code by draw_bmp.c.

Change sub.c to always use osd_draw() for the other OSD drawing
routines, and simplify the code a bit.

spudec.c subtitles (i.e. DVD subs) are now considered subtitles, and
are rendered by vf_ass, if that filter is inserted.
2012-10-24 21:56:33 +02:00
wm4 98f74335d5 sub: fix text subtitle aspect ratio with vo_xv and vo_lavc, refactor
This fixes that vo_xv didn't display text subtitles correctly when
using anamorphic video. It didn't pass the aspect information to the
subtitle renderer. Also, try to render OSD correctly with respect to
aspect ratio settings: on vo_xv, the OSD is rendered into the video,
and needs to be "stretched" too when playing anamorphic video. When
the -monitorpixelaspect option is used, even with VOs such as vo_opengl
the OSD has to be rendered with that aspect ratio.

As preparation for future commits, replace the weird vsfilter_scale
value with a somewhat more sensible video_par member.

Also, struct mp_eosd_res is a better place for the aspect ratio
parameters, as OSD needs this too.

Use osd_draw_on_image() directly in vo_lavc, which fixes aspect ratio
issues as well.
2012-10-24 21:56:33 +02:00
wm4 fd5c4a1984 Remove things related to old OSD
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.
2012-10-24 21:56:33 +02:00
wm4 c139cd2b93 sub: add function to draw OSD into an image
The osd_draw_on_image() function renders the full OSD into the provided
image.

It uses the mp_draw_sub_bitmaps() function added in the previous commit
to do the actual work.
2012-10-24 21:56:33 +02:00
wm4 f45eab6fae sub: fix and simplify some change detection details
Fix spudec change detection. The internal changed-flag was not reset
when retrieving indexed bitmaps, and subtitles were rescaled every
frame, even if they were not changing.

Simplify subtitle decoders by not requiring them to check whether the
passed-in screen size has changed. sd_lavc did this, and spudec would
have needed to do the same. Instead, leave this to the osd_object
force_redraw flag. Subtitle decoders (such as libass) can still signal
that only the positions of subtitles have changed, but making _all_
subtitle decoders do this just to deal with screen size changes is
worthless.
2012-10-16 07:26:45 +02:00
wm4 3ad918bbc6 sub: never decode subs to old OSD format
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).
2012-10-16 07:26:32 +02:00
wm4 cc05910f16 sub: cosmetics: move things around
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).
2012-10-16 07:26:32 +02:00
wm4 05f4f00e24 sub: cleanup: don't pass parameters via global variables
Passing parameters from caller to subtitle renderer was done by
temporarily setting certain members in the osd_state struct (which for
all practical purposes are as good as global variables). This was the
only purpose of these members.

Rather than using such a messy way to pass parameter, put these into a
struct sub_render_params. The struct was already introduced in earlier
commits, and this commit just removes the parameter passing hack.
2012-10-16 07:26:32 +02:00
wm4 17f5019b46 sub: always go through sub.c for OSD rendering
Before this commit, vf_vo.c and vf_ass.c were manually calling the
subtitle decoder to retrieve images to render. In particular, this
circumvented the sub-bitmap conversion & caching layer in sub.c.

Change this so that subtitle decoding isn't special anymore, and draws
all subtitles with the normal OSD drawing API.

This is also a step towards removing the need for vf_ass auto-insertion.
In fact, if auto-insertion would be disabled now, VOs with "old" OSD
rendering could still render ASS subtitles in monochrome, because
there is still ASS -> old-OSD bitmap conversion in the sub.c mechanism.

The code is written with the assumption that the subtitle rendering
filter (vf_ass) can render all subtitle formats. Since vf_ass knows the
ASS format only, rendering image subs (i.e. RGBA subs) with it simply
fails. This means that with vo_xv (vf_ass auto-inserted), image subs
wouldn't be rendered. Use a dumb hack to disable rendering subs with a
filter, if we detect that the subs are not in ASS format. (Trying to
render the subs first would probably result in purging the conversion
cache on every frame.)
2012-10-16 07:26:31 +02:00
wm4 34b3a9c5e9 sub, VO: remove vo_osd_resized() function
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.
2012-10-16 07:26:31 +02:00
wm4 252ddcc014 sub: cleanup: remove vo_osd_probar_type/value global variables 2012-10-16 07:26:31 +02:00
wm4 5fc5ae752b sub: allow converting DVD subs to RGBA
The mplayer DVD sub decoder is the only remaining OSD image producer
that still requires the old mplayer OSD format (SUBBITMAP_OLD_PLANAR).

To make supporting this format optional in VOs, add a step that allows
converting these images to RGBA in case the VO doesn't have direct
support for it.

Note: the mplayer DVD sub decoder uses the old mplayer OSD format
(SUBBITMAP_OLD_PLANAR), which is assumed to use premultiplied alpha.
However, it seems DVDs allow only binary transparency, so the rendered
result will be the same.
2012-10-16 07:26:30 +02:00
wm4 3365514951 sub: allow rendering OSD in ASS image format directly, simplify
Before this commit, the OSD was drawn using libass, but the resulting
bitmaps were converted to the internal mplayer OSD format. We want to
get rid of the old OSD format, because it's monochrome, and can't even
be rendered directly using modern video output methods (like with
OpenGL/Direct3D/VDPAU).

Change it so that VOs can get the ASS images directly, without
additional conversions. (This also has the consequence that the OSD can
render colors now.) Currently, this is vo_gl3 only. The other VOs still
use the old method. Also, the old OSD format is still used for all VOs
with DVD subtitles (spudec).

Rewrite sub.c. Remove all the awkward flags and bounding boxes and
change detection things. It turns out that much of that isn't needed.

Move code related to converting subtitle images to img_convert.c. (It
has to be noted that all of these conversions were already done before
in some places, and that the new code actually makes less use of them.)
2012-10-16 07:26:30 +02:00
wm4 2a5fcd2801 sub: add preliminary emulation layer to draw OSD with EOSD
This basically pushes the old OSD bitmaps via VOCTRL_DRAW_EOSD to the
VO, instead of using the old callback-based interface.

Future commits will change the code such that sub.c pushes images
rendered by libass directly, rather than converting them to the old
OSD format first.
2012-10-16 07:26:30 +02:00
wm4 f97a85595b options: remove -subalign
It can't be re-implemented, because this isn't supported by libass. The
-subalign option and the associated sub-align slave property did
nothing. Remove them.
2012-09-18 21:07:29 +02:00
Uoti Urpala 89a5714893 subs: always use sub decoder framework for libass rendering
Remove subtitle selection code setting osd->ass_track directly and
vf_ass/vf_vo code rendering the track directly with libass. Instead,
do track selection and rendering with dec_sub.c functions.

Before, mpctx->set_of_ass_tracks[] contained bare libass tracks
generated from external subtitle files. For use with dec_sub.c, it now
contains struct sh_sub instances with decoder already initialized.

This commit breaks the sub_step command ('g' and 'y' keys) for
libass-rendered subtitles. It could be fixed, but it's so useless -
especially as with the existing implementation there's no practical
way to get subtitle delay back to normal after using it - that I
didn't bother.

Conflicts:
	command.c
	mp_core.h
	mplayer.c
2012-09-18 21:04:46 +02:00
wm4 0f155921b0 core: manage tracks in the frontend
Introduce a general track struct for every audio/video/subtitle track
known to the frontend. External files (subtitles) are now represented
as tracks too. This mainly serves to clean up the subtitle selection
code: now every subtitle is simply a track, instead of using a messy
numbering that goes by subtitle type (as it was stored in the
global_sub_pos field). The mplayer fontend will list external subtitle
files as additional tracks.

The timeline code now tries to match the exact demuxer IDs of all
tracks. This may cause problems when Matroska files with different
track numberings are used with EDL timelines. Change demux_lavf not
to set demuxer IDs, since most time they are not set.
2012-09-18 21:04:45 +02:00
wm4 988dad5fc7 osd: get rid of useless initialization function
The function merely printed redundant messages that were not visible by
default.
2012-08-20 15:36:05 +02:00
wm4 41fbcee1f5 Remove dvdnav support (DVD menus)
When the internal mplayer MPEG demuxer was removed (commit 1fde09db),
the default demuxer when using dvdnav was set to libavformat. Now it
turns out that this doesn't work with libavformat. It will terminate
playback right after the audio runs out (instead of looping it like the
video, or whatever it's supposed to do). I'm not sure what exactly the
problem is, but since 1. even mplayer-svn can't handle DVD menus
directly (missing highlights), 2. DVD menus are essentially worthless,
and 3. I don't directly watch DVDs, don't bother with it and remove it.

For basic playback, there's still libdvdread support.

Also, use pkg-config for libdvdread, and drop support for in-tree
libdvdread. Remove support for in-tree libdvdcss as well.
2012-08-16 17:17:49 +02:00
wm4 fb563de255 sub: fix confusion of ass_library handles
Commit 7484ae8e2e attempted to introduce two ass_library handles
(as it was needed to deal with how ass_library manages fonts), but the
commit was completely bogus: it assumed osd_state->ass_library would be
used by osd_libass.c only, which is not the case. As result, some of the
subtitle code used the wrong ass_library handle.

We need two ass_library handles in osd_state. The one from the mplayer
core for subtitles (osd_state->ass_library), and one for OSD rendering
(osd_state->osd_ass_library).
2012-08-07 19:21:46 +02:00
wm4 7484ae8e2e osd_libass: allocate separate ASS_Library for OSD
osd_libass.c used the same ASS_Library object as the player core. This
caused a problem: when playing a new file, all fonts loaded by the
ASS_Library object were unloaded, including the OSD font. Parts of the
OSD would stop being rendered correctly.

Solve this by creating a separate ASS_Library, with its own set of
fonts.
2012-08-07 02:15:27 +02:00
wm4 0268b1a445 osd: reset OSD change state even if VO doesn't draw OSD
Commit 168293e0ae assumed the OSD drawing routines (which have the
functions osd_draw_text/_ext as entrypoint) would always be called, and
relied on that to reset the change flag.

Some VOs, such as vo_null, didn't do this. Pausing could turn into
endless framestepping in some cases. Restore the part of the OSD drawing
logic that dealt with this. (Alternatively, the VOs could be obliged to
always call the OSD drawing routines, even if the VO doesn't actually
draw the OSD. But it seems even more messy to rely on that.)
2012-08-07 01:58:43 +02:00
wm4 a62b9cf7a3 osd: free buffer allocated with av_malloc with av_free
free() was used before, which could in theory lead to crashes if
the OSD buffer was freed or resized. (Whether using free() actually
works depends on what function libavutil's av_malloc() uses internally.
On Linux, it seems to use memalign(), which uses free() as counterpart
for deallocation, so the bug never triggered for me.)
2012-08-04 22:22:37 +02:00
wm4 ebaaa41f2a Remove teletext support
Teletext requires special OSD support. Because I can't even test
teletext, I can't restore support for it. Since teletext can be
considered ancient and obscure, and since it doesn't make sense to keep
the remaining teletext code without being able to use it, I'm removing
it.
2012-08-03 00:12:46 +02:00
wm4 168293e0ae osd: minor simplification of vo_osd_changed()
vo_osd_changed() was a weird function: it was used both to query and
mutate state, which is a bad combination. The VOs used it to query
and reset the state, and the mplayer frontend mostly used it to set
the state. In some cases, the frontend did both (that code used a
variable "int hack" to backup the state and set it again).

Simplify it and make the VOs use a vo_osd_has_changed() function to
query whether the OSD bitmaps have to be recreated. vo_osd_changed()
on the other hand is now used to update state only. The OSD change
state is reset when osd_draw_text() is called.

Update vo_corevideo.m to use vo_osd_resized() as well (forgotten change
from libass-OSD merge).

Simplify osd_set_text() and its usages.
2012-08-01 18:23:28 +02:00
wm4 c92538dfaa Remove dead code
This was done with the help of callcatcher [1]. Only functions which
are statically known to be unused are removed.

Some unused functions are not removed yet, because they might be needed
in the near future (such as open_output_stream for the encode branch).

There is one user visible change: the --subcc option did nothing, and is
removed with this commit.

[1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
2012-08-01 17:07:35 +02:00
wm4 6e8633c734 configure: remove checks for malloc.h and alloca()
Including <malloc.h>, especially if all you want is malloc(), has no
legitimate uses (on sane platforms at least). Remove the check for it,
and remove all uses in the code.

Remove unused check for alloca().
2012-07-30 22:14:33 +02:00
wm4 261243496e configure: remove memalign check
Also, replace the only use of memalign: use av_malloc instead in sub.c.
(av_malloc allocates with the required alignment restrictions.)
2012-07-30 22:14:33 +02:00
wm4 74e7a1e937 osd: use libass for OSD rendering
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.
2012-07-28 23:36:07 +02:00
wm4 ac771d288d osd: enable line breaking for OSD text
OSD text wider than the window will be broken to fit the width. The line
breaking algorithm is naive and intended as temporary, until the OSD
render code is possibly replaced by "something better".

Newline characters are also considered.
2012-07-28 20:57:37 +02:00
harklu d4b8d1486a core: allocate OSD text buffers dynamically
The OSD text buffers (mp_osd_msg_t.text and osd_state.text) used to be
static arrays, with the buffer sizes spread all over the code as magic
constants. Make the buffers dynamically allocated and remove the
arbitrary length limits.
2011-08-09 03:28:58 +03:00
Clément Bœsch b68f9fef32 cleanup: shut up more warnings 2011-05-06 18:33:16 +03:00
Clément Bœsch 52743acba3 cleanup: avoid various GCC warnings 2011-04-20 04:22:53 +03:00
diego 30f9c5cd2b cleanup: remove some casts of memalign() return value
Do not pointlessly cast the return value of memalign().
memalign() returns void*, which is compatible with any pointer in C.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32850 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-02-15 19:20:37 +02:00