summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorSil Vilerino <sivileri@microsoft.com>2023-04-14 10:39:06 -0400
committerHaihao Xiang <haihao.xiang@intel.com>2023-04-24 13:24:41 +0800
commita9a2ddaea8318cec43ca916b6b8350f0cf14411d (patch)
treef56c810b44b618a1b4236f6b4273ff9aa4ee5c84 /libavutil
parent5ff14304524f508c429eac8322f0d70458ecd04c (diff)
downloadffmpeg-a9a2ddaea8318cec43ca916b6b8350f0cf14411d.tar.gz
lavu/hwcontext_qsv: Update after adding support for VAAPI on Windows
- qsv_internal.h: Remove unnecessary include va_drm.h - qsv_internal.h: Enable AVCODEC_QSV_LINUX_SESSION_HANDLE on Linux/VA only - hwcontext_qsv.c: Do not allow child_device_type VAAPI for Windows until support is added, keep D3D11/DXVA2 as more prioritary defaults. Initial review at https://github.com/intel-media-ci/ffmpeg/pull/619/ Signed-off-by: Sil Vilerino <sivileri@microsoft.com> Reviewed-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com> Reviewed-by: Wu, Tong1 <tong1.wu@intel.com>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/hwcontext_qsv.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
index 6780428875..4ed4242ddf 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -2126,8 +2126,6 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device,
"\"%s\".\n", e->value);
return AVERROR(EINVAL);
}
- } else if (CONFIG_VAAPI) {
- child_device_type = AV_HWDEVICE_TYPE_VAAPI;
#if QSV_ONEVPL
} else if (CONFIG_D3D11VA) { // Use D3D11 by default if d3d11va is enabled
av_log(ctx, AV_LOG_VERBOSE,
@@ -2147,11 +2145,23 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device,
} else if (CONFIG_D3D11VA) {
child_device_type = AV_HWDEVICE_TYPE_D3D11VA;
#endif
+ } else if (CONFIG_VAAPI) {
+ child_device_type = AV_HWDEVICE_TYPE_VAAPI;
} else {
av_log(ctx, AV_LOG_ERROR, "No supported child device type is enabled\n");
return AVERROR(ENOSYS);
}
+#if CONFIG_VAAPI && defined(_WIN32)
+ /* AV_HWDEVICE_TYPE_VAAPI on Windows/Libva-win32 not supported */
+ /* Reject user specified child_device_type or CONFIG_VAAPI on Windows */
+ if (child_device_type == AV_HWDEVICE_TYPE_VAAPI) {
+ av_log(ctx, AV_LOG_ERROR, "VAAPI child device type not supported for oneVPL on Windows"
+ "\"%s\".\n", e->value);
+ return AVERROR(EINVAL);
+ }
+#endif
+
child_device_opts = NULL;
switch (child_device_type) {
#if CONFIG_VAAPI