From patchwork Mon Jul 17 15:45:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 4341 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp306759vsb; Mon, 17 Jul 2017 08:46:18 -0700 (PDT) X-Received: by 10.28.16.17 with SMTP id 17mr5141384wmq.1.1500306378765; Mon, 17 Jul 2017 08:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500306378; cv=none; d=google.com; s=arc-20160816; b=s9i+LwSOFynuTRXGRT0z+TGvfGvXZ2PdF/kefL6+MQ6ccEm6XMEia9h95F80XMvT9R 6oS7mp40eepaUSCr2hRTpPvsi3Bbgzu5CyCcHYAwb2YCE8+aOiGMVi/Mhyi5PEjVYeX5 ixiV2yuWlYfAgAxVtm9v/T9iaVvgm9/uIfkIIioNT3ImNhL96TGRLWGNM4VmtFGdy5y8 JizbU76hdIdhNHjJAQECMhXj+QbdWXWeCAWEt4SolwPHTIh/plYwAc6/7BW33+WRxAFb ZVGhrZ4OW8WjxbYvrKDbQhc7Xs3ycCU/x4JxowSZnQHMWMbrNKrmxTqRI0vn1Kpwso48 WdAw== 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:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=Xylyp0yWmwj8xAJA7mGh4MyARFywxf4z/9S9JmZcJ0w=; b=ac01d377MVUSyT/VkAPT4qoFStqhstPmVUWd5FkCaSloQILIFYSuySTiIfuMd0nK4d 0lxPJ031EtvWydVdO8MWpYet6Rp1e9/YWmop+plvE1Lc/nxS0LKgc9lm3p6jgYIhXP21 IT7dE/TnX0NTkrXK5OLnko6xNpdBh6U802bDO7Q56ehf6mL/u/rG6TKqbKk4pSB3yzMr uJ/wWv5XuoAOZaekj7qlVNFWNNANguaz8c9s/o9HmAN91WhJR2u1oDASaAURZGVJRw0O jH3xTkDBNZOtTXbOXlJkglzus5zZOWsKc6jE74C9QXrmvL8Kdh+pK+nH63c5WkEM5W6f 7XDg== 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 43si12541303wrk.174.2017.07.17.08.46.18; Mon, 17 Jul 2017 08:46:18 -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; 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 91A40689D7C; Mon, 17 Jul 2017 18:45:23 +0300 (EEST) 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 B8A9C689D3E for ; Mon, 17 Jul 2017 18:45:15 +0300 (EEST) 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 v6HFjMTm070480 for ; Mon, 17 Jul 2017 17:45:22 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id 3306EE00D0; Mon, 17 Jul 2017 17:45:22 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jul 2017 17:45:05 +0200 Message-Id: <20170717154509.28255-6-george@nsup.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170717154509.28255-1-george@nsup.org> References: <20170717154509.28255-1-george@nsup.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Mon, 17 Jul 2017 17:45:22 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 06/10] lavfi/vf_mergeplanes: move to activate design. 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/Makefile | 2 +- libavfilter/vf_mergeplanes.c | 25 +++++++++---------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 5128f0f937..16a7e87c04 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -228,7 +228,7 @@ OBJS-$(CONFIG_LUTYUV_FILTER) += vf_lut.o OBJS-$(CONFIG_MASKEDCLAMP_FILTER) += vf_maskedclamp.o framesync.o OBJS-$(CONFIG_MASKEDMERGE_FILTER) += vf_maskedmerge.o framesync2.o OBJS-$(CONFIG_MCDEINT_FILTER) += vf_mcdeint.o -OBJS-$(CONFIG_MERGEPLANES_FILTER) += vf_mergeplanes.o framesync.o +OBJS-$(CONFIG_MERGEPLANES_FILTER) += vf_mergeplanes.o framesync2.o OBJS-$(CONFIG_MESTIMATE_FILTER) += vf_mestimate.o motion_estimation.o OBJS-$(CONFIG_METADATA_FILTER) += f_metadata.o OBJS-$(CONFIG_MIDEQUALIZER_FILTER) += vf_midequalizer.o framesync2.o diff --git a/libavfilter/vf_mergeplanes.c b/libavfilter/vf_mergeplanes.c index c21104320d..b8ccee0802 100644 --- a/libavfilter/vf_mergeplanes.c +++ b/libavfilter/vf_mergeplanes.c @@ -25,7 +25,7 @@ #include "libavutil/pixdesc.h" #include "avfilter.h" #include "internal.h" -#include "framesync.h" +#include "framesync2.h" typedef struct InputParam { int depth[4]; @@ -58,12 +58,6 @@ static const AVOption mergeplanes_options[] = { AVFILTER_DEFINE_CLASS(mergeplanes); -static int filter_frame(AVFilterLink *inlink, AVFrame *in) -{ - MergePlanesContext *s = inlink->dst->priv; - return ff_framesync_filter_frame(&s->fs, inlink, in); -} - static av_cold int init(AVFilterContext *ctx) { MergePlanesContext *s = ctx->priv; @@ -101,7 +95,6 @@ static av_cold int init(AVFilterContext *ctx) pad.name = av_asprintf("in%d", i); if (!pad.name) return AVERROR(ENOMEM); - pad.filter_frame = filter_frame; if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0){ av_freep(&pad.name); @@ -150,7 +143,7 @@ static int process_frame(FFFrameSync *fs) int i, ret; for (i = 0; i < s->nb_inputs; i++) { - if ((ret = ff_framesync_get_frame(&s->fs, i, &in[i], 0)) < 0) + if ((ret = ff_framesync2_get_frame(&s->fs, i, &in[i], 0)) < 0) return ret; } @@ -179,7 +172,7 @@ static int config_output(AVFilterLink *outlink) FFFrameSyncIn *in; int i, ret; - if ((ret = ff_framesync_init(&s->fs, ctx, s->nb_inputs)) < 0) + if ((ret = ff_framesync2_init(&s->fs, ctx, s->nb_inputs)) < 0) return ret; in = s->fs.in; @@ -272,15 +265,15 @@ static int config_output(AVFilterLink *outlink) } } - return ff_framesync_configure(&s->fs); + return ff_framesync2_configure(&s->fs); fail: return AVERROR(EINVAL); } -static int request_frame(AVFilterLink *outlink) +static int activate(AVFilterContext *ctx) { - MergePlanesContext *s = outlink->src->priv; - return ff_framesync_request_frame(&s->fs, outlink); + MergePlanesContext *s = ctx->priv; + return ff_framesync2_activate(&s->fs); } static av_cold void uninit(AVFilterContext *ctx) @@ -288,7 +281,7 @@ static av_cold void uninit(AVFilterContext *ctx) MergePlanesContext *s = ctx->priv; int i; - ff_framesync_uninit(&s->fs); + ff_framesync2_uninit(&s->fs); for (i = 0; i < ctx->nb_inputs; i++) av_freep(&ctx->input_pads[i].name); @@ -299,7 +292,6 @@ static const AVFilterPad mergeplanes_outputs[] = { .name = "default", .type = AVMEDIA_TYPE_VIDEO, .config_props = config_output, - .request_frame = request_frame, }, { NULL } }; @@ -312,6 +304,7 @@ AVFilter ff_vf_mergeplanes = { .init = init, .uninit = uninit, .query_formats = query_formats, + .activate = activate, .inputs = NULL, .outputs = mergeplanes_outputs, .flags = AVFILTER_FLAG_DYNAMIC_INPUTS,