1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-22 07:46:55 +00:00
mpv/video/out/opengl
wm4 f5ff2656e0 vaapi: determine surface format in decoder, not in renderer
Until now, we have made the assumption that a driver will use only 1
hardware surface format. the format is dictated by the driver (you
don't create surfaces with a specific format - you just pass a
rt_format and get a surface that will be in a specific driver-chosen
format).

In particular, the renderer created a dummy surface to probe the format,
and hoped the decoder would produce the same format. Due to a driver
bug this required a workaround to actually get the same format as the
driver did.

Change this so that the format is determined in the decoder. The format
is then passed down as hw_subfmt, which allows the renderer to configure
itself with the correct format. If the hardware surface changes its
format midstream, the renderer can be reconfigured using the normal
mechanisms.

This calls va_surface_init_subformat() each time after the decoder
returns a surface. Since libavcodec/AVFrame has no concept of sub-
formats, this is unavoidable. It creates and destroys a derived
VAImage, but this shouldn't have any bad performance effects (at
least I didn't notice any measurable effects).

Note that vaDeriveImage() failures are silently ignored as some
drivers (the vdpau wrapper) support neither vaDeriveImage, nor EGL
interop. In addition, we still probe whether we can map an image
in the EGL interop code. This is important as it's the only way
to determine whether EGL interop is supported at all. With respect
to the driver bug mentioned above, it doesn't matter which format
the test surface has.

In vf_vavpp, also remove the rt_format guessing business. I think the
existing logic was a bit meaningless anyway. It's not even a given
that vavpp produces the same rt_format for output.
2016-04-11 22:03:26 +02:00
..
common.c vo_opengl: log if glGetString(GL_VERSION) returns NULL 2016-04-08 10:57:21 +02:00
common.h vo_opengl: always premultiply alpha 2016-03-29 21:56:38 +02:00
context_angle.c Change GPL/LGPL dual-licensed files to LGPL 2016-01-19 18:36:34 +01:00
context_cocoa.c vo_opengl: always premultiply alpha 2016-03-29 21:56:38 +02:00
context_drm_egl.c vo_opengl: add KMS/DRM VAAPI hardware decoding interop 2016-01-20 19:41:29 +01:00
context_dxinterop.c vo_opengl: only open one OpenGL/DX interop handle when using dxva2 2016-03-15 17:04:58 -07:00
context_rpi.c Change GPL/LGPL dual-licensed files to LGPL 2016-01-19 18:36:34 +01:00
context_rpi.h vo_opengl: prefix per-backend source files with context_ 2015-12-19 14:14:12 +01:00
context_w32.c Change GPL/LGPL dual-licensed files to LGPL 2016-01-19 18:36:34 +01:00
context_wayland.c vo_opengl: wayland: don't destroy NULL wl_egl_window 2016-03-03 15:30:28 +01:00
context_x11.c vo_opengl: always premultiply alpha 2016-03-29 21:56:38 +02:00
context_x11egl.c Change GPL/LGPL dual-licensed files to LGPL 2016-01-19 18:36:34 +01:00
context.c vo_opengl: GLX: try to create 3.3 core profile context 2016-03-19 19:31:17 +01:00
context.h vo_opengl: GLX: try to create 3.3 core profile context 2016-03-19 19:31:17 +01:00
egl_helpers.c Change GPL/LGPL dual-licensed files to LGPL 2016-01-19 18:36:34 +01:00
egl_helpers.h vo_opengl: x11egl: retrieve framebuffer depth 2015-12-19 14:14:12 +01:00
header_fixes.h Enable building the opengl-cb video renderer on Android 2016-02-10 21:29:42 +01:00
hwdec_dxva2.c vo_opengl: hwdec: use IDs for API, and log which backend is used 2016-02-01 20:02:52 +01:00
hwdec_dxva2egl.c vo_opengl: dxva2egl: ignore alpha component in the mapped video 2016-03-17 14:58:49 +01:00
hwdec_dxva2gldx.c vo_opengl: only open one OpenGL/DX interop handle when using dxva2 2016-03-15 17:04:58 -07:00
hwdec_osx.c vo_opengl: videotoolbox: use kCVPixelBufferLock_ReadOnly for screenshots 2016-04-07 19:55:51 +02:00
hwdec_vaegl.c vaapi: determine surface format in decoder, not in renderer 2016-04-11 22:03:26 +02:00
hwdec_vaglx.c vo_opengl: hwdec: use IDs for API, and log which backend is used 2016-02-01 20:02:52 +01:00
hwdec_vdpau.c vo_opengl: vdpau: call glVDPAUFiniNV only if initialized 2016-02-08 13:39:33 +01:00
hwdec.c vo_opengl: add dxva2 interop to angle backend 2016-03-10 15:49:55 -08:00
hwdec.h videotoolbox: change how videotoolbox format is managed 2016-04-07 19:54:58 +02:00
lcms.c gl_lcms: choose BT.1886 gamma per-channel 2016-04-01 10:27:32 +02:00
lcms.h vo_opengl: generate 3DLUT against source and use full BT.1886 2016-04-01 10:27:27 +02:00
nnedi3_weights.bin vo_opengl: implement NNEDI3 prescaler 2015-11-05 17:38:20 +01:00
nnedi3.c vo_opengl: fix build breakage 2016-04-06 01:21:16 +02:00
nnedi3.h vo_opengl: fix nnedi + rectangle textures 2016-04-05 20:57:02 +02:00
osd.c vo_opengl, osd: allow osc.lua to react faster on resizes 2016-03-21 22:23:41 +01:00
osd.h vo_opengl, osd: allow osc.lua to react faster on resizes 2016-03-21 22:23:41 +01:00
superxbr.c vo_opengl: decrease default superxbr-edge-strength 2016-03-07 22:31:15 +01:00
superxbr.h vo_opengl: refactor superxbr algorithm 2016-03-07 22:31:15 +01:00
utils.c vo_opengl: slightly compress gl_set_debug_logger() 2016-03-28 18:07:41 +02:00
utils.h vo_opengl: fix row-major vs. column-major confusion 2016-03-28 16:16:09 +02:00
video_shaders.c vo_opengl: generate 3DLUT against source and use full BT.1886 2016-04-01 10:27:27 +02:00
video_shaders.h vo_opengl: fix sharpen filter 2016-03-16 19:09:52 +01:00
video.c vo_opengl: improve rotation handling (again) 2016-04-08 22:21:38 +02:00
video.h vo_opengl: improve rotation handling (again) 2016-04-08 22:21:38 +02:00