From patchwork Mon Jul 31 12:02:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 4540 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.85 with SMTP id 82csp2323832vsb; Mon, 31 Jul 2017 05:03:26 -0700 (PDT) X-Received: by 10.28.158.11 with SMTP id h11mr11295432wme.88.1501502606633; Mon, 31 Jul 2017 05:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501502606; cv=none; d=google.com; s=arc-20160816; b=0GCXQRmDbH0fsSt3ITpJu6C7ZCRqNdMBQ8iWZH3wNe0gCJxSmCnrTZxlw8bdfMaboR d3N3IEXKMsJ72kS2WNqY4Cqtbduw7AgVSTrwYoy1efeODVbq1BBzNDuCKkeHCt1V0F3X SauoD1lsBsMPRZJ/58sRjAV0t4PxfxG1jvvxCOTpziZbTSz2O2FZK6cp9yuvOFB86e9U Tyott/fxMLqgq4S3KofY2TWmY9tixJJpWcd3JppkRPNNceo6tZaczCnjiIOVxg3NCWtt Da75YnPJrwph9ipf6yEBFHMaCzyRcz0b5Sic4yXgpz3IaI10Bl5S/T6LQ3hN6Js4Ag2+ fG2w== 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=OlkC+czXqA+GA11z0s4u2CIiVGtGPDTS47fuv/nLEto=; b=hyMupsyunEwbjwOO5qo7JpbKkHhfcQAfgE8NTCd7ERchUb+NCLn0feEKAnf20hggrM C4T8GnBT/4bdMBoe1nEXzoiowttqxZd7SObDw2EFxaWA/Sw37CMGc4ag25AJWapALO6O cxq2vgcD+88YEYChxie4xQ6TYPR1u2v2MuSYpoBRoSzgMLcuo/zuVxH728ED2GewB088 9wI3ZazOVOu9oqg9vAFCR5NJaoWWb1Yx0cMyu4sshfl1haklmQNgNdNgpY8QUDB8HcGx 4n0AbH7k+zY0IsazfqLPpklgtkkbTedSR/IjuHB9ixSvI9Nc+ErSWNmliWkYRLGBI2j8 yK7g== 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 w20si22261132wrc.519.2017.07.31.05.03.26; Mon, 31 Jul 2017 05:03:26 -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 3E37C68A1D7; Mon, 31 Jul 2017 15:02:38 +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 EEC8B689C96 for ; Mon, 31 Jul 2017 15:02:35 +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 v6VC2bC5071558 for ; Mon, 31 Jul 2017 14:02:38 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id D0150E00F5; Mon, 31 Jul 2017 14:02:37 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Mon, 31 Jul 2017 14:02:27 +0200 Message-Id: <20170731120227.31047-14-george@nsup.org> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170731120227.31047-1-george@nsup.org> References: <20170731120227.31047-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, 31 Jul 2017 14:02:38 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 14/14] 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 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 */