1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 14:50:07 +00:00

VF: rename vf_ass to vf_sub

This reflects the fact that this filter now renders all types of
subtitles, not just ASS subtitles.

Always compile this filter, not just on CONFIG_ASS.

Note that --no-ass still disables auto-inserting this filter. It's the
only way to disable auto-insertion, so keep it even though it's not
really ASS specific anymore. --no-ass also disables using libass for
rendering text subs directly.
This commit is contained in:
wm4 2012-10-21 18:31:34 +02:00
parent 281989d384
commit 773668b6e8
7 changed files with 25 additions and 30 deletions

View File

@ -663,14 +663,14 @@ screenshot
not always safe to insert this filter by default. See the
``Taking screenshots`` section for details.
ass
sub
Moves subtitle rendering to an arbitrary point in the filter
chain, or force subtitle rendering in the video filter as opposed to using
video output OSD support.
*EXAMPLE*:
``--vf=ass,eq``
``--vf=sub,eq``
Moves sub rendering before the eq filter. This will put both
subtitle colors and video under the influence of the video equalizer
settings.

View File

@ -151,7 +151,7 @@ libmpcodecs/:
vf_*.c and vf.c form the video filter chain. They are fed by the video
decoder, and output the filtered images to the VOs though vf_vo.c. By
default, no video filters (except vf_vo) are used, though sometimes
vf_ass.c is inserted for rendering ASS subtitles, when the VO can't.
vf_sub.c is inserted for rendering subtitles, when the VO can't.
ad_*.c and dec_audio.c/ad.c handle audio decoding. The audio filter chain is
separately in libaf.

View File

@ -38,9 +38,7 @@ SRCS_COMMON-$(FTP) += stream/stream_ftp.c
SRCS_COMMON-$(GIF) += libmpdemux/demux_gif.c
SRCS_COMMON-$(HAVE_SYS_MMAN_H) += libaf/af_export.c osdep/mmap_anon.c
SRCS_COMMON-$(LADSPA) += libaf/af_ladspa.c
SRCS_COMMON-$(LIBASS) += libmpcodecs/vf_ass.c \
sub/ass_mp.c \
sub/sd_ass.c \
SRCS_COMMON-$(LIBASS) += sub/ass_mp.c sub/sd_ass.c
SRCS_COMMON-$(LIBBLURAY) += stream/stream_bluray.c
SRCS_COMMON-$(LIBBS2B) += libaf/af_bs2b.c
@ -171,6 +169,7 @@ SRCS_COMMON = asxparser.c \
libmpcodecs/vf_screenshot.c \
libmpcodecs/vf_softpulldown.c \
libmpcodecs/vf_stereo3d.c \
libmpcodecs/vf_sub.c \
libmpcodecs/vf_swapuv.c \
libmpcodecs/vf_unsharp.c \
libmpcodecs/vf_vo.c \

View File

@ -64,7 +64,7 @@ extern const vf_info_t vf_info_divtc;
extern const vf_info_t vf_info_softskip;
extern const vf_info_t vf_info_screenshot;
extern const vf_info_t vf_info_screenshot_force;
extern const vf_info_t vf_info_ass;
extern const vf_info_t vf_info_sub;
extern const vf_info_t vf_info_yadif;
extern const vf_info_t vf_info_stereo3d;
extern const vf_info_t vf_info_dlopen;
@ -102,9 +102,7 @@ static const vf_info_t *const filter_list[] = {
&vf_info_delogo,
&vf_info_phase,
&vf_info_divtc,
#ifdef CONFIG_ASS
&vf_info_ass,
#endif
&vf_info_sub,
&vf_info_yadif,
&vf_info_stereo3d,
&vf_info_dlopen,

View File

@ -106,7 +106,7 @@ struct vf_ctrl_screenshot {
#define VFCTRL_INIT_OSD 15 // Filter OSD renderer present?
#define VFCTRL_SET_DEINTERLACE 18 // Set deinterlacing status
#define VFCTRL_GET_DEINTERLACE 19 // Get deinterlacing status
/* Hack to make the OSD state object available to vf_expand and vf_ass which
/* Hack to make the OSD state object available to vf_sub which
* access OSD/subtitle state outside of normal OSD draw time. */
#define VFCTRL_SET_OSD_OBJ 20
#define VFCTRL_SET_YUV_COLORSPACE 22 // arg is struct mp_csp_details*

View File

@ -289,7 +289,7 @@ static int vf_open(vf_instance_t *vf, char *args)
}
if (vf->priv->auto_insert)
mp_msg(MSGT_ASS, MSGL_INFO, "[ass] auto-open\n");
mp_msg(MSGT_ASS, MSGL_INFO, "[sub] auto-open\n");
vf->config = config;
vf->query_format = query_format;
@ -308,15 +308,15 @@ static const m_option_t vf_opts_fields[] = {
};
static const m_struct_t vf_opts = {
"ass",
"sub",
sizeof(struct vf_priv_s),
&vf_priv_dflt,
vf_opts_fields
};
const vf_info_t vf_info_ass = {
"Render ASS/SSA subtitles",
"ass",
const vf_info_t vf_info_sub = {
"Render subtitles",
"sub",
"Evgeniy Stepanov",
"",
vf_open,

View File

@ -2267,39 +2267,37 @@ int reinit_video_chain(struct MPContext *mpctx)
sh_video->vfilter = vf_open_filter(opts, NULL, "vo", vf_arg);
}
#ifdef CONFIG_ASS
if (opts->ass_enabled) {
int i;
int insert = 1;
if (opts->vf_settings)
for (i = 0; opts->vf_settings[i].name; ++i)
if (strcmp(opts->vf_settings[i].name, "ass") == 0) {
if (strcmp(opts->vf_settings[i].name, "sub") == 0) {
insert = 0;
break;
}
if (insert) {
extern vf_info_t vf_info_ass;
const vf_info_t *libass_vfs[] = {
&vf_info_ass, NULL
extern vf_info_t vf_info_sub;
const vf_info_t *sub_vfs[] = {
&vf_info_sub, NULL
};
char *vf_arg[] = {
"auto", "yes", NULL
};
int retcode = 0;
struct vf_instance *vf_ass = vf_open_plugin_noerr(opts, libass_vfs,
struct vf_instance *vf_sub = vf_open_plugin_noerr(opts, sub_vfs,
sh_video->vfilter,
"ass", vf_arg,
"sub", vf_arg,
&retcode);
if (vf_ass)
sh_video->vfilter = vf_ass;
else if (retcode == -1) // vf_ass open() returns -1 VO has OSD
mp_msg(MSGT_CPLAYER, MSGL_V, "[ass] vf_ass not needed\n");
if (vf_sub)
sh_video->vfilter = vf_sub;
else if (retcode == -1) // vf_sub open() returns -1 VO has OSD
mp_msg(MSGT_CPLAYER, MSGL_V, "[sub] vf_sub not needed\n");
else
mp_msg(MSGT_CPLAYER, MSGL_ERR,
"ASS: cannot add video filter\n");
"sub: cannot add video filter\n");
}
}
#endif
sh_video->vfilter = append_filters(sh_video->vfilter, opts->vf_settings);
@ -2415,7 +2413,7 @@ static double update_video(struct MPContext *mpctx)
struct sh_video *sh_video = mpctx->sh_video;
struct vo *video_out = mpctx->video_out;
sh_video->vfilter->control(sh_video->vfilter, VFCTRL_SET_OSD_OBJ,
mpctx->osd); // for vf_ass
mpctx->osd); // for vf_sub
if (!mpctx->opts.correct_pts)
return update_video_nocorrect_pts(mpctx);