1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-20 22:02:59 +00:00
mpv/player
wm4 67689ff6b4 client API: preparations for allowing render API to use DR etc.
DR (letting the decoder allocate texture memory) requires running the
allocation on the render thread. This is rather hard with the render
API, because the user controls this thread and when it's entered. It was
not possible until now.

This commit adds a bunch of infrastructure to make this possible. We add
a new optional mode (MPV_RENDER_PARAM_ADVANCED_CONTROL) which basically
lets the user's render thread and libmpv agree how this should be done.

Misuse would lead to deadlocks. To make this less likely, strictly
document thread safety/locking issues. In particular, document which
libmpv functions can be called without issues. (The rest has to be
assumed unsafe.)

The worst issue is destruction of the render context while video is
still active. To avoid certain unintended recursive locks (i.e.
deadlocks, unless we'd make the locks recursive), make the update
callback lock separate. Make "killing" the video chain asynchronous, so
we can do extra work while video is being destroyed.

Because losing wakeups is a big deal, setting the update callback now
triggers a wakeup. (It would have been better if the wakeup callback
were a parameter to mpv_render_context_create(), but too late.)

This commit does not add DR yet; the following commit does this.
2018-04-29 02:21:32 +03:00
..
javascript js: use new hooks API (match f60826c3) 2018-04-07 16:02:20 -07:00
lua ytdl_hook: don't log error when loading is aborted 2018-04-15 21:07:13 +03:00
audio.c audio: fix EOF handling if there was no data at all 2018-04-20 12:34:43 +02:00
client.c client API: preparations for allowing render API to use DR etc. 2018-04-29 02:21:32 +03:00
client.h client API: preparations for allowing render API to use DR etc. 2018-04-29 02:21:32 +03:00
command.c demux, player: mark dependent tracks 2018-04-17 01:01:50 +03:00
command.h player: fix hook processing consistency and code duplication issues 2018-03-26 23:06:50 -07:00
configfiles.c player: silence config file loading message on resuming 2018-01-13 03:26:45 -08:00
core.h player: remove in_dispatch field 2018-04-18 01:17:42 +03:00
external_files.c player: make track language matching case insensitive 2017-12-23 15:14:13 -07:00
external_files.h external_files: change license to LGPL 2017-06-20 14:22:10 +02:00
javascript.c js: use new hooks API (match f60826c3) 2018-04-07 16:02:20 -07:00
loadfile.c scripting: change when/how player waits for scripts being loaded 2018-04-18 01:17:41 +03:00
lua.c client API: add a first class hook API, and deprecate old API 2018-03-26 23:02:23 -07:00
main.c client API: cleanup mpv_handle termination 2018-03-15 00:00:04 -07:00
misc.c options: move most subtitle and OSD rendering options to sub structs 2018-01-02 14:27:37 -08:00
osd.c video: make decoder wrapper a filter 2018-01-30 03:10:27 -08:00
playloop.c player: remove in_dispatch field 2018-04-18 01:17:42 +03:00
screenshot.c vo_gpu: make screenshots use the GL renderer 2018-02-11 17:45:51 -08:00
screenshot.h player: make screenshot commands honor the async flag 2017-04-01 20:47:23 +02:00
scripting.c scripting: change when/how player waits for scripts being loaded 2018-04-18 01:17:41 +03:00
sub.c video: make decoder wrapper a filter 2018-01-30 03:10:27 -08:00
video.c vo: pass through framedrop flag differently 2018-03-15 23:13:53 -07:00