From patchwork Sun Jun 18 11:16:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 42188 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be15:b0:121:b37c:e101 with SMTP id ge21csp56592pzb; Sun, 18 Jun 2023 04:21:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5DR7ypXt9rE9i6NOekHH6s5m1foGsq7tB6nKXFaqDDzomyjigTW0rE/mRh25NJJGRhtDFi X-Received: by 2002:a05:6402:2683:b0:51a:4c1e:c94a with SMTP id w3-20020a056402268300b0051a4c1ec94amr1985107edd.2.1687087262357; Sun, 18 Jun 2023 04:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687087262; cv=none; d=google.com; s=arc-20160816; b=JB1ptMSFyAVWi6kfXcGqPV1ryDy1Lnzz+LiWuBjHHqvS/C4KVxN/1jhSO1gTRGa1IT NZSaNYUYAScHe6OvORbEZBCrRJb0hbfOj/rQHJiAb//gKba1M3c+bTCLN7hv7fu1TKJk 5b4JytMGx+B3iWEbackvK7uPymvkCARlg2b+kdM8rhdMkM3JiKVrbYI0dM+V5nC6o8ZK 0X9b7EmsaMZdgSbOmuH485FbxTBDL95rF2PZBJeIM0YKgtbfle8o6hVVHRX7Wx2Dy/YT dLuNt5pf0emqCniNNcAc9/0x/rH3YapDoD/Qqk0ldET79+Xx95+XTKAvXN5cTCYlcDfF P6Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=gXpt+0gzXT5WRRJ1GJqaLbR/S5HK+/xsLT6voUF0mIM=; b=FuTMHqtQLByxgenPYkhPYNOF9wgLMpmMEhn2FawV1ReIZgF7yDUTa4u7YU6lRrAKo8 OTIB5HLOU2CrnW9pCO4qjENJrpRQ923CQ3qj1tKgnpW6YMI88lhttMpylLaRFARxpAeD LaCFZc7JwUPYUWxg7cXUZeLOy2pb7dEzvu+FD8o9eerWZ6Vxq+XH0r949GcSeb9Flizo SDK6noxbdSaApIQbRHv15YkGlNQSiq68y/lrZsUJR0caAdBk1/V54D8nNaVXA4bqQ2rV oxYzEpoSFhrAKIz82Vl3OqednwsbI+CQHx163LwZ6laFNe749zRq46hVG+ay5Pajy3T/ ZgCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=eNEvimL+; 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 d22-20020a056402079600b0051a27fb3d58si4252212edy.118.2023.06.18.04.21.02; Sun, 18 Jun 2023 04:21:02 -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; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=eNEvimL+; 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 AE6C168BFE2; Sun, 18 Jun 2023 14:20:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C8F3368BFA1 for ; Sun, 18 Jun 2023 14:20:10 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 7E62B43FA9; Sun, 18 Jun 2023 13:20:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1687087209; bh=K9zvQFGnHxIr5LKeLluE63FfB6PPUbQUvOTCfdndtpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eNEvimL+MCFBbiAMg2s3TRNDERTi7QluKO3LpucdB3btFmgpJmVAel22smy6NW7Ek sORXE6sGiaWKjyJQWL4yZ5GJ3gveuRke43A3bj3Nfao8ZQ/DYPyicyqCJt9QfOBNK9 PQmuJrG7uMGDU8ISu0nLIyRhWgq9IBdgROVjJNf4= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Jun 2023 13:16:57 +0200 Message-ID: <20230618111955.40994-7-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230618111955.40994-2-ffmpeg@haasn.xyz> References: <20230618111955.40994-2-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 05/22] lavfi/vf_libplacebo: move temporary vars into per-input struct X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Z2XVKsB5PIgl From: Niklas Haas Including the queue status, because these will need to be re-queried inside output_frame_mix when that function is refactored to handle multiple inputs. --- libavfilter/vf_libplacebo.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index beddd2f796d..4baa766bacf 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -117,6 +117,8 @@ enum var_name { typedef struct LibplaceboInput { pl_renderer renderer; pl_queue queue; + enum pl_queue_status qstatus; + struct pl_frame_mix mix; ///< temporary storage AVFilterLink *link; AVFifo *out_pts; ///< timestamps of wanted output frames int64_t status_pts; @@ -952,9 +954,6 @@ static int libplacebo_activate(AVFilterContext *ctx) return ret; if (ff_outlink_frame_wanted(outlink)) { - struct pl_frame_mix mix; - enum pl_queue_status ret; - if (s->fps.num) { pts = outlink->frame_count_out; } else if (av_fifo_peek(in->out_pts, &pts, 1, 0) < 0) { @@ -972,20 +971,20 @@ static int libplacebo_activate(AVFilterContext *ctx) return 0; } - ret = pl_queue_update(in->queue, &mix, pl_queue_params( + in->qstatus = pl_queue_update(in->queue, &in->mix, pl_queue_params( .pts = pts * av_q2d(outlink->time_base), .radius = pl_frame_mix_radius(&s->params), .vsync_duration = av_q2d(av_inv_q(outlink->frame_rate)), )); - switch (ret) { + switch (in->qstatus) { case PL_QUEUE_MORE: ff_inlink_request_frame(in->link); return 0; case PL_QUEUE_OK: if (!s->fps.num) av_fifo_drain2(in->out_pts, 1); - return output_frame_mix(ctx, &mix, pts); + return output_frame_mix(ctx, &in->mix, pts); case PL_QUEUE_ERR: return AVERROR_EXTERNAL; }