From patchwork Sun May 28 09:14:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41863 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51c:b0:10c:5e6f:955f with SMTP id gm28csp988034pzb; Sun, 28 May 2023 02:17:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7LBoyDJ/4roqwH61CZ1FHdyxvMo+k+m4arpt8mzrqMjD2biFPyz/H9cphf9pFw8GSaFeXV X-Received: by 2002:a17:906:6a29:b0:973:940e:a01d with SMTP id qw41-20020a1709066a2900b00973940ea01dmr7416214ejc.67.1685265428523; Sun, 28 May 2023 02:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685265428; cv=none; d=google.com; s=arc-20160816; b=HALryaJI/FWeCyiC1gybWvLqjPuY7zTyr1HfrhWTUzPtWcEp4eTZUYm+atm51xr5jB jCmMHoxLcofbmNMshuus8fVA/L4E6L/9R7LhBDkyxMKb3xBmspcR1o6i9bE1IykcB3PE 7GRCiStSdk7+h3iu6gu/IpRHKz7T7d323xVFkOvx4us6PtKh6Rq3m7Zl0Zofplt+wV8d T8yR2aAfL/dgzb4O+ZnzkJYV8V9szNQbHsPZbPAIAq3kNzhJBPPU9bfvHtYuiqs1kL1L /a88fsrJoTFeE+OQXpE7n/iV0E6HsWYb833/PTBgqKAIdRiIFynnYolmpFsr1tIvnLLL aokA== 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:delivered-to; bh=MDQ+jvNQ3ab+Wq6yudxuv74lC9ozHNJfj3CXdJDChao=; b=Q2M4fj9jLNmUl+RkHZxDIoC/bouzWeOhgs1K+oUt08OGyvuS1UMW8wRXOySJrZa8Kv /bFRycmVi4zZU460lTvQ2+eJdSC+MH5wH61cOGMUMti9wkx7hqcNpOWOjTHkptNos4B0 WfX3e79Bd94/G8sIQtlKi40eriBdDT0lGcFX1wnfd1l1VmOgHchCcqYe9KZLZzEejoLg be0j+hJ2SOZUFvCumOe+cTJsC31LhcPc0vBhQ2AuIcYV+08/A+xLW0dl7FDFqRuJRTA/ ovb7dO5Vhi19jfuRUzzJ5+X+GV9im6VXo/v4Yqe1M4uYxCuX1rRdzV0vUPGH62iS3EIz a4zA== 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 jg30-20020a170907971e00b0096f78953b79si3856016ejc.138.2023.05.28.02.17.08; Sun, 28 May 2023 02:17:08 -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 1D4E468C263; Sun, 28 May 2023 12:15:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B2E6168C214 for ; Sun, 28 May 2023 12:14:58 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 7FBE42404F5 for ; Sun, 28 May 2023 11:14:58 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id TPaGFIea85wM for ; Sun, 28 May 2023 11:14:58 +0200 (CEST) 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 mail0.khirnov.net (Postfix) with ESMTPS id D318C240D1B for ; Sun, 28 May 2023 11:14:47 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 0DDCD3A0D97 for ; Sun, 28 May 2023 11:14:42 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 28 May 2023 11:14:14 +0200 Message-Id: <20230528091416.17927-22-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230528091416.17927-1-anton@khirnov.net> References: <20230528091416.17927-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 22/24] fftools/ffmpeg_filter: constify the argument of filtergraph_is_simple() 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: pb5hZVan34WV --- fftools/ffmpeg.h | 2 +- fftools/ffmpeg_filter.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 655b5c7ec5..966397270d 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -731,7 +731,7 @@ int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_id int configure_filtergraph(FilterGraph *fg); void check_filter_outputs(void); -int filtergraph_is_simple(FilterGraph *fg); +int filtergraph_is_simple(const FilterGraph *fg); int init_simple_filtergraph(InputStream *ist, OutputStream *ost, char *graph_desc); int init_complex_filtergraph(FilterGraph *fg); diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 0bd0593724..62ba27e559 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -54,6 +54,11 @@ static FilterGraphPriv *fgp_from_fg(FilterGraph *fg) return (FilterGraphPriv*)fg; } +static const FilterGraphPriv *cfgp_from_cfg(const FilterGraph *fg) +{ + return (const FilterGraphPriv*)fg; +} + typedef struct InputFilterPriv { InputFilter ifilter; @@ -1674,9 +1679,9 @@ static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *fr return 0; } -int filtergraph_is_simple(FilterGraph *fg) +int filtergraph_is_simple(const FilterGraph *fg) { - FilterGraphPriv *fgp = fgp_from_fg(fg); + const FilterGraphPriv *fgp = cfgp_from_cfg(fg); return fgp->is_simple; }