From 4d11f32162b08e3b48ae382e2ed0a151035f8aea Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 19 Oct 2012 19:25:18 +0200 Subject: 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. --- sub/osd_libass.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sub/osd_libass.c') diff --git a/sub/osd_libass.c b/sub/osd_libass.c index a182c6bdf2..4a6a0c88cb 100644 --- a/sub/osd_libass.c +++ b/sub/osd_libass.c @@ -191,7 +191,7 @@ static void update_progbar(struct osd_state *osd, struct osd_object *obj) // Assume the OSD bar takes 2/3 of the OSD width at PlayResY=288 and // FontSize=22 with an OSD aspect ratio of 16:9. Rescale as needed. // xxx can fail when unknown fonts are involved - double asp = (double)osd->res.w / osd->res.h; + double asp = (double)obj->vo_res.w / obj->vo_res.h; double scale = (asp / 1.77777) * (obj->osd_track->PlayResY / 288.0); style->ScaleX = style->ScaleY = scale; style->FontSize = 22.0; @@ -282,8 +282,8 @@ void osd_object_get_bitmaps(struct osd_state *osd, struct osd_object *obj, if (!obj->osd_track) return; - ass_set_frame_size(osd->osd_render, osd->res.w, osd->res.h); - ass_set_aspect_ratio(osd->osd_render, osd->res.display_par, 1.0); + ass_set_frame_size(osd->osd_render, obj->vo_res.w, obj->vo_res.h); + ass_set_aspect_ratio(osd->osd_render, obj->vo_res.display_par, 1.0); mp_ass_render_frame(osd->osd_render, obj->osd_track, 0, &obj->parts_cache, out_imgs); talloc_steal(obj, obj->parts_cache); -- cgit v1.2.3