From patchwork Thu Nov 24 09:19:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 39404 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp4408203pzb; Thu, 24 Nov 2022 01:20:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf6VwWBwLDz62pzVBtIPRVH5+2mhsXNqHPH/XNIj7oPPuztkdvfZ39SWtOdx/BHhBBjeRY4g X-Received: by 2002:a17:906:3145:b0:7b5:665a:fca5 with SMTP id e5-20020a170906314500b007b5665afca5mr11559789eje.10.1669281630111; Thu, 24 Nov 2022 01:20:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669281630; cv=none; d=google.com; s=arc-20160816; b=y274j6agaIoNdEW8GZLh1QrdwVskc1NMveB8vIYfjbWEbFypii5e3ZmrTYebZYuEha W2NpTsEHMcCV4kb7TjZ8msoF7Wi9G3v1UuFWsPG46NZh6PdWZVGUzsphhnFVt0YQG+7i 2kUtyXIv+OyOthPz0YW8omLHA/1Dfp/ZBaMUnKHlDHGpWHTwOG1D8VYVkE/XX6d6MlVa z0glQ7b00O7KPIJIPjlcExrd7nIeCEYsM3GVNe4nyZ61r17dUlaLQn08Lp0BAwYv24FH p/uNInnaL0OFgCcBpYQmFxfbHAoITSlsk3Fkgg7S2+bSKlYGZhtN0rRA0qXciWO0GUmD hkTg== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=bLBOUCyzOHl2X4m4Kx8a4lrkIAFGRtpehl+RCumQ+9k=; b=da0A+GxtimYoyG/j3xVVyuyyGmbTPoktYOs8OMU60xi/IFGapo18TEf+QPw0zYImXo RktdtDESap8dHcxBDxGB7+kJ7VXb5ShkF+/BLZQN4stvtfj3dqT/uyny1TVMolN0BiId hxlH0PtLVKD+GkFSKJC/xD1PlBCFw1Ov7hynITLpDkf5aD8KWwmDJ6ZJVgEBvBeSLWg0 LWG2SXfJ22Ysh1j7AOOMIJxeWaN0GvnNqdrZlo3HIFok9fZMI5JFVAxNvXcCcWzQTaa1 OjFzbDhm88Cg6gV3sjoP0//WEL7r15w90B/wtI+G6As7GNgPiWL6ygEY6Ra4mOrppA3h vSwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=SXitG3I+; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id wt7-20020a170906ee8700b007ae0ea7fbb8si420591ejb.825.2022.11.24.01.20.29; Thu, 24 Nov 2022 01:20:30 -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; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=SXitG3I+; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 37A8768B7E9; Thu, 24 Nov 2022 11:20:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 58F3468A55A for ; Thu, 24 Nov 2022 11:20:02 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669281607; x=1700817607; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jhA2UlSisJGgwNUgRj5IQaadN4grtqgf0IhcE2SI8mw=; b=SXitG3I+0Uy65vYxDaup3REwbODQ1J3o0W0Oeus+hUZRS9NeXMCDkd0R ZoIV5dezazxzbJcFLznLo4n2sobKAzLLfOHkvjzFduTKJctiKhXJyWxJi OE4C9q6wdXGe3Px71nZFmOH95V4aQZm3/D4INJP77vGga4/ygZKZGS9Pi xdUiw1uKfxSYcxXjAwQTtLGtTSnLPhDop2dLuG2pOKWKz9KuAL3s4hP8l j4K1fqXmWiaAZv6KfVa3O2/Ij5DdbKP0VqMd3EtNBMsoGhLmFvmkAPSCP RDa5/ARhVMmv/w0OAImmV7NDdNHVJ7c6/s3/QtRSnc/1leXi6ZWRgA8Dc w==; X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="297619609" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="297619609" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 01:19:59 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10540"; a="731078368" X-IronPort-AV: E=Sophos;i="5.96,190,1665471600"; d="scan'208";a="731078368" Received: from xhh-tgl64.sh.intel.com ([10.238.2.19]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 01:19:58 -0800 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Thu, 24 Nov 2022 17:19:29 +0800 Message-Id: <20221124091930.558046-3-haihao.xiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221124091930.558046-1-haihao.xiang@intel.com> References: <20221124091930.558046-1-haihao.xiang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/4] lavfi/qsvvpp: provide a default framerate if needed 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: H3623IK13bI3 From: Haihao Xiang VPP in the SDK requires the frame rate to be set to a valid value, otherwise init will fail, so always set a default framerate when the input link doesn't have a valid framerate. Signed-off-by: Haihao Xiang --- libavfilter/qsvvpp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c index a088f6b61f..a588a37610 100644 --- a/libavfilter/qsvvpp.c +++ b/libavfilter/qsvvpp.c @@ -324,6 +324,14 @@ static int fill_frameinfo_by_link(mfxFrameInfo *frameinfo, AVFilterLink *link) frameinfo->CropH = link->h; frameinfo->FrameRateExtN = link->frame_rate.num; frameinfo->FrameRateExtD = link->frame_rate.den; + + /* Apparently VPP in the SDK requires the frame rate to be set to some value, otherwise + * init will fail */ + if (frameinfo->FrameRateExtD == 0 || frameinfo->FrameRateExtN == 0) { + frameinfo->FrameRateExtN = 25; + frameinfo->FrameRateExtD = 1; + } + frameinfo->AspectRatioW = link->sample_aspect_ratio.num ? link->sample_aspect_ratio.num : 1; frameinfo->AspectRatioH = link->sample_aspect_ratio.den ? link->sample_aspect_ratio.den : 1;