summaryrefslogtreecommitdiffstats
path: root/sub/sub.h
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 /sub/sub.h
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 'sub/sub.h')
-rw-r--r--sub/sub.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/sub/sub.h b/sub/sub.h
index 494b84379b..3ac160a323 100644
--- a/sub/sub.h
+++ b/sub/sub.h
@@ -72,14 +72,11 @@ struct sub_bitmaps {
struct sub_bitmap *parts;
int num_parts;
- // Provided for VOs with old code
- struct ass_image *imgs;
-
// Incremented on each change
int bitmap_id, bitmap_pos_id;
};
-struct mp_eosd_res {
+struct mp_osd_res {
int w, h; // screen dimensions, including black borders
int mt, mb, ml, mr; // borders (top, bottom, left, right)
double display_par;
@@ -111,6 +108,7 @@ struct osd_object {
// VO cache state
int vo_bitmap_id;
int vo_bitmap_pos_id;
+ struct mp_osd_res vo_res;
// Internally used by osd_libass.c
struct ass_track *osd_track;
@@ -124,12 +122,10 @@ struct osd_state {
struct ass_renderer *ass_renderer;
struct sh_sub *sh_sub;
double sub_offset;
- double vo_sub_pts;
+ double vo_pts;
bool render_subs_in_filter;
- struct mp_eosd_res res;
-
char *osd_text; // OSDTYPE_OSD
int progbar_type, progbar_value; // OSDTYPE_PROGBAR
@@ -204,14 +200,11 @@ extern float sub_fps;
extern int sub_justify;
-void draw_osd_with_eosd(struct vo *vo, struct osd_state *osd);
-
struct osd_state *osd_create(struct MPOpts *opts, struct ass_library *asslib);
void osd_set_text(struct osd_state *osd, const char *text);
-void osd_update(struct osd_state *osd, int dxs, int dys);
void vo_osd_changed(int new_value);
-void vo_osd_reset_changed(void);
-bool vo_osd_has_changed(struct osd_state *osd);
+void osd_reset_changed(struct osd_state *osd);
+bool osd_has_changed(struct osd_state *osd);
void osd_free(struct osd_state *osd);
enum mp_osd_draw_flags {
@@ -219,14 +212,15 @@ enum mp_osd_draw_flags {
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 osd_draw(struct osd_state *osd, struct mp_osd_res res,
+ double video_pts, 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 sub_render_params *params,
- int draw_flags, struct mp_image *dest,
+bool osd_draw_on_image(struct osd_state *osd, struct mp_osd_res res,
+ double video_pts, 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,