mpv/player
wm4 e9e883e3b2 video: make OSD/subtitle bitmaps refcounted (sort of)
Making OSD/subtitle bitmaps refcounted was planend a longer time ago,
e.g. the sub_bitmaps.packed field (which refcounts the subtitle bitmap
data) was added in 2016. But nothing benefited much from it, because
struct sub_bitmaps was usually stack allocated, and there was this weird
callback stuff through osd_draw().

Make it possible to get actually refcounted subtitle bitmaps on the OSD
API level. For this, we just copy all subtitle data other than the
bitmaps with sub_bitmaps_copy(). At first, I had planned some fancy
refcount shit, but when that was a big mess and hard to debug and just
boiled to emulating malloc(), I made it a full allocation+copy. This
affects mostly the parts array. With crazy ASS subtitles, this parts
array can get pretty big (thousands of elements or more), in which case
the extra alloc/copy could become performance relevant. But then again
this is just pure bullshit, and I see no need to care. In practice, this
extra work most likely gets drowned out by libass murdering a single
core (while mpv is waiting for it) anyway. So fuck it.

I just wanted this so draw_bmp.c requires only a single call to render
everything. VOs also can benefit from this, because the weird callback
shit isn't necessary anymore (simpler code), but I haven't done anything
about it yet. In general I'd hope this will work towards simplifying the
OSD layer, which is prerequisite for making actual further improvements.

I haven't tested some cases such as the "overlay-add" command. Maybe it
crashes now? Who knows, who cares.

In addition, it might be worthwhile to reduce the code duplication
between all the things that output subtitle bitmaps (with repacking,
image allocation, etc.), but that's orthogonal.
2020-04-26 23:34:32 +02:00
..
javascript js: osd-overlay update: return the command result (match 7a76b577) 2020-03-07 12:37:35 +02:00
lua stats.lua: don't disable terminal escape sequences on windows 2020-04-23 17:02:38 +03:00
audio.c f_decoder_wrapper: replace most public fields with setters/getters 2020-02-29 01:23:20 +01:00
client.c client API: report IDs of inserted playlist entries on loading playlist 2020-03-27 00:57:11 +01:00
client.h scripting: remove race condition when toggling internal scripts 2020-03-26 23:59:44 +01:00
command.c video: make OSD/subtitle bitmaps refcounted (sort of) 2020-04-26 23:34:32 +02:00
command.h command: use client IDs for hooks 2020-03-26 23:40:25 +01:00
configfiles.c player: fix minor coding style issue 2020-01-26 14:29:48 +01:00
core.h player: remove duplicated track option setter code 2020-04-15 17:10:01 +02:00
external_files.c external_files: add .lrc subtitle extension 2019-09-02 01:25:43 +03:00
external_files.h player: get rid of mpv_global.opts 2018-05-24 19:56:35 +02:00
javascript.c js: make wait_event autofree 2020-03-22 00:53:30 +02:00
loadfile.c player: remove duplicated track option setter code 2020-04-15 17:10:01 +02:00
lua.c lua: wrap existing allocator instead of reimplementing it 2020-04-09 02:21:09 +02:00
main.c player, ta: remove use of an old macro 2020-04-13 15:56:27 +02:00
misc.c player: slightly improve use of secondary track selection limits 2020-04-15 17:04:00 +02:00
osd.c f_decoder_wrapper: replace most public fields with setters/getters 2020-02-29 01:23:20 +01:00
playloop.c player, stats: more silly debug stuff 2020-04-10 00:55:39 +02:00
screenshot.c screenshot: fix typo in comment 2020-02-07 13:42:42 +01:00
screenshot.h player: make screenshot each-frame mode more accurate 2020-02-07 13:32:21 +01:00
scripting.c scripting: remove race condition when toggling internal scripts 2020-03-26 23:59:44 +01:00
sub.c player: slightly improve use of secondary track selection limits 2020-04-15 17:04:00 +02:00
video.c video: remove another redundant wakeup 2020-04-10 01:33:38 +02:00