0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00
mpv/video/out
Philip Langdale 25fa1b0b45 hwdec/drmprime: add drmprime hwdec-interop
In the confusing landscape of hardware video decoding APIs, we have had
a long standing support gap for the v4l2 based APIs implemented for the
various SoCs from Rockship, Amlogic, Allwinner, etc. While VAAPI is the
defacto default for desktop GPUs, the developers who work on these SoCs
(who are not the vendors!) have preferred to implement kernel APIs
rather than maintain a userspace driver as VAAPI would require.

While there are two v4l2 APIs (m2m and requests), and multiple forks of
ffmpeg where support for those APIs languishes without reaching
upstream, we can at least say that these APIs export frames as DRMPrime
dmabufs, and that they use the ffmpeg drm hwcontext.

With those two constants, it is possible for us to write a
hwdec-interop without worrying about the mess underneath - for the most
part.

Accordingly, this change implements a hwdec-interop for any decoder
that produces frames as DRMPrime dmabufs. The bulk of the heavy
lifting is done by the dmabuf interop code we already had from
supporting vaapi, and which I refactored for reusability in a previous
set of changes.

When we combine that with the fact that we can't probe for supported
formats, the new code in this change is pretty simple.

This change also includes the hwcontext_fns that are required for us to
be able to configure the hwcontext used by `hwdec=drm-copy`. This is
technically unrelated, but it seemed a good time to fill this gap.

From a testing perspective, I have directly tested on a RockPRO64,
while others have tested with different flavours of Rockchip and on
Amlogic, providing m2m coverage.

