From patchwork Mon Jul 17 15:45:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 4342 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp307084vsb; Mon, 17 Jul 2017 08:46:38 -0700 (PDT) X-Received: by 10.223.158.133 with SMTP id a5mr4243353wrf.188.1500306398449; Mon, 17 Jul 2017 08:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500306398; cv=none; d=google.com; s=arc-20160816; b=sKr6hwkYNND1Un39MD0cAJCZhFGIEe2V1MbkzgV24/p7fR88Od09Sq6S0Dym55W+2k fcIpuhvviyJydKYjhTUNLW1r54JQvw598GsmH9zpL7owqrOCa+uX1Qq8reJsPV40Hqop Q/cRK3guOzZ3q3534IOXTI4kNzYWJOuDWwJTkGzuOw53OGXr1cpDV46kH5lBMVRa3QGD 5QkQSBLdhDpoWQ5V8ZnF8JKuuPoFhoDFcvLfyVJY30YR99CkgA68AkZnMDcIJX7qaEcv W7Zvpw/nmCjjKZPd+TF2yY0F7xO1AV35ZKkhB03ctk+/D4tN7FqhUfPurQ92oGB9iXBE IrRg== 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=FmmHjj3pP+HteAeuznxDBFf/DMI6J2aRJe9gWOmlTIE=; b=QWsWeQYpi7nBrZtzZHkexBXC6G9wymVNdcT6D3Gl2rHKkt6PKjT0Zx4PnhFSQkYZzp fcimcAJ/GnqZJxj0itgi8NMMDH9DVmOY/mIDiuabDsR7YRwEJ7MFkQiv25RAAtLNaktp 5M7kWPexFMA9i4AEDi34S9gLDdNkJ7xX3EQRobbI1GZKyZ0E0fT1HtSfD9bKcH8q+iSZ S7HXYd2kzKwfwGPtTNyPirbV6L3YMNZDN8Oo7XH6gJg3qWKGFrydlzvUPjOzOubVQOyO JpDCCr+Fx2WcOocJdVHTiRht55MY5b0FuGfy6jY17e7r7iNW2r9/jtOC/9XybvfCFZ/r PpzA== 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 v67si10116123wme.80.2017.07.17.08.46.38; Mon, 17 Jul 2017 08:46:38 -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 45062689DB2; Mon, 17 Jul 2017 18:45:24 +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 E6BF5689D57 for ; Mon, 17 Jul 2017 18:45:16 +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 v6HFjNvY070487 for ; Mon, 17 Jul 2017 17:45:23 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id 5FD86E00D0; Mon, 17 Jul 2017 17:45:23 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jul 2017 17:45:07 +0200 Message-Id: <20170717154509.28255-8-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:23 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 08/10] lavfi/vf_lut2: 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_lut2.c | 26 +++++++++----------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 18d42a7596..27ceb339a4 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -221,7 +221,7 @@ OBJS-$(CONFIG_LIMITER_FILTER) += vf_limiter.o OBJS-$(CONFIG_LOOP_FILTER) += f_loop.o OBJS-$(CONFIG_LUMAKEY_FILTER) += vf_lumakey.o OBJS-$(CONFIG_LUT_FILTER) += vf_lut.o -OBJS-$(CONFIG_LUT2_FILTER) += vf_lut2.o framesync.o +OBJS-$(CONFIG_LUT2_FILTER) += vf_lut2.o framesync2.o OBJS-$(CONFIG_LUT3D_FILTER) += vf_lut3d.o OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o OBJS-$(CONFIG_LUTYUV_FILTER) += vf_lut.o diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c index 25790bb3a3..f7e4a6a656 100644 --- a/libavfilter/vf_lut2.c +++ b/libavfilter/vf_lut2.c @@ -28,7 +28,7 @@ #include "formats.h" #include "internal.h" #include "video.h" -#include "framesync.h" +#include "framesync2.h" static const char *const var_names[] = { "w", ///< width of the input video @@ -206,8 +206,8 @@ static int process_frame(FFFrameSync *fs) AVFrame *out, *srcx, *srcy; int ret; - if ((ret = ff_framesync_get_frame(&s->fs, 0, &srcx, 0)) < 0 || - (ret = ff_framesync_get_frame(&s->fs, 1, &srcy, 0)) < 0) + if ((ret = ff_framesync2_get_frame(&s->fs, 0, &srcx, 0)) < 0 || + (ret = ff_framesync2_get_frame(&s->fs, 1, &srcy, 0)) < 0) return ret; if (ctx->is_disabled) { @@ -266,7 +266,7 @@ static int config_output(AVFilterLink *outlink) outlink->sample_aspect_ratio = srcx->sample_aspect_ratio; outlink->frame_rate = srcx->frame_rate; - if ((ret = ff_framesync_init(&s->fs, ctx, 2)) < 0) + if ((ret = ff_framesync2_init(&s->fs, ctx, 2)) < 0) return ret; in = s->fs.in; @@ -323,32 +323,24 @@ static int config_output(AVFilterLink *outlink) } } - return ff_framesync_configure(&s->fs); + return ff_framesync2_configure(&s->fs); } -static int filter_frame(AVFilterLink *inlink, AVFrame *buf) +static int activate(AVFilterContext *ctx) { - LUT2Context *s = inlink->dst->priv; - return ff_framesync_filter_frame(&s->fs, inlink, buf); -} - -static int request_frame(AVFilterLink *outlink) -{ - LUT2Context *s = outlink->src->priv; - return ff_framesync_request_frame(&s->fs, outlink); + LUT2Context *s = ctx->priv; + return ff_framesync2_activate(&s->fs); } static const AVFilterPad inputs[] = { { .name = "srcx", .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, .config_props = config_inputx, }, { .name = "srcy", .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, .config_props = config_inputy, }, { NULL } @@ -359,7 +351,6 @@ static const AVFilterPad outputs[] = { .name = "default", .type = AVMEDIA_TYPE_VIDEO, .config_props = config_output, - .request_frame = request_frame, }, { NULL } }; @@ -373,6 +364,7 @@ AVFilter ff_vf_lut2 = { .priv_class = &lut2_class, .uninit = uninit, .query_formats = query_formats, + .activate = activate, .inputs = inputs, .outputs = outputs, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,