Commit Graph

13 Commits

Author SHA1 Message Date
wm4 fff90422d1 lavu: add new D3D11 pixfmt and hwcontext
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 <robux4@gmail.com>, but with
heavy changes/rewrites.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-08 20:55:36 +02:00
Mark Thompson c5714b51aa hwcontext: Improve allocation in derived contexts
Use the flags argument of av_hwframe_ctx_create_derived() to pass the
mapping flags which will be used on allocation.  Also, set the format
and hardware context on the allocated frame automatically - the user
should not be required to do this themselves.
2017-04-30 17:33:18 +01:00
Mark Thompson 27978155bc hwcontext: Add frame context mapping for nontrivial contexts
Some frames contexts are not usable without additional format-specific
state in hwctx.  This change adds new functions frames_derive_from and
frames_derive_to to initialise this state appropriately when deriving
a frames context which will require it to be set.
2017-04-30 16:13:56 +01:00
Mark Thompson b266ad56fe hwcontext: Add device derivation
Creates a new device context from another of a different type which
refers to the same underlying hardware.
2017-03-20 23:15:43 +00:00
Mark Thompson d06aa24ba5 hwcontext: Hardware frame mapping
Adds the new av_hwframe_map() function, which allows mapping between
hardware frames and normal memory, along with internal support for
implementing it.

Also adds av_hwframe_ctx_create_derived(), for creating a hardware
frames context associated with one device using frames mapped from
another by some hardware-specific means.
2016-11-03 23:49:01 +00:00
Anton Khirnov 59e7361cc7 hwcontext: add a QSV implementation 2016-06-21 19:53:37 +02:00
Anton Khirnov 1c9e8616c5 hwcontext: add a function for opening devices 2016-05-26 15:40:32 +02:00
Anton Khirnov c46db38cde hwcontext: add a dxva2 implementation 2016-05-17 09:11:25 +02:00
Mark Thompson 551c6775ab lavu: VAAPI hwcontext implementation
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-19 15:40:22 +01:00
Mark Thompson b1f01e85a9 lavu: add a way to query hwcontext frame constraints
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-19 15:38:00 +01:00
Anton Khirnov ad884d1002 hwcontext: add a CUDA implementation 2016-02-14 22:08:33 +01:00
Anton Khirnov a001ce31bc hwcontext: add a VDPAU implementation 2016-02-14 22:06:04 +01:00
Anton Khirnov 89923e418b lavu: add a framework for handling hwaccel frames 2016-02-14 21:36:59 +01:00