From 97c6425140aecc3910a622fb0ad7d79916cfebbe Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 19 Oct 2012 19:11:08 +0200 Subject: 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. --- sub/sub.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'sub/sub.h') diff --git a/sub/sub.h b/sub/sub.h index 3d40186b60..ecfd0c40cc 100644 --- a/sub/sub.h +++ b/sub/sub.h @@ -212,15 +212,20 @@ void vo_osd_reset_changed(void); bool vo_osd_has_changed(struct osd_state *osd); void osd_free(struct osd_state *osd); -bool osd_draw_sub(struct osd_state *osd, struct sub_bitmaps *out_imgs, - struct sub_render_params *sub_params, - const bool formats[SUBBITMAP_COUNT]); +enum mp_osd_draw_flags { + OSD_DRAW_SUB_FILTER = (1 << 0), + OSD_DRAW_SUB_ONLY = (1 << 1), +}; + +void osd_draw(struct osd_state *osd, struct sub_render_params *params, + int draw_flags, const bool formats[SUBBITMAP_COUNT], + void (*cb)(void *ctx, struct sub_bitmaps *imgs), void *cb_ctx); struct mp_image; struct mp_csp_details; -bool osd_draw_on_image(struct osd_state *osd, struct mp_image *dest, - struct mp_csp_details *dest_csp, - struct sub_render_params *sub_params); +bool osd_draw_on_image(struct osd_state *osd, struct sub_render_params *params, + int draw_flags, struct mp_image *dest, + struct mp_csp_details *dest_csp); bool sub_bitmaps_bb(struct sub_bitmaps *imgs, int *x1, int *y1, int *x2, int *y2); -- cgit v1.2.3