1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-18 13:14:36 +00:00
mpv/filters
wm4 a3823ce0e0 player: add optional separate video decoding thread
See manpage additions. This has been a topic in MPlayer/mplayer2/mpv
since forever. But since libavcodec multi-threaded decoding was added,
I've always considered this pointless. libavcodec requires you to
"preload" it with packets, and then you can pretty much avoid blocking
on it, if decoding is fast enough.

But in some cases, a decoupled decoder thread _might_ help. Users have
for example come up with cases where decoding video in a separate
process and piping it as raw video to mpv helped. (Or my memory is
false, and it was about vapoursynth filtering, who knows.) So let's just
see whether this helps with anything.

Note that this would have been _much_ easier if libavcodec had an
asynchronous (or rather, non-blocking) API. It could probably have
easily gained that with a small change to its multi-threading code and a
small extension to its API, but I guess not.

Unfortunately, this uglifies f_decoder_wrapper quite a lot. Part of this
is due to annoying corner cases like legacy frame dropping and hardware
decoder state. These could probably be prettified later on.

There is also a change in playloop.c: this is because there is a need to
coordinate playback resets between demuxer thread, decoder thread, and
playback logic. I think this SEEK_BLOCK idea worked out reasonably well.

There are still a number of problems. For example, if the demuxer cache
is full, the decoder thread will simply block hard until the output
queue is full, which interferes with seeking. Could also be improved
later. Hardware decoding will probably die in a fire, because it will
run out of surfaces quickly. We could reduce the queue to size 1...
maybe later. We could update the queue options at runtime easily, but
currently I'm not going to bother.

I could only have put the lavc wrapper itself on a separate thread. But
there is some annoying interaction with EDL and backward playback shit,
and also you would have had to loop demuxer packets through the
playloop, so this sounded less annoying.

The food my mother made for us today was delicious.

Because audio uses the same code, also for audio (even if completely
pointless).

Fixes: #6926
2020-02-29 21:52:00 +01:00
..
f_async_queue.c filter: add async queue filter 2020-02-29 21:52:00 +01:00
f_async_queue.h filter: add async queue filter 2020-02-29 21:52:00 +01:00
f_auto_filters.c f_auto_filters: always fall back to hw-download+yadif if no hw deint filter 2020-02-16 15:28:57 +01:00
f_auto_filters.h
f_autoconvert.c f_autoconvert: remove subfmt conversion BS 2020-01-17 15:19:05 +01:00
f_autoconvert.h f_autoconvert: remove subfmt conversion BS 2020-01-17 15:19:05 +01:00
f_decoder_wrapper.c player: add optional separate video decoding thread 2020-02-29 21:52:00 +01:00
f_decoder_wrapper.h f_decoder_wrapper: replace most public fields with setters/getters 2020-02-29 01:23:20 +01:00
f_demux_in.c f_demux_in: give it a slightly better filter name 2018-02-05 02:47:14 -08:00
f_demux_in.h video: make decoder wrapper a filter 2018-01-30 03:10:27 -08:00
f_hwtransfer.c f_hwtransfer: extend vaapi whitelist with some working formats 2020-01-17 15:13:23 +01:00
f_hwtransfer.h f_hwtransfer: move format fields to private struct 2020-01-12 01:47:42 +01:00
f_lavfi.c f_lavfi: don't propagate filter failure if creation fails 2020-02-16 16:21:03 +01:00
f_lavfi.h options: pre-check filter names when using vf/af libavfilter bridge 2019-11-25 20:29:42 +01:00
f_output_chain.c f_autoconvert: remove subfmt conversion BS 2020-01-17 15:19:05 +01:00
f_output_chain.h f_output_chain: fix typo 2018-04-15 23:11:33 +03:00
f_swresample.c Remove remains of Libav compatibility 2020-02-16 15:14:55 +01:00
f_swresample.h swresample: limit output size of audio frames 2018-02-03 05:01:29 -08:00
f_swscale.c video: mess with the filte chain to enable zimg IMGFMT_RGB30 output 2019-11-02 17:50:32 +01:00
f_swscale.h video: mess with the filte chain to enable zimg IMGFMT_RGB30 output 2019-11-02 17:50:32 +01:00
f_utils.c filters: add another dumb helper 2019-10-02 21:09:30 +02:00
f_utils.h filters: add another dumb helper 2019-10-02 21:09:30 +02:00
filter_internal.h
filter.c filter: decide how multi-threading is supposed to work 2020-02-29 21:49:14 +01:00
filter.h filter: add async queue filter 2020-02-29 21:52:00 +01:00
frame.c Implement backwards playback 2019-09-19 20:37:04 +02:00
frame.h Implement backwards playback 2019-09-19 20:37:04 +02:00
user_filters.c build: downgrade EGL requirement from 1.5 to 1.4 2019-12-16 00:37:18 +01:00
user_filters.h vf_gpu: add video filter using vo_gpu's renderer 2019-11-29 20:37:11 +01:00