lavu: add new D3D11 pixfmt and hwcontext

Multimedia / FFmpeg - wm4 [googlemail.com] - 27 June 2017 12:05 EDT

To be used with the new d3d11 hwaccel decode API.

With the new hwaccel API, we don't want surfaces to depend on the decoder (other than the required dimension and format). The old D3D11VA pixfmt uses ID3D11VideoDecoderOutputView pointers, which include the decoder configuration, and thus is incompatible with the new hwaccel API. This patch introduces AV_PIX_FMT_D3D11, which uses ID3D11Texture2D and an index. It's simpler and compatible with the new hwaccel API.

The introduced hwcontext supports only the new pixfmt.

Frame upload code untested.

Significantly based on work by Steve Lhomme, but with heavy changes/rewrites.

Merges Libav commit fff90422d181744cd75dbf011687ee7095f02875.

3303511 lavu: add new D3D11 pixfmt and hwcontext
doc/APIchanges | 3 +
libavutil/Makefile | 3 +
libavutil/hwcontext.c | 4 +
libavutil/hwcontext.h | 1 +
libavutil/hwcontext_d3d11va.c | 490 +++++++++++++++++++++++++++++++++++++++++
libavutil/hwcontext_d3d11va.h | 160 ++++++++++++++
libavutil/hwcontext_internal.h | 1 +
libavutil/pixdesc.c | 4 +
libavutil/pixfmt.h | 14 +-
libavutil/version.h | 2 +-
10 files changed, 680 insertions(+), 2 deletions(-)

  • Share