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 1D6D54A42D for ; Thu, 28 Mar 2024 02:17:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E868F68D70A; Thu, 28 Mar 2024 04:17:42 +0200 (EET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ED97068D6EB for ; Thu, 28 Mar 2024 04:17:35 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711592262; x=1743128262; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dimF0bmVjubApKBUH0BS26DIrpkZzlZs4c+4ilaW1V8=; b=SQSIUCVurnpjs3sSeGSbELl0sNUHwXrLS/MilCLJMeOZ/kz2NB+0taW3 sMBtoSGYTugpFBZJBmhpdKPajH62YiTQoyHt4zpstdPt3LA1K6p4B0QKe 8Av5pB/Bs4FJLUubyNF9RZEjx07KwKZ23IX/E1eAvvbX0d01QsXlY+gW1 gpeyVH1WXYleBiy4gT7bE0IFHewfJWv3hURqHm950M8z3Im2i5mNHR6C4 v+xsECBz999C6Bv+pgFS1bZAAh7EWvXylWwMU8iFXJcFiQuAHc87ndEji ZUVwt7xtZHPm/lkY1CHWKsyjTrT7izhWVk3qloPlmuAO9GrfugMTLsKuV Q==; X-CSE-ConnectionGUID: LLRfB6peRwOxWovCzmN8jA== X-CSE-MsgGUID: gUVSCvh+R5qBT8jc7HLpxw== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="6664788" X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="6664788" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 19:17:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="16890306" Received: from xhh-dg264.sh.intel.com ([10.238.2.76]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 19:17:29 -0700 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Thu, 28 Mar 2024 10:17:17 +0800 Message-Id: <20240328021717.4116418-3-haihao.xiang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240328021717.4116418-1-haihao.xiang@intel.com> References: <20240328021717.4116418-1-haihao.xiang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] lavfi/vaapi_vpp: Use dynamic frame pool in outlink if possible 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 This can fix the broken cases for the driver/hardware combination which doesn't rely on fixed surface-array. For example: $ ffmpeg -hwaccel_output_format vaapi -hwaccel vaapi -i input.mp4 \ -vf 'scale_vaapi=w=720:h=480' -c:v hevc_vaapi -f null - Signed-off-by: Haihao Xiang --- libavfilter/vaapi_vpp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavfilter/vaapi_vpp.c b/libavfilter/vaapi_vpp.c index 59961bfa4a..0755d674ac 100644 --- a/libavfilter/vaapi_vpp.c +++ b/libavfilter/vaapi_vpp.c @@ -203,7 +203,10 @@ int ff_vaapi_vpp_config_output(AVFilterLink *outlink) output_frames->width = ctx->output_width; output_frames->height = ctx->output_height; - output_frames->initial_pool_size = 4; + if (ctx->hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_DYNAMIC_SURFACE_POOL) + output_frames->initial_pool_size = 0; + else + output_frames->initial_pool_size = 4; err = ff_filter_init_hw_frames(avctx, outlink, 10); if (err < 0) @@ -219,6 +222,8 @@ int ff_vaapi_vpp_config_output(AVFilterLink *outlink) va_frames = output_frames->hwctx; av_assert0(ctx->va_context == VA_INVALID_ID); + av_assert0(output_frames->initial_pool_size || + (va_frames->surface_ids == NULL && va_frames->nb_surfaces == 0)); vas = vaCreateContext(ctx->hwctx->display, ctx->va_config, ctx->output_width, ctx->output_height, VA_PROGRESSIVE, -- 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".