summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_ass.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-19 19:25:18 +0200
committerwm4 <wm4@nowhere>2012-10-24 21:56:34 +0200
commit4d11f32162b08e3b48ae382e2ed0a151035f8aea (patch)
treec588341bf672fd935de45a05bef99e0d8f20892f /libmpcodecs/vf_ass.c
parenta4f9077f6c1a897120616cc70c1ca37c6a247be2 (diff)
downloadmpv-4d11f32162b08e3b48ae382e2ed0a151035f8aea.tar.bz2
mpv-4d11f32162b08e3b48ae382e2ed0a151035f8aea.tar.xz
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.
Diffstat (limited to 'libmpcodecs/vf_ass.c')
-rw-r--r--libmpcodecs/vf_ass.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c
index 9695ecfdfc..1da0b03b44 100644
--- a/libmpcodecs/vf_ass.c
+++ b/libmpcodecs/vf_ass.c
@@ -49,12 +49,12 @@ static const struct vf_priv_s {
unsigned int outfmt;
struct mp_csp_details csp;
- // 1 = auto-added filter: insert only if chain does not support EOSD already
+ // 1 = auto-added filter: insert only if chain does not support OSD already
// 0 = insert always
int auto_insert;
struct osd_state *osd;
- struct mp_eosd_res dim;
+ struct mp_osd_res dim;
} vf_priv_dflt = {
.csp = MP_CSP_DETAILS_DEFAULTS,
};
@@ -78,7 +78,7 @@ static int config(struct vf_instance *vf,
double dar = (double)d_width / d_height;
double sar = (double)width / height;
- vf->priv->dim = (struct mp_eosd_res) {
+ vf->priv->dim = (struct mp_osd_res) {
.w = vf->priv->outw,
.h = vf->priv->outh,
.mt = opts->ass_top_margin,
@@ -227,11 +227,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
prepare_image(vf, mpi);
if (pts != MP_NOPTS_VALUE) {
- struct sub_render_params subparams = {
- .pts = pts,
- .dim = priv->dim,
- };
- osd_draw_on_image(osd, &subparams, OSD_DRAW_SUB_FILTER, vf->dmpi,
+ osd_draw_on_image(osd, priv->dim, pts, OSD_DRAW_SUB_FILTER, vf->dmpi,
&priv->csp);
}
@@ -287,7 +283,7 @@ static int vf_open(vf_instance_t *vf, char *args)
if (!vf->priv->outfmt) {
uninit(vf);
return 0;
- } else if (vf->priv->auto_insert && flags & VFCAP_EOSD) {
+ } else if (vf->priv->auto_insert && flags & VFCAP_OSD) {
uninit(vf);
return -1;
}
@@ -301,7 +297,7 @@ static int vf_open(vf_instance_t *vf, char *args)
vf->control = control;
vf->get_image = get_image;
vf->put_image = put_image;
- vf->default_caps = VFCAP_EOSD | VFCAP_EOSD_FILTER;
+ vf->default_caps = VFCAP_OSD;
return 1;
}