From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id DDF1045E41 for ; Wed, 12 Apr 2023 12:28:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7680768BB3C; Wed, 12 Apr 2023 15:27:57 +0300 (EEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 28C3468ABBC for ; Wed, 12 Apr 2023 15:27:49 +0300 (EEST) Received: from gem-name-lb-02.localdomain (pool-108-28-73-40.washdc.fios.verizon.net [108.28.73.40]) by linux.microsoft.com (Postfix) with ESMTPSA id E064921779BE for ; Wed, 12 Apr 2023 05:27:47 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E064921779BE From: Sil Vilerino To: ffmpeg-devel@ffmpeg.org Date: Wed, 12 Apr 2023 08:27:41 -0400 Message-Id: <20230412122741.474-3-sivileri@microsoft.com> X-Mailer: git-send-email 2.39.2.vfs.0.0 In-Reply-To: <20230412122741.474-1-sivileri@microsoft.com> References: <20230412122741.474-1-sivileri@microsoft.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 3/3] Update QSV after adding support for VAAPI on Windows: X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: - 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/ Reviewed-by: Dmitry Rogozhkin Reviewed-by: Wu, Tong1 --- 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..df5e1e05ca 100644 --- a/libavcodec/qsv_internal.h +++ b/libavcodec/qsv_internal.h @@ -23,9 +23,9 @@ #include "config.h" -#if CONFIG_VAAPI +#if CONFIG_VAAPI && !_WIN32 // Do not enable for libva-win32 on Windows #define AVCODEC_QSV_LINUX_SESSION_HANDLE -#endif //CONFIG_VAAPI +#endif //CONFIG_VAAPI && !_WIN32 #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE #include @@ -35,7 +35,6 @@ #endif #include #include -#include #include "libavutil/hwcontext_vaapi.h" #endif diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 6780428875..71212b177a 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 && _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".