From patchwork Mon Jul 17 15:45:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 4337 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp306042vsb; Mon, 17 Jul 2017 08:45:38 -0700 (PDT) X-Received: by 10.28.66.22 with SMTP id p22mr4379427wma.56.1500306338586; Mon, 17 Jul 2017 08:45:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500306338; cv=none; d=google.com; s=arc-20160816; b=wQaAFic5rzlmzpSdmvHBnHDHHzxATG4hv+OrKG5ACc1J1Ziz1q02mw9AdVsfoGA3Pz 8/3YipVdM3png3nS3a1HsT2H8CeJzl8alBtoILVIUkwjD0Yub2kR0pVwahkQGoWl/9eD s3DjgWaB8VNsLmnRqZerhSh1/5dvWNHE8uuCQAOg6IjbFaY6seYIuDABTlx45qC/MdrK J98iQ1i0nuog3lbDwtDRqoB1UrKFrg56sWh1dLR0E7+Hi4DzRrVzkickHgyBeFnExlwr ZyoS3BKKuS3jNT+i1/NhfqxqLWYmmh06UwqtDicWQrIi0NKH2gtElOAH94USGlgEesmG GE5A== 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=2HmKNwAg1ewtY0LTbUrq3NKx+/LDCASpsFPSoj6IIbk=; b=JnWqHoJJ+qGrf7F6hn5IjysbbgzM2QyfZzlIH4Ae9CbUcw72jD+mlNA/QfzssL1XHv KC+NuokhljxpUjNppgKzU+go9OT7PER1Cdlk+cqUOgt1pwakIxbgo2x9pWGAx7MJWdoy eBNvCaNMeEr3X/RlljqVl3JfUwZtJY2QCZmtBszK978sE1wHQyDqYJ4rF7WAFZd68DLv usLLecaCpnjvMGtWDbPumQIZhs822fuuGJLTvNbyIkcfClJHm7DEx+LGhpXj+kVKX6OJ mP+yf6owZgBVV9nzexYeTJ6XC05OG4Bh4zi/U99DxXlUsQWdEcVkthyt9qMRrCRfU3qW WIxA== 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 n16si12882296wrn.214.2017.07.17.08.45.37; Mon, 17 Jul 2017 08:45: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 E0E65689B81; Mon, 17 Jul 2017 18:45:18 +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 62430689A1B for ; Mon, 17 Jul 2017 18:45:12 +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 v6HFjIDi070443 for ; Mon, 17 Jul 2017 17:45:19 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id C992EE00D0; Mon, 17 Jul 2017 17:45:18 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jul 2017 17:45:01 +0200 Message-Id: <20170717154509.28255-2-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:19 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 02/10] lavfi/vf_remap: 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_remap.c | 30 +++++++++++------------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/libavfilter/Makefile b/libavfilter/Makefile index b34272830e..7acf13b0aa 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -265,7 +265,7 @@ OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o OBJS-$(CONFIG_READEIA608_FILTER) += vf_readeia608.o OBJS-$(CONFIG_READVITC_FILTER) += vf_readvitc.o OBJS-$(CONFIG_REALTIME_FILTER) += f_realtime.o -OBJS-$(CONFIG_REMAP_FILTER) += vf_remap.o framesync.o +OBJS-$(CONFIG_REMAP_FILTER) += vf_remap.o framesync2.o OBJS-$(CONFIG_REMOVEGRAIN_FILTER) += vf_removegrain.o OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o OBJS-$(CONFIG_REPEATFIELDS_FILTER) += vf_repeatfields.o diff --git a/libavfilter/vf_remap.c b/libavfilter/vf_remap.c index b7182e9556..d549912fcf 100644 --- a/libavfilter/vf_remap.c +++ b/libavfilter/vf_remap.c @@ -41,7 +41,7 @@ #include "libavutil/opt.h" #include "avfilter.h" #include "formats.h" -#include "framesync.h" +#include "framesync2.h" #include "internal.h" #include "video.h" @@ -283,9 +283,9 @@ static int process_frame(FFFrameSync *fs) AVFrame *out, *in, *xpic, *ypic; int ret; - if ((ret = ff_framesync_get_frame(&s->fs, 0, &in, 0)) < 0 || - (ret = ff_framesync_get_frame(&s->fs, 1, &xpic, 0)) < 0 || - (ret = ff_framesync_get_frame(&s->fs, 2, &ypic, 0)) < 0) + if ((ret = ff_framesync2_get_frame(&s->fs, 0, &in, 0)) < 0 || + (ret = ff_framesync2_get_frame(&s->fs, 1, &xpic, 0)) < 0 || + (ret = ff_framesync2_get_frame(&s->fs, 2, &ypic, 0)) < 0) return ret; if (ctx->is_disabled) { @@ -330,7 +330,7 @@ static int config_output(AVFilterLink *outlink) outlink->sample_aspect_ratio = srclink->sample_aspect_ratio; outlink->frame_rate = srclink->frame_rate; - ret = ff_framesync_init(&s->fs, ctx, 3); + ret = ff_framesync2_init(&s->fs, ctx, 3); if (ret < 0) return ret; @@ -350,44 +350,36 @@ 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) { - RemapContext *s = inlink->dst->priv; - return ff_framesync_filter_frame(&s->fs, inlink, buf); + RemapContext *s = ctx->priv; + return ff_framesync2_activate(&s->fs); } -static int request_frame(AVFilterLink *outlink) -{ - RemapContext *s = outlink->src->priv; - return ff_framesync_request_frame(&s->fs, outlink); -} static av_cold void uninit(AVFilterContext *ctx) { RemapContext *s = ctx->priv; - ff_framesync_uninit(&s->fs); + ff_framesync2_uninit(&s->fs); } static const AVFilterPad remap_inputs[] = { { .name = "source", .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, .config_props = config_input, }, { .name = "xmap", .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, }, { .name = "ymap", .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, }, { NULL } }; @@ -397,7 +389,6 @@ static const AVFilterPad remap_outputs[] = { .name = "default", .type = AVMEDIA_TYPE_VIDEO, .config_props = config_output, - .request_frame = request_frame, }, { NULL } }; @@ -408,6 +399,7 @@ AVFilter ff_vf_remap = { .priv_size = sizeof(RemapContext), .uninit = uninit, .query_formats = query_formats, + .activate = activate, .inputs = remap_inputs, .outputs = remap_outputs, .priv_class = &remap_class,