From patchwork Sun Aug 11 14:42:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 50985 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:1ff2:b0:489:2eb3:e4c4 with SMTP id ks18csp898865vqb; Sun, 11 Aug 2024 08:01:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXIlOdPKjHVobHHhc3wK09b5GrBMjCxcbJVyxsIXKFQzg5AA675R3QUWZT71ozsvOVKNZnYq1wubD/uG/g/+Jha7xBqzUP0uP6S3A== X-Google-Smtp-Source: AGHT+IHcEvlrejLW4He3J83FnEAb7rLMdlKoy8Sy8N5KKKugu/8vjvsiNOKQ2eiFAX0Y8w1RO4rC X-Received: by 2002:a2e:924e:0:b0:2f1:5d60:8758 with SMTP id 38308e7fff4ca-2f1a6d70914mr47957481fa.49.1723388472735; Sun, 11 Aug 2024 08:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723388472; cv=none; d=google.com; s=arc-20160816; b=oTQ9zOCqLL4ZkqXjtzpx6izU6XJ7tIM3Fn9GcAegM3+bx4hBNKXCU5bjAZEwkEWFcr ZqEP3e9I2/v+1w7JroLgea3NLuO9hKX4BvWe0XakvYvWZAuUl7M8NwEzyrk29MYZmc8j NocEhvL6eYO6j9EX8B+1XyuLAiv2WUvEqet112WqxUzFsJhq0KQqrZIDtnQCCLkFGnXI TWwEsn9H7+Z9f+RhrpFYiCfnORUpY3yonpCn+kI4NkMyvKzU6PD1cc3+Seko0eJ3FXMR q7cI6XcQIo9VfeT/YQJIUVryR57DeGHcpTpsBnlv4Dzfx+0s+b1quVcQ9G20HFBWeACz nAvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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=PeaF8XBkV6nZQ9no8rjD6AEMlsG2vKiElfjqdo7L0FI=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=vuAWrPzQjRAbFpvlhoGEXYFI/7eY0qqJXfVhJ5VUVTZhUS7vEeB3mDzSkMEzl4826r YXXigcwRrXvKHTuyMtRzqyc8gcCDolI06mKCcNELNRkMdiV35MgFqbUZTogUEU/0tZji TRzIZrgJS9xCz3c1QLUP8gySNVow1idAL31U8x6ifXjWJkiaK8NtcD6u8ZsN8E9An8/X lcKc5zH12HbsrzMiYHrl1hSjvt73AG6a/2S7zX6DSkWL4lqTgeyx31u1fyfn/Q5FTNeC KqkaxlwOpxEzWQeTLgktzePBFQjzcP575lYMCdUix9b1g3qTXNi+ND8y4mqPidjTZZ0M 1rPA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=aQvIkgOk; 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 4fb4d7f45d1cf-5bd1a5cbf35si1857426a12.267.2024.08.11.08.01.12; Sun, 11 Aug 2024 08:01:12 -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=@khirnov.net header.s=mail header.b=aQvIkgOk; 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 0211C68DAFA; Sun, 11 Aug 2024 17:42:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 32E4F68DA0D for ; Sun, 11 Aug 2024 17:42:25 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=aQvIkgOk; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id B69D04DFC for ; Sun, 11 Aug 2024 16:42:21 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id OMP7R4qzEKFW for ; Sun, 11 Aug 2024 16:42:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1723387338; bh=R5O8iriAGCwpWt2nRszrDjjOWbORDCAOpc87t/ir9VA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aQvIkgOk4sbOttHyq0vMKacXXKfl+XOcQboKPz8YVMOvaUrz/bH2z1ms35awFcZLT TTlZ/X/eEyw2A9gOTfmkTmvouig0DLG2IgXDEQVl+ZLnoqhlrrvxRX0oBLYw0Egzrs OXbrampQtaKYDO8copOBVIremqzjYSTDTZxjHiJRjmvTeyfTj8KXoZubsaE05h8VCl jX2G1BwqrGowRde+U3JfnqHG7RX6rNIcwVZJ7sAtq3hZm4G3fEmhPVguC56CfGMtK0 9MQZC4zATRqgbtiVaTUwrjlKj5WnZjTcMz9zhU93OItot3bSGk5eGsY9sfApgEvuOg 1RJlRsGYJRjYw== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 784DF4E04 for ; Sun, 11 Aug 2024 16:42:18 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 61E2A3A293C for ; Sun, 11 Aug 2024 16:42:18 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 11 Aug 2024 16:42:11 +0200 Message-ID: <20240811144211.5712-10-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240811144211.5712-1-anton@khirnov.net> References: <20240811144211.5712-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/10] lavfi: move AVFilterLink.graph to FilterLink 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: YLov8ocDhMzP --- libavfilter/avfilter.c | 6 +++--- libavfilter/avfilter.h | 5 ----- libavfilter/avfiltergraph.c | 2 +- libavfilter/f_sendcmd.c | 2 +- libavfilter/filters.h | 5 +++++ 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 055db01e02..43d7c9f4ab 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -185,7 +185,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, link->srcpad = &src->output_pads[srcpad]; link->dstpad = &dst->input_pads[dstpad]; link->type = src->output_pads[srcpad].type; - link->graph = src->graph; + li->l.graph = src->graph; av_assert0(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1); link->format = -1; link->colorspace = AVCOL_SPC_UNSPECIFIED; @@ -231,8 +231,8 @@ static void update_link_current_pts(FilterLinkInternal *li, int64_t pts) li->l.current_pts = pts; li->l.current_pts_us = av_rescale_q(pts, link->time_base, AV_TIME_BASE_Q); /* TODO use duration */ - if (link->graph && li->age_index >= 0) - ff_avfilter_graph_update_heap(link->graph, li); + if (li->l.graph && li->age_index >= 0) + ff_avfilter_graph_update_heap(li->l.graph, li); } void ff_filter_set_ready(AVFilterContext *filter, unsigned priority) diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index a91b543f5e..549fe6ce3a 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -594,11 +594,6 @@ struct AVFilterLink { * Lists of supported formats / etc. supported by the output filter. */ AVFilterFormatsConfig outcfg; - - /** - * Graph the filter belongs to. - */ - struct AVFilterGraph *graph; }; /** diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 2d46dd7637..6bfcc42430 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -106,7 +106,7 @@ void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter filter->graph = NULL; for (j = 0; jnb_outputs; j++) if (filter->outputs[j]) - filter->outputs[j]->graph = NULL; + ff_filter_link(filter->outputs[j])->graph = NULL; return; } diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c index 86f9d522e9..8ba0878e81 100644 --- a/libavfilter/f_sendcmd.c +++ b/libavfilter/f_sendcmd.c @@ -567,7 +567,7 @@ FF_ENABLE_DEPRECATION_WARNINGS av_log(ctx, AV_LOG_VERBOSE, "Processing command #%d target:%s command:%s arg:%s\n", cmd->index, cmd->target, cmd->command, cmd_arg); - ret = avfilter_graph_send_command(inlink->graph, + ret = avfilter_graph_send_command(inl->graph, cmd->target, cmd->command, cmd_arg, buf, sizeof(buf), AVFILTER_CMD_FLAG_ONE); diff --git a/libavfilter/filters.h b/libavfilter/filters.h index 36164c171e..ab16047e12 100644 --- a/libavfilter/filters.h +++ b/libavfilter/filters.h @@ -42,6 +42,11 @@ typedef struct FilterLink { AVFilterLink pub; + /** + * Graph the filter belongs to. + */ + struct AVFilterGraph *graph; + /** * Current timestamp of the link, as defined by the most recent * frame(s), in link time_base units.