[FFmpeg-devel] [PATCH v5 3/9] libavutil/hwcontext_d3d11va: adding the vendor option to d3d11va device creation
Zhong Li
lizhong1008 at gmail.com
Tue May 19 11:19:50 EEST 2020
<artem.galin at gmail.com> 于2020年5月19日周二 上午2:56写道:
>
> From: Artem Galin <artem.galin at intel.com>
>
> Example: --init_hw_device d3d11va:,vendor=0x8086
>
> qsv_device option is still works and has higher priority over vendor
> option.
Would be nice if you can document it in ffmpeg.texi.
> Signed-off-by: Artem Galin <artem.galin at intel.com
> ---
> libavutil/hwcontext_d3d11va.c | 39 +++++++++++++++++++++++++++++++++--
> 1 file changed, 37 insertions(+), 2 deletions(-)
>
> diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
> index c8ae58f908..b644a0a4fd 100644
> --- a/libavutil/hwcontext_d3d11va.c
> +++ b/libavutil/hwcontext_d3d11va.c
> @@ -517,9 +517,12 @@ static int d3d11va_device_create(AVHWDeviceContext *ctx, const char *device,
> AVD3D11VADeviceContext *device_hwctx = ctx->hwctx;
>
> HRESULT hr;
> + AVDictionaryEntry *e;
> IDXGIAdapter *pAdapter = NULL;
> ID3D10Multithread *pMultithread;
> UINT creationFlags = D3D11_CREATE_DEVICE_VIDEO_SUPPORT;
> + int adapter = -1;
> + long int vendor_id = -1;
if you want 64bits, long long int or int64_t can make sure that.
> int is_debug = !!av_dict_get(opts, "debug", NULL, 0);
> int ret;
>
> @@ -539,13 +542,45 @@ static int d3d11va_device_create(AVHWDeviceContext *ctx, const char *device,
> return AVERROR_UNKNOWN;
> }
>
> + e = av_dict_get(opts, "vendor", NULL, 0);
> + if (e) {
> + vendor_id = strtol(e->value, NULL, 0);
> + }
More information about the ffmpeg-devel
mailing list