From patchwork Mon Jul 17 15:45:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 4340 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp306402vsb; Mon, 17 Jul 2017 08:45:58 -0700 (PDT) X-Received: by 10.28.92.207 with SMTP id q198mr4692192wmb.72.1500306358052; Mon, 17 Jul 2017 08:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500306357; cv=none; d=google.com; s=arc-20160816; b=eg0w1eIVSCRDr8KoVabWxtOjQCsz9mTzwxP3r+aalSzcA5SOyyeOnSTbuXckjzzrFc VLOYW+Ahk6G1Oy7H4sVLzOPRcagJuB1YfPKlWhoDvjyxGBvjl7vMBxuatuaGplVvSJxo MHnHr4LnF/lJQjv6MtpMsb/a7TlmlBQiAAi8lFgG1j/4Q1clpMa3FRRY0LGoJx4N0hZe MGuJBvwNqKHuc6ZjngxbdbSIrc0mVF/aCcuGolzsVgaqpRidzz+u6Fnb3irbEy4pZfvb 2e2HwxXAUf9WXfsy9haGEZSlGzScfMTSd2qjUrplUs0GCrEhq09HwIz2zQiJLMiMKlkv RNrg== 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=uVV2GAtuMzJLZScF0a+k1tSEElp7Jcm8X/axZCK4DQY=; b=blTKLdFeIcxVkResuSIknevskVIZZM9OQnFuB+kqe54lLdcgJ2mvs52kerTeZuIUn6 +pv3r+N5EDCVNH4JwaNrwwbYwtV/d/OVNshDUs/cuNpAJrRxzZKmsPpPIX7npDn0hz2K sUzF0CUHteyWQE/mo8SZNJnBDY5nVYCI5MjKFIO4/gzVszMhNMc/B/Qxo/4IyzgS+hEV M+Vd8yxnetqPm4/ME93Psv9i3MLhD4AdY45evc8SiUQK1rhLd7qYzcoOP0yHarj7wfSa Ard/XymX+yssAuLaWuD9c//SeOhi13UtfgU3AeNOWFoq51LhfrFCjFceyAEWOfsX5bPM RrUw== 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 x72si9959700wmf.47.2017.07.17.08.45.57; Mon, 17 Jul 2017 08:45:57 -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 B0E28689D3E; Mon, 17 Jul 2017 18:45:21 +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 932C3689D34 for ; Mon, 17 Jul 2017 18:45:14 +0300 (EEST) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id v6HFjLFg070465 for ; Mon, 17 Jul 2017 17:45:21 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id 0526EE00D0; Mon, 17 Jul 2017 17:45:20 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jul 2017 17:45:03 +0200 Message-Id: <20170717154509.28255-4-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:21 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 04/10] lavfi/vf_midequalizer: 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_midequalizer.c | 28 ++++++++++------------------ 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 5acda236e6..0edd33576f 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -231,7 +231,7 @@ OBJS-$(CONFIG_MCDEINT_FILTER) += vf_mcdeint.o OBJS-$(CONFIG_MERGEPLANES_FILTER) += vf_mergeplanes.o framesync.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 framesync.o +OBJS-$(CONFIG_MIDEQUALIZER_FILTER) += vf_midequalizer.o framesync2.o OBJS-$(CONFIG_MINTERPOLATE_FILTER) += vf_minterpolate.o motion_estimation.o OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o diff --git a/libavfilter/vf_midequalizer.c b/libavfilter/vf_midequalizer.c index 99d26c751e..9d9ad1aec1 100644 --- a/libavfilter/vf_midequalizer.c +++ b/libavfilter/vf_midequalizer.c @@ -25,7 +25,7 @@ #include "formats.h" #include "internal.h" #include "video.h" -#include "framesync.h" +#include "framesync2.h" typedef struct MidEqualizerContext { const AVClass *class; @@ -89,8 +89,8 @@ static int process_frame(FFFrameSync *fs) AVFrame *out, *in0, *in1; int ret; - if ((ret = ff_framesync_get_frame(&s->fs, 0, &in0, 0)) < 0 || - (ret = ff_framesync_get_frame(&s->fs, 1, &in1, 0)) < 0) + if ((ret = ff_framesync2_get_frame(&s->fs, 0, &in0, 0)) < 0 || + (ret = ff_framesync2_get_frame(&s->fs, 1, &in1, 0)) < 0) return ret; if (ctx->is_disabled) { @@ -311,7 +311,7 @@ static int config_output(AVFilterLink *outlink) outlink->sample_aspect_ratio = in0->sample_aspect_ratio; outlink->frame_rate = in0->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; @@ -326,26 +326,20 @@ static int config_output(AVFilterLink *outlink) s->fs.opaque = s; s->fs.on_event = process_frame; - 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) { - MidEqualizerContext *s = inlink->dst->priv; - return ff_framesync_filter_frame(&s->fs, inlink, buf); -} - -static int request_frame(AVFilterLink *outlink) -{ - MidEqualizerContext *s = outlink->src->priv; - return ff_framesync_request_frame(&s->fs, outlink); + MidEqualizerContext *s = ctx->priv; + return ff_framesync2_activate(&s->fs); } static av_cold void uninit(AVFilterContext *ctx) { MidEqualizerContext *s = ctx->priv; - ff_framesync_uninit(&s->fs); + ff_framesync2_uninit(&s->fs); av_freep(&s->histogram[0]); av_freep(&s->histogram[1]); av_freep(&s->cchange); @@ -355,13 +349,11 @@ static const AVFilterPad midequalizer_inputs[] = { { .name = "in0", .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, .config_props = config_input0, }, { .name = "in1", .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, .config_props = config_input1, }, { NULL } @@ -372,7 +364,6 @@ static const AVFilterPad midequalizer_outputs[] = { .name = "default", .type = AVMEDIA_TYPE_VIDEO, .config_props = config_output, - .request_frame = request_frame, }, { NULL } }; @@ -383,6 +374,7 @@ AVFilter ff_vf_midequalizer = { .priv_size = sizeof(MidEqualizerContext), .uninit = uninit, .query_formats = query_formats, + .activate = activate, .inputs = midequalizer_inputs, .outputs = midequalizer_outputs, .priv_class = &midequalizer_class,