From patchwork Tue Oct 2 20:08:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 10577 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:ab0:73d2:0:0:0:0:0 with SMTP id m18csp3345334uaq; Tue, 2 Oct 2018 13:09:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV62fp+4LFwgllvImfQ9qKunRiBfYFP6WFvw4cDkYZzCgfttIPZHNkkry9TnPTNHka35uP8gz X-Received: by 2002:a1c:5e08:: with SMTP id s8-v6mr3045968wmb.88.1538510948299; Tue, 02 Oct 2018 13:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538510948; cv=none; d=google.com; s=arc-20160816; b=w2Gm7AduM/q7o2FOND12zhhD7E5jrxnCu3Y6eSziWelzbH8wzeKKLjKSUGl/fiSOmT My3NnEQSx7l/iHyIyyMiMdmpGDqk0EwC+XZDzX2zS1UMkH43kfB1hpLM8JBH1BH9yo2n HCw/BpHL3FNPd3p4w52uDI9tMytxfaaKwLbxwvNWTNYaxXIV/n3bcEjDXIZ3wpi6+kGo Cin6tjrH30Ro7lZcW25FcjR4L41zFyvJ4aMvvyf7HxMP+OmBf8FE/Liak6uRtayEdcn8 lYXw0BW1yImZQhu6aZzGyt762H0Gc5Zya91OANlZflJgH5CjiC0oU0zBcRbxouVgavlu r1pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=/XxLMJoQfvbTdb14YeBJvqDkoMbqKYhtIdKDViVEpok=; b=T0TzPgXrS5g+qmgeDmJtaYHkv6njFT9YuEIChf+Ab+qRpUQE/TIkqENK6GPZqWZone 2wi19+Pain86Ik+GSznsnY9forDy73Aum/beCx2SUBS++yEAu+46ODg7JJF6vJBgmOPX +VrH1Ju62tZ5g7a6GCnVsd4KwuLTB9EqTkV1B6/37iKaxuiiQL1Nj55NUcjSQa7nLpsb oAvjhcu/DII6LxQTA4dnZGthWQ6lG6zuAHaVSiabfwaPPCpHVJsPmALH7QOf5GCxqiow ekvn/9EmdrtLdTJz7qxu+Ua6sw+I2+3KX9+Kmua5aFzNBrZ/uBM65wXOcBDr98SbbJWA XLqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ianU0oIq; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v188-v6si3312755wmg.63.2018.10.02.13.09.07; Tue, 02 Oct 2018 13:09:08 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=ianU0oIq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 78C4B68A118; Tue, 2 Oct 2018 23:08:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2753E68A0B9 for ; Tue, 2 Oct 2018 23:08:40 +0300 (EEST) Received: by mail-ed1-f53.google.com with SMTP id y19-v6so3272479edd.2 for ; Tue, 02 Oct 2018 13:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=zim9cpc0OvEztLrpfPOGbiDDt8LGUPU7Lysenxfw/8o=; b=ianU0oIqeq+1xNRFr3yyBzS0df2FLkzTrStSBRMpFM9LcMcft5lS0qiGuGRmKqLowr FzwUEcbRzKxJb/9uJ+ugJU8lRB+428XmHOzfdolfXkwxWUoodo3bwjwnj3VT572Smyac FbMAwj4Y2S34JaJNTG3IqscwcUcKTtl1iu/vChbA8v3jucfkTQ0IR6DhniAFHlpJ0LZ1 KxgkzGdw7Ei2z8Yg2av8ZWY6643pCQqzkkyt788J2kQ7AWMeTvkWB9vxjH3ilAyYrEUI 0Gtefdzd35G1FsC0n8YpEgM+KfEBzlN6DqF4bS7zJxXVPLfNwre95KEq5dF5Wx9o8V2K g5lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=zim9cpc0OvEztLrpfPOGbiDDt8LGUPU7Lysenxfw/8o=; b=IV6Psuvo29u3IxsI59/YWcPbaM0FkB9IEQ/On/amJUDrJz0slMjiliIPFkGzDmczum lHa5Wwi7A301/vIri7WfKHuZlooTQIaP3NHxGKyDdxJkhL7ncVC8ZPO0UCzomWp6KGqM VD+RW9FWBdDZJQ/g2nnsA9JDX1n/LyyM4qhaQtyu/8TF3VFpqnU1m+zUzU8gwDhqgyw3 vd3boPdkyg9RRk9ScRceGGF3qkQTyQhHhfzO78dZoY8jp3zgKEW75P3XLzgCyBg6nowh 7KX02n9cLIpGte26XPwVk4pSy9HyVavvPeLtlpWddMdeu0nZIWf4zVwLKRYLsoblWpyx rcgw== X-Gm-Message-State: ABuFfogsP5YYlxKtHxsnJuJ1nEA4hFwDM/MCp8qFgER6Mj8ryblkWgzJ sWN4v7qv2xvu40dXi2VApehRgAGg X-Received: by 2002:a50:a9a1:: with SMTP id n30-v6mr11110326edc.158.1538510938604; Tue, 02 Oct 2018 13:08:58 -0700 (PDT) Received: from localhost.localdomain ([94.250.174.60]) by smtp.gmail.com with ESMTPSA id g18-v6sm857842edg.69.2018.10.02.13.08.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 13:08:58 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Tue, 2 Oct 2018 22:08:44 +0200 Message-Id: <20181002200845.24827-1-onemda@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/2] avfilter: add ff_inlink_queued_samples() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Paul B Mahol --- libavfilter/avfilter.c | 6 ++++++ libavfilter/filters.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 85eff0aa1d..2dcaabf545 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#define ASSERT_LEVEL 5 #include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/buffer.h" @@ -1453,6 +1454,11 @@ int ff_inlink_check_available_frame(AVFilterLink *link) return ff_framequeue_queued_frames(&link->fifo) > 0; } +int ff_inlink_queued_samples(AVFilterLink *link) +{ + return ff_framequeue_queued_samples(&link->fifo); +} + int ff_inlink_check_available_samples(AVFilterLink *link, unsigned min) { uint64_t samples = ff_framequeue_queued_samples(&link->fifo); diff --git a/libavfilter/filters.h b/libavfilter/filters.h index 4e2652ebe5..06a0f5896b 100644 --- a/libavfilter/filters.h +++ b/libavfilter/filters.h @@ -66,6 +66,13 @@ int ff_inlink_evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *fram */ int ff_inlink_check_available_frame(AVFilterLink *link); + +/*** + * Get the number of samples available on the link. + * @retrun the numer of samples available on the link. + */ +int ff_inlink_queued_samples(AVFilterLink *link); + /** * Test if enough samples are available on the link. * @return >0 if enough samples are available