From 8e6704acdbe020aacc71dbe15981651d6bcca25e Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 17 Jun 2016 23:11:05 +0200 Subject: sub, vo_opengl: use packed sub-bitmaps directly if available The previous few commits changed sd_lavc.c's output to packed RGB sub- images. In particular, this means all sub-bitmaps are part of a larger, single bitmap. Change the vo_opengl OSD code such that it can make use of this, and upload the pre-packed image, instead of packing and copying them again. This complicates the upload code a bit (4 code paths due to messy PBO handling). The plan is to make sub-bitmaps always packed, but some more work is required to reach this point. The plan is to pack libass images as well. Since this implies a copy, this will make it easy to refcount the result. (This is all targeted towards vo_opengl. Other VOs, vo_xv, vo_x11, and vo_wayland in particular, will become less efficient. Although at least vo_vdpau and vo_direct3d could be switched to the new method as well.) --- sub/img_convert.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sub/img_convert.c') diff --git a/sub/img_convert.c b/sub/img_convert.c index 2015e49ca6..348811e773 100644 --- a/sub/img_convert.c +++ b/sub/img_convert.c @@ -80,6 +80,7 @@ bool osd_scale_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs) talloc_free(c->parts); imgs->parts = c->parts = talloc_array(c, struct sub_bitmap, src.num_parts); + imgs->packed = NULL; // Note: we scale all parts, since most likely all need scaling anyway, and // to get a proper copy of all data in the imgs list. @@ -158,6 +159,7 @@ bool osd_conv_ass_to_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs) imgs->format = SUBBITMAP_RGBA; imgs->parts = c->part; imgs->num_parts = num_bb; + imgs->packed = NULL; size_t newsize = 0; for (int n = 0; n < num_bb; n++) { -- cgit v1.2.3