From 3365514951e9c07ec3a21bb3898e5796c214f8b7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 28 Sep 2012 21:38:52 +0200 Subject: sub: allow rendering OSD in ASS image format directly, simplify Before this commit, the OSD was drawn using libass, but the resulting bitmaps were converted to the internal mplayer OSD format. We want to get rid of the old OSD format, because it's monochrome, and can't even be rendered directly using modern video output methods (like with OpenGL/Direct3D/VDPAU). Change it so that VOs can get the ASS images directly, without additional conversions. (This also has the consequence that the OSD can render colors now.) Currently, this is vo_gl3 only. The other VOs still use the old method. Also, the old OSD format is still used for all VOs with DVD subtitles (spudec). Rewrite sub.c. Remove all the awkward flags and bounding boxes and change detection things. It turns out that much of that isn't needed. Move code related to converting subtitle images to img_convert.c. (It has to be noted that all of these conversions were already done before in some places, and that the new code actually makes less use of them.) --- sub/img_convert.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sub/img_convert.h (limited to 'sub/img_convert.h') diff --git a/sub/img_convert.h b/sub/img_convert.h new file mode 100644 index 0000000000..c40a8de2e4 --- /dev/null +++ b/sub/img_convert.h @@ -0,0 +1,16 @@ +#ifndef MPLAYER_SUB_IMG_CONVERT_H +#define MPLAYER_SUB_IMG_CONVERT_H + +#include + +struct osd_conv_cache; +struct sub_bitmaps; + +struct osd_conv_cache *osd_conv_cache_new(void); + +// These functions convert from one OSD format to another. On success, they copy +// the converted image data into c, and change imgs to point to the data. +bool osd_conv_old_p_to_old(struct osd_conv_cache *c, struct sub_bitmaps *imgs); +bool osd_conv_ass_to_old_p(struct osd_conv_cache *c, struct sub_bitmaps *imgs); + +#endif -- cgit v1.2.3