diff options
author | wm4 <wm4@nowhere> | 2016-03-08 21:54:17 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-03-08 22:01:57 +0100 |
commit | 876a3bafc5a0cb491ee1f1d5e928cd6e6ef530a8 (patch) | |
tree | af35260c02da290067e7a5b6bd1d5860cbb1ea7d /sub/osd.h | |
parent | 75a36662cb6bb0c8a2aeb3a4034d3f8dc745bbdd (diff) | |
download | mpv-876a3bafc5a0cb491ee1f1d5e928cd6e6ef530a8.tar.bz2 mpv-876a3bafc5a0cb491ee1f1d5e928cd6e6ef530a8.tar.xz |
osd: cleanup: make OSDTYPE_ constants private to OSD code
No need to have them everywhere. The only exception/annoyance is
MAX_OSD_PARTS, which is now basically duplicated (and at runtime
initialization is checked with an assert()).
Diffstat (limited to 'sub/osd.h')
-rw-r--r-- | sub/osd.h | 19 |
1 files changed, 5 insertions, 14 deletions
@@ -78,17 +78,8 @@ struct mp_osd_res { double display_par; }; -enum mp_osdtype { - OSDTYPE_SUB, - OSDTYPE_SUB2, // IDs must be numerically successive - - OSDTYPE_OSD, - - OSDTYPE_EXTERNAL, - OSDTYPE_EXTERNAL2, - - MAX_OSD_PARTS -}; +// 0 <= sub_bitmaps.render_index < MAX_OSD_PARTS +#define MAX_OSD_PARTS 5 // Start of OSD symbols in osd_font.pfb #define OSD_CODEPOINTS 0xE000 @@ -149,8 +140,8 @@ void osd_free(struct osd_state *osd); bool osd_query_and_reset_want_redraw(struct osd_state *osd); -void osd_set_text(struct osd_state *osd, int obj, const char *text); -void osd_set_sub(struct osd_state *osd, int obj, struct dec_sub *dec_sub); +void osd_set_text(struct osd_state *osd, const char *text); +void osd_set_sub(struct osd_state *osd, int index, struct dec_sub *dec_sub); bool osd_get_render_subs_in_filter(struct osd_state *osd); void osd_set_render_subs_in_filter(struct osd_state *osd, bool s); @@ -188,7 +179,7 @@ void osd_draw_on_image_p(struct osd_state *osd, struct mp_osd_res res, struct mp_image_params; struct mp_osd_res osd_res_from_image_params(const struct mp_image_params *p); -struct mp_osd_res osd_get_vo_res(struct osd_state *osd, int obj); +struct mp_osd_res osd_get_vo_res(struct osd_state *osd); void osd_rescale_bitmaps(struct sub_bitmaps *imgs, int frame_w, int frame_h, struct mp_osd_res res, double compensate_par); |