2009-02-08 04:27:30 +01:00
|
|
|
/*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2001-03-27 02:32:24 +02:00
|
|
|
|
2007-07-03 00:34:45 +02:00
|
|
|
#ifndef MPLAYER_SUB_H
|
|
|
|
#define MPLAYER_SUB_H
|
2001-04-24 13:42:04 +02:00
|
|
|
|
2011-01-19 19:13:48 +01:00
|
|
|
#include <stdbool.h>
|
2012-10-04 17:16:40 +02:00
|
|
|
#include <stdint.h>
|
2011-01-19 19:13:48 +01:00
|
|
|
|
2012-08-25 16:47:50 +02:00
|
|
|
#include "subreader.h"
|
|
|
|
|
2012-09-28 21:33:26 +02:00
|
|
|
struct vo;
|
2012-10-04 17:16:40 +02:00
|
|
|
struct sub_render_params;
|
|
|
|
|
|
|
|
enum sub_bitmap_format {
|
|
|
|
SUBBITMAP_EMPTY = 0,// no bitmaps; always has num_parts==0
|
|
|
|
SUBBITMAP_LIBASS, // A8, with a per-surface blend color (libass.color)
|
2012-10-05 20:37:16 +02:00
|
|
|
SUBBITMAP_RGBA, // B8G8R8A8 (MSB=A, LSB=B), scaled, premultiplied alpha
|
2012-10-04 17:16:47 +02:00
|
|
|
SUBBITMAP_INDEXED, // scaled, bitmap points to osd_bmp_indexed
|
2012-10-04 17:16:40 +02:00
|
|
|
|
|
|
|
SUBBITMAP_COUNT
|
|
|
|
};
|
|
|
|
|
2012-10-04 17:16:47 +02:00
|
|
|
// For SUBBITMAP_INDEXED
|
|
|
|
struct osd_bmp_indexed {
|
|
|
|
uint8_t *bitmap;
|
|
|
|
// Each entry is like a pixel in SUBBITMAP_RGBA format
|
|
|
|
uint32_t palette[256];
|
|
|
|
};
|
|
|
|
|
2012-10-04 17:16:40 +02:00
|
|
|
struct sub_bitmap {
|
|
|
|
void *bitmap;
|
|
|
|
int stride;
|
2012-10-04 17:16:47 +02:00
|
|
|
// Note: not clipped, going outside the screen area is allowed
|
|
|
|
// (except for SUBBITMAP_LIBASS, which is always clipped)
|
2012-10-04 17:16:40 +02:00
|
|
|
int w, h;
|
|
|
|
int x, y;
|
|
|
|
int dw, dh;
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
uint32_t color;
|
|
|
|
} libass;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct sub_bitmaps {
|
2012-10-04 17:16:47 +02:00
|
|
|
// For VO cache state (limited by MAX_OSD_PARTS)
|
|
|
|
int render_index;
|
2012-10-04 17:16:40 +02:00
|
|
|
|
|
|
|
enum sub_bitmap_format format;
|
2012-10-04 17:16:47 +02:00
|
|
|
|
|
|
|
// If false, dw==w && dh==h.
|
|
|
|
// SUBBITMAP_LIBASS is never scaled.
|
|
|
|
bool scaled;
|
2012-10-04 17:16:40 +02:00
|
|
|
|
|
|
|
struct sub_bitmap *parts;
|
|
|
|
int num_parts;
|
|
|
|
|
|
|
|
// Incremented on each change
|
|
|
|
int bitmap_id, bitmap_pos_id;
|
|
|
|
};
|
|
|
|
|
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-19 19:25:18 +02:00
|
|
|
struct mp_osd_res {
|
2012-10-04 17:16:40 +02:00
|
|
|
int w, h; // screen dimensions, including black borders
|
|
|
|
int mt, mb, ml, mr; // borders (top, bottom, left, right)
|
2012-10-18 17:31:00 +02:00
|
|
|
double display_par;
|
|
|
|
double video_par; // PAR of the original video (for some sub decoders)
|
2012-10-04 17:16:40 +02:00
|
|
|
};
|
2012-09-28 21:33:26 +02:00
|
|
|
|
2012-09-29 09:53:28 +02:00
|
|
|
enum mp_osdtype {
|
2012-10-04 17:16:32 +02:00
|
|
|
OSDTYPE_SUB,
|
2012-09-29 09:53:28 +02:00
|
|
|
OSDTYPE_OSD,
|
|
|
|
OSDTYPE_SUBTITLE,
|
|
|
|
OSDTYPE_PROGBAR,
|
|
|
|
OSDTYPE_SPU,
|
|
|
|
|
|
|
|
MAX_OSD_PARTS
|
|
|
|
};
|
2012-09-28 21:38:52 +02:00
|
|
|
|
2012-09-28 21:48:30 +02:00
|
|
|
#define OSD_CONV_CACHE_MAX 3
|
2012-09-28 21:38:52 +02:00
|
|
|
|
|
|
|
struct osd_object {
|
|
|
|
int type; // OSDTYPE_*
|
2012-10-04 17:16:32 +02:00
|
|
|
bool is_sub;
|
|
|
|
|
2012-09-28 21:38:52 +02:00
|
|
|
bool force_redraw;
|
|
|
|
|
|
|
|
// caches for OSD conversion (internal to render_object())
|
|
|
|
struct osd_conv_cache *cache[OSD_CONV_CACHE_MAX];
|
|
|
|
struct sub_bitmaps cached;
|
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-03-22 06:26:37 +01:00
|
|
|
|
2012-09-28 21:38:52 +02:00
|
|
|
// VO cache state
|
|
|
|
int vo_bitmap_id;
|
|
|
|
int vo_bitmap_pos_id;
|
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-19 19:25:18 +02:00
|
|
|
struct mp_osd_res vo_res;
|
2012-09-28 21:38:52 +02:00
|
|
|
|
|
|
|
// Internally used by osd_libass.c
|
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-03-22 06:26:37 +01:00
|
|
|
struct ass_track *osd_track;
|
2012-09-28 21:38:52 +02:00
|
|
|
struct sub_bitmap *parts_cache;
|
|
|
|
};
|
2002-04-15 21:17:12 +02:00
|
|
|
|
2008-06-24 00:53:58 +02:00
|
|
|
struct osd_state {
|
2012-09-28 21:38:52 +02:00
|
|
|
struct osd_object *objs[MAX_OSD_PARTS];
|
|
|
|
|
2011-07-23 00:55:13 +02:00
|
|
|
struct ass_library *ass_library;
|
2012-08-25 16:47:50 +02:00
|
|
|
struct ass_renderer *ass_renderer;
|
2012-08-25 20:22:39 +02:00
|
|
|
struct sh_sub *sh_sub;
|
timeline: subs: keep subtitle tracks in source time
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.
2012-03-20 01:54:19 +01:00
|
|
|
double sub_offset;
|
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-19 19:25:18 +02:00
|
|
|
double vo_pts;
|
2012-10-04 17:16:32 +02:00
|
|
|
|
|
|
|
bool render_subs_in_filter;
|
|
|
|
|
2012-09-28 21:38:52 +02:00
|
|
|
char *osd_text; // OSDTYPE_OSD
|
2012-09-29 11:03:53 +02:00
|
|
|
int progbar_type, progbar_value; // OSDTYPE_PROGBAR
|
2012-09-28 21:33:26 +02:00
|
|
|
|
2012-10-04 17:16:36 +02:00
|
|
|
int switch_sub_id;
|
2012-09-28 21:33:26 +02:00
|
|
|
|
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-03-22 06:26:37 +01:00
|
|
|
struct MPOpts *opts;
|
2012-09-28 21:38:52 +02:00
|
|
|
|
2012-10-19 17:49:49 +02:00
|
|
|
// Internal to sub.c
|
|
|
|
struct mp_draw_sub_cache *draw_cache;
|
|
|
|
|
2012-09-28 21:38:52 +02:00
|
|
|
// Internally used by osd_libass.c
|
|
|
|
struct ass_renderer *osd_render;
|
|
|
|
struct ass_library *osd_ass_library;
|
2008-06-24 00:53:58 +02:00
|
|
|
};
|
2002-04-15 21:17:12 +02:00
|
|
|
|
2006-11-29 15:08:24 +01:00
|
|
|
extern subtitle* vo_sub;
|
|
|
|
|
2001-11-20 19:36:50 +01:00
|
|
|
extern void* vo_spudec;
|
2002-01-10 18:20:27 +01:00
|
|
|
extern void* vo_vobsub;
|
2001-11-20 19:36:50 +01:00
|
|
|
|
2012-09-29 09:53:28 +02:00
|
|
|
// Start of OSD symbols in osd_font.pfb
|
|
|
|
#define OSD_CODEPOINTS 0xE000
|
|
|
|
|
|
|
|
// OSD symbols. osd_font.pfb has them starting from codepoint OSD_CODEPOINTS.
|
|
|
|
// Symbols with a value >= 32 are normal unicode codepoints.
|
|
|
|
enum mp_osd_font_codepoints {
|
|
|
|
OSD_PLAY = 0x01,
|
|
|
|
OSD_PAUSE = 0x02,
|
|
|
|
OSD_STOP = 0x03,
|
|
|
|
OSD_REW = 0x04,
|
|
|
|
OSD_FFW = 0x05,
|
|
|
|
OSD_CLOCK = 0x06,
|
|
|
|
OSD_CONTRAST = 0x07,
|
|
|
|
OSD_SATURATION = 0x08,
|
|
|
|
OSD_VOLUME = 0x09,
|
|
|
|
OSD_BRIGHTNESS = 0x0A,
|
|
|
|
OSD_HUE = 0x0B,
|
|
|
|
OSD_BALANCE = 0x0C,
|
|
|
|
OSD_PANSCAN = 0x50,
|
|
|
|
|
|
|
|
OSD_PB_START = 0x10,
|
|
|
|
OSD_PB_0 = 0x11,
|
|
|
|
OSD_PB_END = 0x12,
|
|
|
|
OSD_PB_1 = 0x13,
|
|
|
|
};
|
2001-03-27 02:32:24 +02:00
|
|
|
|
2001-08-16 17:18:46 +02:00
|
|
|
/* now in textform */
|
2008-05-01 08:12:38 +02:00
|
|
|
extern char * const sub_osd_names[];
|
|
|
|
extern char * const sub_osd_names_short[];
|
2001-08-16 17:18:46 +02:00
|
|
|
|
2002-04-17 23:51:18 +02:00
|
|
|
extern int sub_unicode;
|
|
|
|
extern int sub_utf8;
|
|
|
|
|
|
|
|
extern char *sub_cp;
|
|
|
|
extern int sub_pos;
|
2002-12-27 22:41:40 +01:00
|
|
|
extern int sub_width_p;
|
2002-12-28 16:03:23 +01:00
|
|
|
extern int sub_bg_color; /* subtitles background color */
|
|
|
|
extern int sub_bg_alpha;
|
2002-04-17 23:51:18 +02:00
|
|
|
|
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-03-22 06:26:37 +01:00
|
|
|
extern char *subtitle_font_encoding;
|
|
|
|
extern float text_font_scale_factor;
|
|
|
|
extern float osd_font_scale_factor;
|
|
|
|
extern float subtitle_font_radius;
|
|
|
|
extern float subtitle_font_thickness;
|
|
|
|
extern int subtitle_autoscale;
|
|
|
|
|
|
|
|
extern char *font_name;
|
|
|
|
extern char *sub_font_name;
|
|
|
|
extern float font_factor;
|
|
|
|
extern float sub_delay;
|
|
|
|
extern float sub_fps;
|
|
|
|
|
|
|
|
extern int sub_justify;
|
|
|
|
|
2012-08-07 19:21:46 +02:00
|
|
|
struct osd_state *osd_create(struct MPOpts *opts, struct ass_library *asslib);
|
2011-08-08 10:07:17 +02:00
|
|
|
void osd_set_text(struct osd_state *osd, const char *text);
|
2012-08-01 18:23:28 +02:00
|
|
|
void vo_osd_changed(int new_value);
|
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-19 19:25:18 +02:00
|
|
|
void osd_reset_changed(struct osd_state *osd);
|
|
|
|
bool osd_has_changed(struct osd_state *osd);
|
2008-06-24 00:53:58 +02:00
|
|
|
void osd_free(struct osd_state *osd);
|
2002-02-22 16:25:11 +01:00
|
|
|
|
2012-10-19 19:11:08 +02:00
|
|
|
enum mp_osd_draw_flags {
|
|
|
|
OSD_DRAW_SUB_FILTER = (1 << 0),
|
|
|
|
OSD_DRAW_SUB_ONLY = (1 << 1),
|
|
|
|
};
|
|
|
|
|
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-19 19:25:18 +02:00
|
|
|
void osd_draw(struct osd_state *osd, struct mp_osd_res res,
|
|
|
|
double video_pts, int draw_flags,
|
|
|
|
const bool formats[SUBBITMAP_COUNT],
|
2012-10-19 19:11:08 +02:00
|
|
|
void (*cb)(void *ctx, struct sub_bitmaps *imgs), void *cb_ctx);
|
2012-10-04 17:16:32 +02:00
|
|
|
|
2012-10-07 03:26:46 +02:00
|
|
|
struct mp_image;
|
|
|
|
struct mp_csp_details;
|
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-19 19:25:18 +02:00
|
|
|
bool osd_draw_on_image(struct osd_state *osd, struct mp_osd_res res,
|
|
|
|
double video_pts, int draw_flags, struct mp_image *dest,
|
2012-10-19 19:11:08 +02:00
|
|
|
struct mp_csp_details *dest_csp);
|
2012-10-07 03:26:46 +02:00
|
|
|
|
2012-09-28 21:38:52 +02:00
|
|
|
bool sub_bitmaps_bb(struct sub_bitmaps *imgs, int *x1, int *y1,
|
|
|
|
int *x2, int *y2);
|
|
|
|
|
|
|
|
// defined in osd_libass.c and osd_dummy.c
|
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-03-22 06:26:37 +01:00
|
|
|
|
2012-09-28 21:38:52 +02:00
|
|
|
void osd_object_get_bitmaps(struct osd_state *osd, struct osd_object *obj,
|
|
|
|
struct sub_bitmaps *out_imgs);
|
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-03-22 06:26:37 +01:00
|
|
|
void osd_get_function_sym(char *buffer, size_t buffer_size, int osd_function);
|
|
|
|
void osd_init_backend(struct osd_state *osd);
|
|
|
|
void osd_destroy_backend(struct osd_state *osd);
|
|
|
|
|
2007-12-31 17:15:50 +01:00
|
|
|
#endif /* MPLAYER_SUB_H */
|