diff options
author | wm4 <wm4@nowhere> | 2012-10-19 19:11:08 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-24 21:56:33 +0200 |
commit | 97c6425140aecc3910a622fb0ad7d79916cfebbe (patch) | |
tree | ff88672104e0533839e28bfcb9e8e0f4420f4e89 /sub/sub.h | |
parent | 98f74335d509320f19db2da8786273f95cad2a69 (diff) | |
download | mpv-97c6425140aecc3910a622fb0ad7d79916cfebbe.tar.bz2 mpv-97c6425140aecc3910a622fb0ad7d79916cfebbe.tar.xz |
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.
Diffstat (limited to 'sub/sub.h')
-rw-r--r-- | sub/sub.h | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -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); |