From patchwork Thu Dec 29 14:33:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 1984 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp2440198vsb; Thu, 29 Dec 2016 06:37:13 -0800 (PST) X-Received: by 10.194.14.196 with SMTP id r4mr44354135wjc.54.1483022233699; Thu, 29 Dec 2016 06:37:13 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d79si54563730wmi.16.2016.12.29.06.37.13; Thu, 29 Dec 2016 06:37:13 -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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D69C7689DED; Thu, 29 Dec 2016 16:34:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3A073689C4A for ; Thu, 29 Dec 2016 16:34:08 +0200 (EET) Received: from phare.normalesup.org (archicubes.ens.fr [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id uBTEYBoD080436 for ; Thu, 29 Dec 2016 15:34:11 +0100 (CET) Received: by phare.normalesup.org (Postfix, from userid 1001) id 3097FE00F9; Thu, 29 Dec 2016 15:34:11 +0100 (CET) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Thu, 29 Dec 2016 15:33:56 +0100 Message-Id: <20161229143403.2851-10-george@nsup.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161229143403.2851-1-george@nsup.org> References: <20161229143403.2851-1-george@nsup.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Thu, 29 Dec 2016 15:34:11 +0100 (CET) Subject: [FFmpeg-devel] [PATCH 10/17] lavfi: add AVFilter.activate. 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: Nicolas George --- libavfilter/avfilter.c | 6 +++++- libavfilter/avfilter.h | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) Change: more documentation. diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 2b2df67ae1..f3a78d4f14 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1479,8 +1479,12 @@ int ff_filter_activate(AVFilterContext *filter) { int ret; + /* Generic timeline support is not yet implemented but should be easy */ + av_assert1(!(filter->filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC && + filter->filter->activate)); filter->ready = 0; - ret = ff_filter_activate_default(filter); + ret = filter->filter->activate ? filter->filter->activate(filter) : + ff_filter_activate_default(filter); if (ret == FFERROR_NOT_READY) ret = 0; return ret; diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index a3472547ea..8874b5efaa 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -294,6 +294,20 @@ typedef struct AVFilter { * used for providing binary data. */ int (*init_opaque)(AVFilterContext *ctx, void *opaque); + + /** + * Filter activation function. + * + * Called when any processing is needed from the filter, instead of any + * filter_frame and request_frame on pads. + * + * The function must examine inlinks and outlinks and perform a single + * step of processing. If there is nothing to do, the function must do + * nothing and not return an error. If more steps are or may be + * possible, it must use ff_filter_set_ready() to schedule another + * activation. + */ + int (*activate)(AVFilterContext *ctx); } AVFilter; /**