Merge pull request #21049 from sivanov-work:vpl_dx11_merge

G-API: oneVPL merge DX11 acceleration

* Merge DX11 initial

* Fold conditions row in MACRO in utils

* Inject DeviceSelector

* Turn on DeviceSelector in DX11

* Change sharedLock logic & Move FMT checking in FrameAdapter c-tor

* Move out NumSuggestFrame to configure params

* Drain file source fix

* Fix compilation

* Force zero initializetion of SharedLock

* Fix some compiler warnings

* Fix integer comparison warnings

* Fix integers in sample

* Integrate Demux

* Fix compilation

* Add predefined names for some CfgParam

* Trigger CI

* Fix MultithreadCtx bug, Add Dx11 GetBlobParam(), Get rif of ATL CComPtr

* Fix UT: remove unit test with deprecated video from opencv_extra

* Add creators for most usable CfgParam

* Eliminate some warnings

* Fix warning in GAPI_Assert

* Apply comments

* Add VPL wrapped header with MSVC pragma to get rid of global warning masking
This commit is contained in:
Sergey Ivanov
2021-12-08 10:09:33 +03:00
committed by GitHub
parent 41d108ead6
commit 5c91f5b71d
49 changed files with 3231 additions and 866 deletions
@@ -46,9 +46,72 @@ struct GAPI_EXPORTS CfgParam {
double_t,
void*,
std::string>;
/**
* @brief frames_pool_size_name
*
* Special configuration parameter name for onevp::GSource:
*
* @note frames_pool_size_name allows to allocate surfaces pool appropriate size to keep
* decoded frames in accelerator memory ready before
* they would be consumed by onevp::GSource::pull operation. If you see
* a lot of WARNING about lack of free surface then it's time to increase
* frames_pool_size_name but be aware of accelerator free memory volume.
* If not set then MFX implementation use
* mfxFrameAllocRequest::NumFrameSuggested behavior
*
*/
static constexpr const char *frames_pool_size_name() { return "frames_pool_size"; }
static CfgParam create_frames_pool_size(uint64_t value);
/**
* Create onevp::GSource configuration parameter.
* @brief acceleration_mode_name
*
* Special configuration parameter names for onevp::GSource:
*
* @note acceleration_mode_name allows to activate hardware acceleration &
* device memory management.
* Supported values:
* - MFX_ACCEL_MODE_VIA_D3D11 Will activate DX11 acceleration and will produces
* MediaFrames with data allocated in DX11 device memory
*
* If not set then MFX implementation will use default acceleration behavior:
* all decoding operation uses default GPU resources but MediaFrame produces
* data allocated by using host RAM
*
*/
static constexpr const char *acceleration_mode_name() { return "mfxImplDescription.AccelerationMode"; }
static CfgParam create_acceleration_mode(uint32_t value);
static CfgParam create_acceleration_mode(const char* value);
/**
* @brief decoder_id_name
*
* Special configuration parameter names for onevp::GSource:
*
* @note decoder_id_name allows to specify VPL decoder type which MUST present
* in case of RAW video input data and MUST NOT present as CfgParam if video
* stream incapsulated into container(*.mp4, *.mkv and so on). In latter case
* onevp::GSource will determine it automatically
* Supported values:
* - MFX_CODEC_AVC
* - MFX_CODEC_HEVC
* - MFX_CODEC_MPEG2
* - MFX_CODEC_VC1
* - MFX_CODEC_CAPTURE
* - MFX_CODEC_VP9
* - MFX_CODEC_AV1
*
*/
static constexpr const char *decoder_id_name() { return "mfxImplDescription.mfxDecoderDescription.decoder.CodecID"; }
static CfgParam create_decoder_id(uint32_t value);
static CfgParam create_decoder_id(const char* value);
static constexpr const char *implementation_name() { return "mfxImplDescription.Impl"; }
static CfgParam create_implementation(uint32_t value);
static CfgParam create_implementation(const char* value);
/**
* Create generic onevp::GSource configuration parameter.
*
*@param name name of parameter.
*@param value value of parameter.