From patchwork Thu Sep 7 07:42:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 5016 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1613957jao; Thu, 7 Sep 2017 00:43:07 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7ydsAHzuwSUrpsQ/7xLni9CwtaHUon2kMdBaaNX2fkZxzMZJuC/UQyGCv/MD6aasO1gGlv X-Received: by 10.223.196.228 with SMTP id o33mr1087469wrf.253.1504770187484; Thu, 07 Sep 2017 00:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504770187; cv=none; d=google.com; s=arc-20160816; b=mhUqPWXkta6kny/GAywPU6qiY72Bugv8hB9nkJ+F3mzUwM5ijmceC73hqpT4bOSvPw Esivdw/2kAPBlqYRBxc0S+rDSL35eEmYk/3nLyfeewUoTflzUrB+cuqPdIDH0/9yutAi ikTswRCvOhXVnQZePLXKfpbjWRujdZ4t7nsQvsnfsyyHYz5AhF2ZxJQ4YDnqu6NKDr0+ T3PMX871RDIn18XMaFkFVwzbBpSC4Put6uLZtMQHUIMoiNYRd5QW16UEpV3dAf7YJ8ul lSwP3p4wYdWUV7tvsXsjfhpQ5NkCVqZ/jvW/itKSj19Mp8AuJ9asHTPtQGnsYNPMrApc tr3Q== 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=+06JkpZdxcTpDMmayUdT/e6HwSb6bMVvMLRv32wflOc=; b=Vm5NLbnUDjcBwdQu4qH/F6kqJaCNN2sXRB1t43iW1/mPqFikg6xi/u/uz/bFWRoz9u M5GKOe7dgMwwOVrykwIrXdBd76IEsNggVKYhbsjxl9IQQ6STxwmlYZVNzSGjan4bPieH erJJnocBU76R9vlQuAQSWxh4uaMu1TwyNR7cnEvMacDgCfjJ8EBl3ZVYDb/5Wi/oQ2bq gIPbK91tC9amQYqI6YghaugPJcJyxY0yHQh0fguEEmnwVCoXax+eGZWAd3zY86NRHqVF sWpo4ZxYFC4CLFaNp0quBIQn7A8375NOrirJ3sPcBQ2ytimN2d66EbOxe2wnikWN1Jyg kwBg== 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 q104si1604681wrb.261.2017.09.07.00.43.07; Thu, 07 Sep 2017 00:43:07 -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 4DFB06891E9; Thu, 7 Sep 2017 10:42:32 +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 8F8826879A0 for ; Thu, 7 Sep 2017 10:42:25 +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 v877gS7Q051228 for ; Thu, 7 Sep 2017 09:42:29 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id C0675E00AC; Thu, 7 Sep 2017 09:42:28 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Sep 2017 09:42:22 +0200 Message-Id: <20170907074226.7273-4-george@nsup.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170907074226.7273-1-george@nsup.org> References: <20170907074226.7273-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, 07 Sep 2017 09:42:29 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 4/8] lavfi/vf_zoompan: fix scheduling logic. 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/vf_zoompan.c | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) I do not have the faintest idea what the output of this filter is supposed to look like, so testing is limited. But at least now it outputs something. diff --git a/libavfilter/vf_zoompan.c b/libavfilter/vf_zoompan.c index 14d0a1707b..b1ade33b1f 100644 --- a/libavfilter/vf_zoompan.c +++ b/libavfilter/vf_zoompan.c @@ -95,7 +95,6 @@ typedef struct ZPcontext { double var_values[VARS_NB]; int nb_frames; int current_frame; - int finished; AVRational framerate; } ZPContext; @@ -240,7 +239,6 @@ static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double *var_va s->nb_frames = 0; s->current_frame = 0; av_frame_free(&s->in); - s->finished = 1; } return ret; error: @@ -253,22 +251,12 @@ static int activate(AVFilterContext *ctx) ZPContext *s = ctx->priv; AVFilterLink *inlink = ctx->inputs[0]; AVFilterLink *outlink = ctx->outputs[0]; - int status, ret = 0; - int64_t pts; - - if (s->in && ff_outlink_frame_wanted(outlink)) { - double zoom = -1, dx = -1, dy = -1; - - ret = output_single_frame(ctx, s->in, s->var_values, s->current_frame, - &zoom, &dx, &dy); - if (ret < 0) - return ret; - } + int ret = 0; + FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); if (!s->in && (ret = ff_inlink_consume_frame(inlink, &s->in)) > 0) { - double zoom = -1, dx = -1, dy = -1, nb_frames; + double nb_frames; - s->finished = 0; s->var_values[VAR_IN_W] = s->var_values[VAR_IW] = s->in->width; s->var_values[VAR_IN_H] = s->var_values[VAR_IH] = s->in->height; s->var_values[VAR_OUT_W] = s->var_values[VAR_OW] = s->w; @@ -297,22 +285,16 @@ static int activate(AVFilterContext *ctx) } s->var_values[VAR_DURATION] = s->nb_frames = nb_frames; - + } + if (s->in) { + double zoom = -1, dx = -1, dy = -1; ret = output_single_frame(ctx, s->in, s->var_values, s->current_frame, &zoom, &dx, &dy); - if (ret < 0) - return ret; - } - if (ret < 0) { return ret; - } else if (s->finished && ff_inlink_acknowledge_status(inlink, &status, &pts)) { - ff_outlink_set_status(outlink, status, pts); - return 0; - } else { - if (ff_outlink_frame_wanted(outlink) && s->finished) - ff_inlink_request_frame(inlink); - return 0; } + FF_FILTER_FORWARD_STATUS(inlink, outlink); + FF_FILTER_FORWARD_WANTED(outlink, inlink); + return 0; } static int query_formats(AVFilterContext *ctx)