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 972B44A28C for ; Sun, 28 Apr 2024 07:40:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A7BED68D438; Sun, 28 Apr 2024 10:39:45 +0300 (EEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BE24C68D41A for ; Sun, 28 Apr 2024 10:39:35 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714289981; x=1745825981; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9utUtQXk8J352q+yR8ZI9MZfBLkNMfldk1YRYTuwOnI=; b=ZFpuRYYgO1dN3uDOSkRy71iRZ2utAXTKQOnH4WmADI68hCyChrM67PN4 P7d5lIcTlBJkmjNOiAmWtn56gIerifbcdKwSB+aY6WiemXHFiQHMVaIqh E7/3yH7SNeib5TWql+vfDXtbbw1Pcmqgyt+Z5IAt9oqg5v6zZRdmGcCJM 6+Eu5z+X4VAXviquRMYav64OAc2tm9Jua/WerYX7+iz2nNAHB8rapw+z3 ThEOosMMu8xraPihK7+VpUvo45q5FTxUISJkp4kyZhf+SQKdKZm9ZYMtK 64X0SOhy2A+Gnrs2e22OqNx7JLZ/3hC32L8joteiaL+quZSK5tY90hfgi g==; X-CSE-ConnectionGUID: MaRaLnEGTmuvI0guJLnx0w== X-CSE-MsgGUID: ovG6Y2YxTFqsGSZn6bfF+A== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="20662198" X-IronPort-AV: E=Sophos;i="6.07,237,1708416000"; d="scan'208";a="20662198" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2024 00:39:30 -0700 X-CSE-ConnectionGUID: C24MChKATs60wRRYpJBL/g== X-CSE-MsgGUID: ycgY6a5KR6ONgRa5kVmdcQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,237,1708416000"; d="scan'208";a="30491640" Received: from unknown (HELO xhh-dg264.sh.intel.com) ([10.238.2.76]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2024 00:39:29 -0700 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Sun, 28 Apr 2024 15:39:08 +0800 Message-Id: <20240428073911.423287-6-haihao.xiang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240428073911.423287-1-haihao.xiang@intel.com> References: <20240428073911.423287-1-haihao.xiang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 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 018d193495..ca1a88e49f 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -744,8 +744,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) { @@ -868,8 +869,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".