[vlc-devel] [PATCH 0/7] Windows CPU to GPU filters

Steve Lhomme robux4 at videolabs.io
Thu May 11 09:36:02 CEST 2017

As we may gain CPU filters when using hardware decoding, that means we will need
filters that can transform CPU pictures into GPU pictures for rendering. This set
of patches adds the necessary filters for Direct3D11 and Direct3D9. The GPU to
CPU filters already exist (dxa9 and d3d11_surface).

Patches 1 and 2 are just code cleaning. This patchset also goes on top of
already submited patches:
- directx_va: clean the dx_sys calls with macros
- directx_va: log when we don't create the VA because we don't have dimensions

Patch 3 moves the "GPU buffer into picture planes" function outside of
win32/common.c, so I put it in the core as the code itself is not really
related to Windows and could be used on other platforms to do the same.

Patch 4 was already submitted and use the plane setup code from the core to
determine the exact plane dimensions necessary to allocate memory. If we are
going to use GPU memory as CPU memory we should have the same alignment/padding
constraints so it's better to share this code.

Patch 5 is just a macro I use in the new code but that should be used
everywhere we print a fourcc with %4.4s in the code.

Patches 6 and 7 and the conversion filters for D3D11 and D3D9.

Steve Lhomme (7):
  d3d11_fmt: share the code to release the picture_sys_t data
  direct3d9: add a shared header to describe the VLC_CODEC_D3D9_OPAQUE
  picture: move the win32 texture buffer to plane setup in the core
  picture: split the plane definition from the picture creation
  vlc_fourcc: add a macro to get the string for a FOURCC
  video_chroma: add a filter to convert from CPU to a D3D11 surface
  video_chroma: add a filter to convert from CPU to a D3D9 surface

 include/vlc_fourcc.h                           |   2 +
 include/vlc_picture.h                          |  26 +++
 modules/MODULES_LIST                           |   2 +
 modules/codec/Makefile.am                      |   3 +-
 modules/codec/avcodec/dxva2.c                  |   6 +-
 modules/video_chroma/Makefile.am               |  12 +-
 modules/video_chroma/d3d11_fmt.h               |  26 +++
 modules/video_chroma/d3d11_from_cpu.c          | 268 +++++++++++++++++++++++++
 modules/video_chroma/d3d9_fmt.h                |  37 ++++
 modules/video_chroma/d3d9_from_cpu.c           | 261 ++++++++++++++++++++++++
 modules/video_chroma/dxa9.c                    |   6 +-
 modules/video_output/Makefile.am               |   6 +-
 modules/video_output/win32/common.c            |  52 +----
 modules/video_output/win32/direct3d11.c        |  32 +--
 modules/video_output/win32/direct3d9.c         |  10 +-
 modules/video_output/win32/dxva2_deinterlace.c |   6 +-
 src/libvlccore.sym                             |   2 +
 src/misc/picture.c                             |  72 ++++++-
 18 files changed, 717 insertions(+), 112 deletions(-)
 create mode 100644 modules/video_chroma/d3d11_from_cpu.c
 create mode 100644 modules/video_chroma/d3d9_fmt.h
 create mode 100644 modules/video_chroma/d3d9_from_cpu.c


More information about the vlc-devel mailing list