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 C5E8D492E5 for ; Wed, 8 May 2024 06:05:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2757468D58B; Wed, 8 May 2024 09:04:38 +0300 (EEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 36D0A68D552 for ; Wed, 8 May 2024 09:04:31 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715148277; x=1746684277; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UGevvelseabWubLKuphvb9QQre3o00WAAq33pG+ERDo=; b=Q2qE9PzBF5EmaoD4CkDAAVcXlwpRQg8n9y1aYUxPj/akKA6oAFkIMDce zqrYWlj4Fb3zZLAAxNbHcL9DFzwIaqu96sT/tnrU8SjnQk2OYCgOJQ3YJ RTCgDik5ADnPbJ2yk7+oIFo78xFiTpc8CK5A/ieIL+RavZr9ef3TK65LX 9xTXHTZKsi+rcn/+3D3pSQ9F9xjtEck30BldvYq+8OUNKmMaE5xGjicFw o5qweLuzej8BADDn2SvUmI9KIcBr2Hovgu3f8tNnN20rfqeSx1SKbg3uE nSvAKipk+s39DvfRBksjpnuqG+r6s+5r9FRnUWVf7q3/ctw/QaA3CwW5X w==; X-CSE-ConnectionGUID: aW0zpA7ZSx6fKYy3fvO9CQ== X-CSE-MsgGUID: BPYu7kajRNa/WqptWU9FxQ== X-IronPort-AV: E=McAfee;i="6600,9927,11066"; a="10855360" X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="10855360" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2024 23:04:25 -0700 X-CSE-ConnectionGUID: iofZvZmoTkGhXiSEcRKq7Q== X-CSE-MsgGUID: LDksYjzVRwKC3gv36VKhlw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,144,1712646000"; d="scan'208";a="28828793" Received: from unknown (HELO xhh-dg264.sh.intel.com) ([10.238.2.76]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2024 23:04:23 -0700 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Wed, 8 May 2024 14:03:13 +0800 Message-Id: <20240508060316.681114-6-haihao.xiang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240508060316.681114-1-haihao.xiang@intel.com> References: <20240508060316.681114-1-haihao.xiang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 6/9] lavc/qsvenc: use the right info for encoding 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: Haihao Xiang 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: From: Haihao Xiang Signed-off-by: Haihao Xiang --- libavcodec/qsvenc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index d881c11160..3df355ce78 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -745,8 +745,9 @@ static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q) if (avctx->hw_frames_ctx) { AVHWFramesContext *frames_ctx = (AVHWFramesContext *)avctx->hw_frames_ctx->data; AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx; - q->param.mfx.FrameInfo.Width = frames_hwctx->surfaces[0].Info.Width; - q->param.mfx.FrameInfo.Height = frames_hwctx->surfaces[0].Info.Height; + mfxFrameInfo *info = frames_hwctx->nb_surfaces ? &frames_hwctx->surfaces[0].Info : frames_hwctx->info; + q->param.mfx.FrameInfo.Width = info->Width; + q->param.mfx.FrameInfo.Height = info->Height; } if (avctx->framerate.den > 0 && avctx->framerate.num > 0) { @@ -869,8 +870,9 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) if (avctx->hw_frames_ctx) { AVHWFramesContext *frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data; AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx; - q->param.mfx.FrameInfo.Width = frames_hwctx->surfaces[0].Info.Width; - q->param.mfx.FrameInfo.Height = frames_hwctx->surfaces[0].Info.Height; + mfxFrameInfo *info = frames_hwctx->nb_surfaces ? &frames_hwctx->surfaces[0].Info : frames_hwctx->info; + q->param.mfx.FrameInfo.Width = info->Width; + q->param.mfx.FrameInfo.Height = info->Height; } if (avctx->framerate.den > 0 && avctx->framerate.num > 0) { -- 2.34.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".