From patchwork Thu Nov 18 04:05:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xu, Guangxin" X-Patchwork-Id: 31464 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp220527iob; Wed, 17 Nov 2021 20:10:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRfNsqMe0aYjy8JuP2JqSJiPkOwhmQW3fPiuNXp8ZFvJMWXirDqorugAe2u4rT0WoogtK+ X-Received: by 2002:a17:907:7242:: with SMTP id ds2mr29350987ejc.269.1637208651867; Wed, 17 Nov 2021 20:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637208651; cv=none; d=google.com; s=arc-20160816; b=iquXH8yuIRUNZ4efQUIe09FXCwFq+pPSTjrUwvE0yffGtOakW0deA9d0cckmBWy0oC DIBVGw7ieENfVhiNe/ebnh1vgkb3LQfHFbFBoUwtCiXm3xxnEa9Sq8khgpZ6xwuGfRSb hAKybzmrpNpm+fM8KLG9aRsVjSPEKw5LuEMXFsP80cA1ALJ/KPULwfGUZ+gnSulevf/C TV7n/yhbE1fEj6EO7Zg1+1MDYlqmA6Z2AAnlmunOR12d5ovwTFhSszK8+kZBIfqhTE5I tlxD5odqZv0ju1eL77t046JGfFtWPBIPHllhRd90ZPBMxpQYUKLvaPji/iYIbQztYeVp A9lw== 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:message-id:date:to:from :delivered-to; bh=IaXK8qIOLrDIuAVRE2OzSzendhIox7uPXrTWKWg/mkE=; b=egwDrm8cK21iQtLtOirxIRh9nlerJWJCVRi/uSKnfzp6+Q7r+KcgJwyLN2xdKPoCvS VsleJc1F+K8uAiNtIPSU+Yx0Bo2NsPb8UT6zYKzJzLf4fTLtKwXlyQxqrg1fqcuJxJqA 7SgE3Q8ItPONFXgTQEUxzaMwczfKvmuMjhdZRh4aIhKyRAiy/v0gsGNCz0pG6brYZjJT 1sNhuwZXI1w0lasNd34OUHionu+npQeey582VnCgr3m0CUKUiamUmMZstRuED+ox1azP szK8vLmwcpDlWpRqIqHbyE+w/NTabLhL96weWCyJeUUVP3X6dBXCkokH86Kto/j2Uv3e BvDA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hz1si5695131ejc.254.2021.11.17.20.10.44; Wed, 17 Nov 2021 20:10:51 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1FDEB68AB35; Thu, 18 Nov 2021 06:10:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9605A689F08 for ; Thu, 18 Nov 2021 06:10:29 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="214827588" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="214827588" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2021 20:10:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="455154576" Received: from trinity.sh.intel.com ([10.239.159.156]) by orsmga006.jf.intel.com with ESMTP; 17 Nov 2021 20:10:24 -0800 From: Xu Guangxin To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:05:46 +0800 Message-Id: <20211118040549.3871537-1-guangxin.xu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avutils: hwcontext_vaapi, print error if allocated surfaces > pool size 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: Xu Guangxin Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: o5GvXYej4dQY --- libavutil/hwcontext_vaapi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 83e542876d..14a2df38c6 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -475,8 +475,11 @@ static AVBufferRef *vaapi_pool_alloc(void *opaque, size_t size) AVBufferRef *ref; if (hwfc->initial_pool_size > 0 && - avfc->nb_surfaces >= hwfc->initial_pool_size) + avfc->nb_surfaces >= hwfc->initial_pool_size) { + av_log(hwfc, AV_LOG_ERROR, "allocated surfaces count(%d) > pool_size(%d)\n", + avfc->nb_surfaces, hwfc->initial_pool_size); return NULL; + } vas = vaCreateSurfaces(hwctx->display, ctx->rt_format, hwfc->width, hwfc->height,