mpv/video
wm4 7aa070e1cb vdpau: crappy hack to allow initializing hw decoding after preemption
If vo_opengl is used, and vo_opengl already created the vdpau interop
(for whatever reasons), and then preemption happens, and then you try to
enable hw decoding, it failed. The reason was that preemption recovery
is not run at any point before libavcodec accesses the vdpau device.

The actual impact was that with libmpv + opengl-cb use, hardware
decoding was permanently broken after display mode switching (something
that caused the display to get preempted at least with older drivers).
With mpv CLI, you can for example enable hw decoding during playback,
then disable it, VT switch to console, switch back to X, and try to
enable hw decoding again.

This is mostly because libav* does not deal with preemption, and NVIDIA
driver preemption behavior being horrible garbage. In addition to being
misdesigned API, the preemption callback is not called before you try to
access vdpau API, and then only with _some_ accesses.

In summary, the preemption callback was never called, neither before nor
after libavcodec tried to init the decoder. So we have to get
mp_vdpau_handle_preemption() called before libavcodec accesses it. This
in turn will do a dummy API access which usually triggers the preemption
callback immediately (with NVIDIA's drivers).

In addition, we have to update the AVHWDeviceContext's device. In theory
it could change (in practice it usually seems to use handle "0").
Creating a new device would cause chaos, as we don't have a concept of
switching the device context on the fly. So we simply update it
directly. I'm fairly sure this violates the libav* API, but it's the
best we can do.
2017-05-19 15:24:38 +02:00
..
decode vdpau: crappy hack to allow initializing hw decoding after preemption 2017-05-19 15:24:38 +02:00
filter vf.c, vf.h: change license to LGPL 2017-05-11 15:02:58 +02:00
out context_angle: fix fallback to D3D9 device 2017-05-16 22:59:15 +10:00
csputils.c csputils: code clarity 2017-05-13 17:25:24 +02:00
csputils.h demux: expose demuxer colorimetry metadata to player 2016-11-08 19:16:26 +01:00
fmt-conversion.c Remove compatibility things 2016-12-07 19:53:11 +01:00
fmt-conversion.h Update license headers 2015-04-13 12:10:01 +02:00
gpu_memcpy.c Fix misspellings 2016-06-26 13:47:21 +02:00
gpu_memcpy.h video: refactor GPU memcpy usage 2015-09-25 19:18:16 +02:00
hwdec.c vd_lavc, vaapi: move hw device creation to generic code 2017-02-20 08:39:55 +01:00
hwdec.h vdpau: crappy hack to allow initializing hw decoding after preemption 2017-05-19 15:24:38 +02:00
image_writer.c image_writer: make it work with libavcodec's jpg encoder 2017-04-02 17:21:42 +02:00
image_writer.h screenshot: change details of --screenshot-format handling 2017-03-18 15:03:05 +01:00
img_format.c img_format: stop setting some fields to dummy values for hwaccel formats 2017-02-21 10:35:38 +01:00
img_format.h vo_opengl: hwdec_cuda: Support P016 output surfaces 2016-11-22 20:19:58 +01:00
img_fourcc.h
mp_image.c mp_image: for hwaccel, use underlying fmt in mp_image_params_guess_csp() 2017-02-21 10:34:26 +01:00
mp_image.h lavfi: use mp_image to store the filter pad format 2017-02-20 13:15:50 +01:00
mp_image_pool.c mp_image_tool: guard hw downloading against allocation failures 2017-02-07 17:06:20 +01:00
mp_image_pool.h vaapi: use libavutil functions for copying hw surfaces to memory 2017-01-12 13:58:28 +01:00
sws_utils.c build: replace some FFmpeg API checks with version checks 2017-01-24 08:11:42 +01:00
sws_utils.h
vaapi.c vdpau, vaapi: unref libavutil device ref 2017-04-29 15:09:40 +02:00
vaapi.h vd_lavc, vaapi: move hw device creation to generic code 2017-02-20 08:39:55 +01:00
vdpau.c vdpau: crappy hack to allow initializing hw decoding after preemption 2017-05-19 15:24:38 +02:00
vdpau.h vdpau: support new vdpau libavcodec decode API 2017-03-23 11:14:11 +01:00
vdpau_functions.inc vo_vdpau: directly get surface size from surface for screenshots 2015-06-05 22:34:16 +02:00
vdpau_mixer.c vo_opengl: vdpau: fix certain cases of preemption recovery failures 2016-05-03 13:56:11 +02:00
vdpau_mixer.h vo_opengl: vdpau: fix certain cases of preemption recovery failures 2016-05-03 13:56:11 +02:00
vt.c vo_opengl: hwdec_osx: use new format setup function 2017-02-17 17:08:37 +01:00
vt.h videotoolbox: add reverse format mapping function 2017-02-17 13:51:03 +01:00