summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-30 22:27:37 +0200
committerwm4 <wm4@nowhere>2013-10-05 22:46:55 +0200
commitae9a3e33aafaa0d708d54e2c42a563e45dadb0f7 (patch)
treedcdd7a4ee2e1b6456c69b02a90a15fad410fbff3 /sub
parentfd49edccf811de0d6c61f30d8b2b524f8df93b36 (diff)
downloadmpv-ae9a3e33aafaa0d708d54e2c42a563e45dadb0f7.tar.bz2
mpv-ae9a3e33aafaa0d708d54e2c42a563e45dadb0f7.tar.xz
command: add commands for displaying overlays
Requested by github issue #255. Does not work where mmap is not available (i.e. Windows).
Diffstat (limited to 'sub')
-rw-r--r--sub/sub.c5
-rw-r--r--sub/sub.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/sub/sub.c b/sub/sub.c
index cc4a76c065..9be61bd1d3 100644
--- a/sub/sub.c
+++ b/sub/sub.c
@@ -163,6 +163,11 @@ static void render_object(struct osd_state *osd, struct osd_object *obj,
sub_pts -= osd->video_offset - opts->sub_delay;
sub_get_bitmaps(osd->dec_sub, obj->vo_res, sub_pts, out_imgs);
}
+ } else if (obj->type == OSDTYPE_EXTERNAL2) {
+ if (osd->external2.format) {
+ *out_imgs = osd->external2;
+ osd->external2.bitmap_id = osd->external2.bitmap_pos_id = 0;
+ }
} else {
osd_object_get_bitmaps(osd, obj, out_imgs);
}
diff --git a/sub/sub.h b/sub/sub.h
index 1118fec5c1..64e10193ea 100644
--- a/sub/sub.h
+++ b/sub/sub.h
@@ -91,6 +91,7 @@ enum mp_osdtype {
OSDTYPE_OSD,
OSDTYPE_EXTERNAL,
+ OSDTYPE_EXTERNAL2,
MAX_OSD_PARTS
};
@@ -144,6 +145,8 @@ struct osd_state {
// OSDTYPE_EXTERNAL
char *external;
int external_res_x, external_res_y;
+ // OSDTYPE_EXTERNAL2
+ struct sub_bitmaps external2;
// OSDTYPE_SUB
struct dec_sub *dec_sub;