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 87D3A42739 for ; Fri, 29 Apr 2022 10:45:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0723F68B2ED; Fri, 29 Apr 2022 13:45:34 +0300 (EEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D67D368B2BB for ; Fri, 29 Apr 2022 13:45:26 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651229132; x=1682765132; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e9C1vP8NgnnNfZQzDyHeYAxB8Utt9cASHFgTPUHzycs=; b=lezDPN2aVeIUEnFRCX9PeE3PRT4p1V/uKGvD6fcIz0v56HPOgq0YY5aV ydoAtzn/qHfbiNgjq3rO5Uc+/pbcGXL0qt5OUH7L78mjyYZMP6FnWz8rz G3743G3KVYgLkofFZxQxD/8MqsNiCJ2NxHh+wovCL+osQIYAve6tbDU0O OYVciC1/Em6DD4wEn9cq0nShmodZxBt0Ma75BlieA3YWJutsFKOAVy5Ux B7Of/tkDwkqoJVFbb4XobneOBqalvzEQtUejDYCHnzOUq8hRyhXbQ3rTS lzC5VlOQjN2rXpBS7EM1mKGxx5fGt4E52X5LitsXRZptKakS6SqclA6AL g==; X-IronPort-AV: E=McAfee;i="6400,9594,10331"; a="329548332" X-IronPort-AV: E=Sophos;i="5.91,298,1647327600"; d="scan'208";a="329548332" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 03:45:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,298,1647327600"; d="scan'208";a="566080510" Received: from gtapc.iind.intel.com (HELO localhost.localdomain) ([10.190.235.42]) by fmsmga007.fm.intel.com with ESMTP; 29 Apr 2022 03:45:19 -0700 From: Tong Wu To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Apr 2022 10:45:04 +0000 Message-Id: <20220429104505.1747-4-tong1.wu@intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429104505.1747-1-tong1.wu@intel.com> References: <20220429104505.1747-1-tong1.wu@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 4/5] avutil/hwcontext_qsv: map QSV frames to D3D11VA frames 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 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: When input is a rawvideo, after mapping QSV frames to D3D11VA frames, the output will have green frames. Now fix it. Fixes: $ ffmpeg.exe -y -init_hw_device d3d11va=d3d11 \ -init_hw_device qsv=qsv@d3d11 -s:v WxH -pix_fmt nv12 -i input.yuv \ -vf "format=nv12,hwupload=extra_hw_frames=16,\ hwmap=derive_device=d3d11va,format=d3d11,hwdownload,format=nv12" \ -f rawvideo output.yuv Signed-off-by: Tong Wu --- libavutil/hwcontext_qsv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index d9d05e936a..6bc920ef59 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -915,7 +915,7 @@ static int qsv_map_from(AVHWFramesContext *ctx, if (child_frames_ctx->device_ctx->type == AV_HWDEVICE_TYPE_D3D11VA) { mfxHDLPair *pair = (mfxHDLPair*)surf->Data.MemId; dst->data[0] = pair->first; - dst->data[1] = pair->second; + dst->data[1] = pair->second == (mfxMemId)MFX_INFINITE ? (uint8_t *)0 : pair->second; } else { dst->data[3] = child_data; } @@ -945,7 +945,7 @@ static int qsv_map_from(AVHWFramesContext *ctx, if (child_frames_ctx->device_ctx->type == AV_HWDEVICE_TYPE_D3D11VA) { mfxHDLPair *pair = (mfxHDLPair*)surf->Data.MemId; dummy->data[0] = pair->first; - dummy->data[1] = pair->second; + dummy->data[1] = pair->second == (mfxMemId)MFX_INFINITE ? (uint8_t *)0 : pair->second; } else { dummy->data[3] = child_data; } -- 2.35.1 _______________________________________________ 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".