From patchwork Thu Aug 10 11:46:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 4684 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.46.211 with SMTP id u202csp2309481vsu; Thu, 10 Aug 2017 04:49:04 -0700 (PDT) X-Received: by 10.223.142.164 with SMTP id q33mr9464064wrb.13.1502365744700; Thu, 10 Aug 2017 04:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502365744; cv=none; d=google.com; s=arc-20160816; b=hlOw15nKvgTKCmO2pdiyYi3fLZmy1C48W3MLIJCbioTA+XaXs5ztpZlH2trGvzUnCL paoCJU9xjEL2WCnEV+7S+DnfGfLSaOAVIkO2UmdJ9WBBwzDR0juLfanvfbh4FmFObEcv 0nvl9wm6Q2EtalgEX90YCW25jLzYsiStEv7Sppd9sUkPZAFxEmlaFHn1RwnNPKnLjjj8 ZDTseUxlieV2AQrrkFHs+FE2Lpx9NL2McoS6+rrf542/bf9jQFWPHuuLNbOj+5yToxeY +D/ReK9J7HG9S8NbljjxT6F0DJr+HYKZQMKRiExgZEfZidAFexiuXVI8IpPQOFpjJnON ygGA== 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=n8vT1Rwb9+5tcxdBOEhjZCSGWUIToGqEIV19MOLh8v0=; b=QAeSN+3ExayMpfh1tCFEiMHIbkXcNyBPADKJ1H/FHFLqeBOHSF+/FEKqIos3XZxj4E TntvgbaLQmWQV0fsmw/IDSkkDEdUt9cOtlaQrp7vUUyiAA5PMXkBN0JKifVIb3frIkKT PNuugUATca+w+TLHCSHU7IqyUpGdropp0N0rZDbSr5YTPolN4nOedS7QSm8EtzR39sgv iBMTpEFwNlrenx/aql6s8mny3sZspMpVCviju3EsP0tvO0vykisQHB/vvmLdU71xbMk3 dOJ995ZtuFkptKm0IdQvvDJtH90AOBp83eHZOhGYROdErBJL+kix09nOu4A7YU1vSNq2 7R2w== 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 e28si5281228wra.482.2017.08.10.04.49.04; Thu, 10 Aug 2017 04:49:04 -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 AD3E9689D0E; Thu, 10 Aug 2017 14:46:59 +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 C7AF9689CA2 for ; Thu, 10 Aug 2017 14:46:55 +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 v7ABkwJo043772 for ; Thu, 10 Aug 2017 13:46:58 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id 0CB4DE00F5; Thu, 10 Aug 2017 13:46:58 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Thu, 10 Aug 2017 13:46:41 +0200 Message-Id: <20170810114642.26779-15-george@nsup.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170810114642.26779-1-george@nsup.org> References: <20170810114642.26779-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, 10 Aug 2017 13:46:58 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 15/16] lavfi: remove dualinput. 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/dualinput.c | 90 ------------------------------------------------- libavfilter/dualinput.h | 46 ------------------------- 2 files changed, 136 deletions(-) delete mode 100644 libavfilter/dualinput.c delete mode 100644 libavfilter/dualinput.h Unchanged. diff --git a/libavfilter/dualinput.c b/libavfilter/dualinput.c deleted file mode 100644 index 44750973a6..0000000000 --- a/libavfilter/dualinput.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "dualinput.h" -#include "libavutil/timestamp.h" - -static int process_frame(FFFrameSync *fs) -{ - AVFilterContext *ctx = fs->parent; - FFDualInputContext *s = fs->opaque; - AVFrame *mainpic = NULL, *secondpic = NULL; - int ret = 0; - - if ((ret = ff_framesync_get_frame(&s->fs, 0, &mainpic, 1)) < 0 || - (ret = ff_framesync_get_frame(&s->fs, 1, &secondpic, 0)) < 0) { - av_frame_free(&mainpic); - return ret; - } - av_assert0(mainpic); - mainpic->pts = av_rescale_q(s->fs.pts, s->fs.time_base, ctx->outputs[0]->time_base); - if (secondpic && !ctx->is_disabled) - mainpic = s->process(ctx, mainpic, secondpic); - ret = ff_filter_frame(ctx->outputs[0], mainpic); - av_assert1(ret != AVERROR(EAGAIN)); - return ret; -} - -int ff_dualinput_init(AVFilterContext *ctx, FFDualInputContext *s) -{ - FFFrameSyncIn *in; - int ret; - - if ((ret = ff_framesync_init(&s->fs, ctx, 2)) < 0) - return ret; - - in = s->fs.in; - s->fs.opaque = s; - s->fs.on_event = process_frame; - in[0].time_base = ctx->inputs[0]->time_base; - in[1].time_base = ctx->inputs[1]->time_base; - in[0].sync = 2; - in[0].before = EXT_STOP; - in[0].after = EXT_INFINITY; - in[1].sync = 1; - in[1].before = EXT_NULL; - in[1].after = EXT_INFINITY; - - if (s->shortest) - in[0].after = in[1].after = EXT_STOP; - if (!s->repeatlast) { - in[1].after = EXT_NULL; - in[1].sync = 0; - } - if (s->skip_initial_unpaired) { - in[1].before = EXT_STOP; - } - - return ff_framesync_configure(&s->fs); -} - -int ff_dualinput_filter_frame(FFDualInputContext *s, - AVFilterLink *inlink, AVFrame *in) -{ - return ff_framesync_filter_frame(&s->fs, inlink, in); -} - -int ff_dualinput_request_frame(FFDualInputContext *s, AVFilterLink *outlink) -{ - return ff_framesync_request_frame(&s->fs, outlink); -} - -void ff_dualinput_uninit(FFDualInputContext *s) -{ - ff_framesync_uninit(&s->fs); -} diff --git a/libavfilter/dualinput.h b/libavfilter/dualinput.h deleted file mode 100644 index fcde0d6aa1..0000000000 --- a/libavfilter/dualinput.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * Double input streams helper for filters - */ - -#ifndef AVFILTER_DUALINPUT_H -#define AVFILTER_DUALINPUT_H - -#include -#include "bufferqueue.h" -#include "framesync.h" -#include "internal.h" - -typedef struct FFDualInputContext { - FFFrameSync fs; - - AVFrame *(*process)(AVFilterContext *ctx, AVFrame *main, const AVFrame *second); - int shortest; ///< terminate stream when the second input terminates - int repeatlast; ///< repeat last second frame - int skip_initial_unpaired; ///< Skip initial frames that do not have a 2nd input -} FFDualInputContext; - -int ff_dualinput_init(AVFilterContext *ctx, FFDualInputContext *s); -int ff_dualinput_filter_frame(FFDualInputContext *s, AVFilterLink *inlink, AVFrame *in); -int ff_dualinput_request_frame(FFDualInputContext *s, AVFilterLink *outlink); -void ff_dualinput_uninit(FFDualInputContext *s); - -#endif /* AVFILTER_DUALINPUT_H */