From: Sil Vilerino <sivileri@linux.microsoft.com> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v4 3/3] lavu/hwcontext_qsv: Update after adding support for VAAPI on Windows Date: Fri, 14 Apr 2023 10:39:06 -0400 Message-ID: <20230414143906.1582-3-sivileri@linux.microsoft.com> (raw) In-Reply-To: <20230414143906.1582-1-sivileri@linux.microsoft.com> From: Sil Vilerino <sivileri@microsoft.com> - 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> --- libavcodec/qsv_internal.h | 5 ++--- libavutil/hwcontext_qsv.c | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h index 5119ef4dff..c2d301b4a2 100644 --- a/libavcodec/qsv_internal.h +++ b/libavcodec/qsv_internal.h @@ -23,9 +23,9 @@ #include "config.h" -#if CONFIG_VAAPI +#if CONFIG_VAAPI && !defined(_WIN32) // Do not enable for libva-win32 on Windows #define AVCODEC_QSV_LINUX_SESSION_HANDLE -#endif //CONFIG_VAAPI +#endif //CONFIG_VAAPI && !defined(_WIN32) #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE #include <stdio.h> @@ -35,7 +35,6 @@ #endif #include <fcntl.h> #include <va/va.h> -#include <va/va_drm.h> #include "libavutil/hwcontext_vaapi.h" #endif 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 -- 2.39.2.vfs.0.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-04-14 14:39 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-04-14 14:39 [FFmpeg-devel] [PATCH v4 1/3] lavu/hwcontext_vaapi: Add Windows/VAAPI support with vaGetDisplayWin32 Sil Vilerino 2023-04-14 14:39 ` [FFmpeg-devel] [PATCH v4 2/3] fftools/ffmpeg_opt: Document VAAPI -device usage for DirectX Adapter Sil Vilerino 2023-04-14 14:39 ` Sil Vilerino [this message] 2023-04-18 3:38 ` [FFmpeg-devel] [PATCH v4 1/3] lavu/hwcontext_vaapi: Add Windows/VAAPI support with vaGetDisplayWin32 Xiang, Haihao 2023-04-24 5:32 ` Xiang, Haihao
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230414143906.1582-3-sivileri@linux.microsoft.com \ --to=sivileri@linux.microsoft.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git