I have some other SoCs that I need to spin up to test with, but I don't
expect big surprises, and when we inevitably need to account for new
special cases down the line, we can do so - we won't be able to support
every possible configuration blindly.
2022-08-09 10:19:18 -07:00
..
cocoa cocoa_common: remove deprecated VOCTRLs/VO_EVENTs 2019-12-12 19:56:03 +01:00
d3d11 vo_gpu/d3d11: fix VRAM leak 2022-07-21 16:13:45 +02:00
gpu hwdec/drmprime: add drmprime hwdec-interop 2022-08-09 10:19:18 -07:00
gpu_next vo_gpu_next: add support for hardware decoding 2022-03-03 13:06:05 +01:00
hwdec hwdec/drmprime: add drmprime hwdec-interop 2022-08-09 10:19:18 -07:00
mac various: fix typos 2022-04-25 09:07:18 -04:00
opengl drm: avoid drmModeAtomicCommit races by blocking 2022-08-03 16:42:49 +02:00
placebo libplacebo: fix compatibility with libplacebo >= 5 2022-07-16 13:06:21 +03:00
vulkan x11: avoid XPresent API calls when it's not needed 2022-06-22 18:09:11 +00:00
win32 vo_gpu: win: remove exclusive-fullscreen detection hack 2017-12-20 14:53:41 +11:00
android_common.c options: simplify --android-surface-size handling 2020-09-20 12:04:25 +02:00
android_common.h context_android: move common code to a separate file 2019-09-27 00:05:06 +03:00
aspect.c options: add --video-scale-x/y 2020-06-03 17:26:44 +02:00
aspect.h aspect: change license to LGPL 2017-06-17 17:08:51 +02:00
bitmap_packer.c video/out/bitmap_packer: Avoid empty initializer list 2019-11-18 16:50:21 +01:00
bitmap_packer.h bitmap_packer: remove some unused functions 2016-07-01 20:29:45 +02:00
cocoa_cb_common.swift mac: fix traditional fullscreen on macOS 11 2021-02-27 13:12:46 +01:00
cocoa_common.h osx: change license of OSX and cocoa files to LGPL 2017-06-24 16:29:22 +02:00
cocoa_common.m various: fix typos 2022-04-25 09:07:18 -04:00
dither.c video/out/dither: remove custom index_t typedef 2022-06-04 01:23:03 +02:00
dither.h gl_video: improve dithering 2013-05-26 16:44:20 +02:00
dr_helper.c client API: fix potential deadlock problems by throwing more shit at it 2019-09-26 14:14:49 +02:00
dr_helper.h client API: fix potential deadlock problems by throwing more shit at it 2019-09-26 14:14:49 +02:00
drm_atomic.c drm: context_drm_egl: add support for enabling VRR 2022-04-05 20:56:36 -07:00
drm_atomic.h drm: context_drm_egl: add support for enabling VRR 2022-04-05 20:56:36 -07:00
drm_common.c drm_common: skip cards that don't support KMS for autodetection 2022-08-03 16:43:08 +02:00
drm_common.h wayland: use mp_tag_str not drm_format_string 2022-05-30 19:51:46 +00:00
drm_prime.c drm_prime: fallback to drmModeAddFB2 2020-05-08 21:26:25 +02:00
drm_prime.h drm_prime: double free bug 2020-03-05 18:12:57 +01:00
filter_kernels.c various: fix typos 2022-04-25 09:07:18 -04:00
filter_kernels.h vo_opengl: refactor scaler LUT weight packing/loading 2017-09-04 13:53:14 +02:00
libmpv_sw.c client API: add software rendering API 2020-07-08 22:42:05 +02:00
libmpv.h client API: add software rendering API 2020-07-08 22:42:05 +02:00
present_sync.c vo: move wayland presentation to separate files 2022-06-19 18:13:55 +00:00
present_sync.h vo: move wayland presentation to separate files 2022-06-19 18:13:55 +00:00
vo_caca.c vo_caca: Implement VOCTRL_UPDATE_WINDOW_TITLE 2019-10-29 17:07:41 +01:00
vo_direct3d.c various: fix typos 2022-04-25 09:07:18 -04:00
vo_drm.c drm_common: enable specific device selection by means of path 2021-10-25 20:37:03 +02:00
vo_gpu_next.c vo_gpu_next: fix screenshots on single-frame files 2022-07-23 14:54:39 +02:00
vo_gpu.c vo_gpu[_next]: hwdec: fix logging regression when probing 2022-03-21 09:53:37 -07:00
vo_image.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_lavc.c encode: get rid of the output packet queue 2018-05-03 01:08:44 +03:00
vo_libmpv.c client API: add software rendering API 2020-07-08 22:42:05 +02:00
vo_mediacodec_embed.c vo_mediacodec_embed: fix forgotten VO_CAP_NOREDRAW→VO_CAP_NORETAIN 2018-02-20 01:59:20 +02:00
vo_null.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_rpi.c vo_rpi: fix DISPMANX_UPDATE_HANDLE_T leak 2021-09-28 16:46:52 +00:00
vo_sdl.c sub: rename SUBBITMAP_RGBA to SUBBITMAP_BGRA 2022-01-11 23:45:08 +02:00
vo_sixel.c vo_sixel: don't divide by zero on small terminal 2020-12-02 17:06:11 +02:00
vo_tct.c vo_tct: add resize capability 2021-08-26 11:29:07 -07:00
vo_vaapi_wayland.c vo_vaapi_wayland: remove vaapi format query as formats are never used 2022-06-21 14:05:19 +00:00
vo_vaapi.c x11: support xorg present extension 2022-06-19 18:13:55 +00:00
vo_vdpau.c various: fix typos 2022-04-25 09:07:18 -04:00
vo_wlshm.c vo: move wayland presentation to separate files 2022-06-19 18:13:55 +00:00
vo_x11.c x11: avoid XPresent API calls when it's not needed 2022-06-22 18:09:11 +00:00
vo_xv.c x11: avoid XPresent API calls when it's not needed 2022-06-22 18:09:11 +00:00
vo.c vo: allow vaapi_wayland and vaapi_x11 to coexist 2022-05-30 19:51:46 +00:00
vo.h vd_lavc: add vo caps and option to set GPU film grain application 2022-04-05 15:02:18 +02:00
w32_common.c various: remove trailing whitespace 2022-05-14 14:51:34 +00:00
w32_common.h w32_common, w32_keyboard: change license to LGPL 2017-06-24 12:54:45 +02:00
wayland_common.c wayland: add missing newline in wayland_common 2022-07-23 19:56:48 +00:00
wayland_common.h vo: move wayland presentation to separate files 2022-06-19 18:13:55 +00:00
win_state.c win_state: add vo_calc_window_geometry3 2021-09-06 10:16:10 +03:00
win_state.h win_state: add vo_calc_window_geometry3 2021-09-06 10:16:10 +03:00
x11_common.c x11: avoid XPresent API calls when it's not needed 2022-06-22 18:09:11 +00:00
x11_common.h x11: avoid XPresent API calls when it's not needed 2022-06-22 18:09:11 +00:00