summaryrefslogtreecommitdiffstats
path: root/sub/sub.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-21 17:59:24 +0100
committerwm4 <wm4@nowhere>2012-11-21 19:56:59 +0100
commitea4332daf49c373c03612b7ed683f05383f843d6 (patch)
tree7a0c8dcd2cf78e6085d002aebc4537771a4aba3e /sub/sub.h
parent264b5124e702ecda1f9290b772ae7df68233acd3 (diff)
downloadmpv-ea4332daf49c373c03612b7ed683f05383f843d6.tar.bz2
mpv-ea4332daf49c373c03612b7ed683f05383f843d6.tar.xz
vo_xv: don't require frame stepping to remove OSD or subs
In order to improve performance, vo_xv didn't create a backup of the video frame before drawing OSD and subtitles during normal playback. It required the frontend to do frame stepping if it wanted to redraw the OSD, but no backup of the video frame was available. (Consider the following use case: enable the OSD permanently with --osd-level=3, then pause during playback and do something that shows an OSD message. The player will advance the video by one frame at the time the new OSD message is first drawn.) This also meant that taking a screenshot during playback with vo_xv would include OSD and subtitles in the resulting image. Fix this by always creating a backup before drawing OSD or subtitles. In order to avoid having to create a full copy of the whole image frame, introduce a complex scheme that tries to backup only the changed regions. It's unclear whether the additional complexity in draw_bmp.c for backing up only the changed areas of the frame is worth it. Possibly a simpler implementation would suffice, such as tracking only Y ranges of changed image data, or even just copying the full frame. vo_xv's get_screenshot() now always creates a copy in order not to modify the currently displayed frame.
Diffstat (limited to 'sub/sub.h')
-rw-r--r--sub/sub.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sub/sub.h b/sub/sub.h
index f894682596..205aa953d7 100644
--- a/sub/sub.h
+++ b/sub/sub.h
@@ -223,6 +223,11 @@ struct mp_image;
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_draw_sub_backup;
+void osd_draw_on_image_bk(struct osd_state *osd, struct mp_osd_res res,
+ double video_pts, int draw_flags,
+ struct mp_draw_sub_backup *bk, struct mp_image *dest);
+
struct mp_rect;
bool sub_bitmaps_bb(struct sub_bitmaps *imgs, struct mp_rect *out_bb);