From patchwork Fri Apr 1 09:24:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, Tong1" X-Patchwork-Id: 35127 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c05:b0:7a:e998:b410 with SMTP id bw5csp532948pzb; Fri, 1 Apr 2022 02:25:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCy86zplyzJkQRBInclwSL2COgZ0K+59KPJ77reREZCFzu1jVDbUd2PkqR0LlYiQSMi2jM X-Received: by 2002:a17:907:1c1c:b0:6e4:e488:4e76 with SMTP id nc28-20020a1709071c1c00b006e4e4884e76mr202552ejc.93.1648805128783; Fri, 01 Apr 2022 02:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648805128; cv=none; d=google.com; s=arc-20160816; b=LvPWJTH3ipXsFy6o5etasJyjgzGdYLyKVYoVfwT45+ED3K0z9B791cgXAJ8x1FRIuq cK5cfvbmcJy3quS1OZ0K5E/kIipNGRKZfK5nLs6PC3GVuKaIHGebTXxntXa/FbKcOeVd kLpqf91HL9a14vtS2u3Ryl+VmdjiUNhobVoTCRyrIC6gAu5P61+pZ3Mi5iV7/pBj34oc QB9a5fqfETsYh1/ndRhTrkPj7Afdj57HtYufavcDuOvAQ40f/F7kpPvppwqL9tX3cmIm CHfvkOfljA/sJPuFQBcLTNTLAQsh4Vv9DlU8UpJGI7H08lA3w7u6KXCmmzPRejLLa+GT 9/Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=tjnP/lJ6sfmMndgEwfq1kclWDwVub5MpEzvKrUSsaWU=; b=QRnR80LTj4VsRKhoFQiK1dg5hzUmdv1cQC0hYd18AdGucPyNbnKMMyzVOrJNTpY8FB uh367gpfiqDI2gJoBf2XfM2L4c7wvqbRMK7nQBmkkW45bUASHKOwJ/Gbgdq21jHClxLL zob35LbwBSbdJev8hmIpm17JkET+Bf5x4hj5/XSBIAvW4QLx22gzt2s1np9EwPc2u0bK I5brNuT5cf9ibKMbaJdlo01yyFzFS0qJ3jHOIUk1N19Gv9d4p8GRyNUFW15TDSRSCyhK KJx2DIFtN/uqhZGoM/33TqEV0PtwGwzOTqkk+lej/Pth+3VfJ5/8PyPw/vcz5HvNmpXH 6jlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=LUO+0SCW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c18-20020aa7d612000000b00418c2b5bedbsi1213068edr.445.2022.04.01.02.25.28; Fri, 01 Apr 2022 02:25:28 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=LUO+0SCW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 77D8E68B1FB; Fri, 1 Apr 2022 12:25:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 02A3868B1FB for ; Fri, 1 Apr 2022 12:25:13 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648805119; x=1680341119; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y6ynxT6GUgbYYzqFDK6tfemPWko2HFzRRfOypMa3S2A=; b=LUO+0SCWcKfWH1+PBTkfJKqUsYX8DII76Y3tCcKV2m/LyPb0yntsx6kG YurygEG3zbB2tyXuxJfBLaM6rW8Rhax7Psnlovcy80YB9unH64Wt6nmh5 NveZMpcj/YW1yvl9iqlCfqnE1i/8YJmYnaV5aPYKkusUfpaI5DS1Wga66 SxfVqEnrcG9OjR9BkTmZlUEIIkL60TlQA4ditPBNMkmR4jJjFZ/H9ruTR G9JjBsc+ua74GXkrJPPilBCDgNL1RTSv5aX21L8FJR405Y/R6CaQJVqVl T79BSR3e/U2E/T86dHZ//YpxkU1tsC9/QHht41KO/6B/014+IzD8PcClg g==; X-IronPort-AV: E=McAfee;i="6200,9189,10303"; a="323261244" X-IronPort-AV: E=Sophos;i="5.90,226,1643702400"; d="scan'208";a="323261244" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2022 02:25:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,226,1643702400"; d="scan'208";a="567328782" Received: from desktop-qn7n0nf.sh.intel.com (HELO localhost.localdomain) ([10.239.160.39]) by orsmga008.jf.intel.com with ESMTP; 01 Apr 2022 02:25:11 -0700 From: Tong Wu To: ffmpeg-devel@ffmpeg.org Date: Fri, 1 Apr 2022 17:24:15 +0800 Message-Id: <20220401092416.1018-2-tong1.wu@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20220401092416.1018-1-tong1.wu@intel.com> References: <20220401092416.1018-1-tong1.wu@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] avutil/hwcontext_d3d11va: fix the uninitialized texture bindflag 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 Cc: Tong Wu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: KeQIm+P48Kuy When uploading rawvideos using d3d11va hardware framecontext, the bindflag is not initialized and will cause creating texture failure. Now fix it, assign it the value of D3D11_BIND_RENDER_TARGET. Signed-off-by: Tong Wu --- libavutil/hwcontext_d3d11va.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c index f69fb3fc9c..0ec0e07d3a 100644 --- a/libavutil/hwcontext_d3d11va.c +++ b/libavutil/hwcontext_d3d11va.c @@ -254,6 +254,11 @@ static int d3d11va_frames_init(AVHWFramesContext *ctx) return AVERROR(EINVAL); } + if (!hwctx->BindFlags) { + av_log(ctx, AV_LOG_DEBUG, "Add render target bindflag for texture\n"); + hwctx->BindFlags = D3D11_BIND_RENDER_TARGET; + } + texDesc = (D3D11_TEXTURE2D_DESC){ .Width = ctx->width, .Height = ctx->height,