From patchwork Fri Apr 5 16:12:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 47846 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:24a8:b0:1a3:b6bb:3029 with SMTP id m40csp1070879pzd; Fri, 5 Apr 2024 09:16:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXP/yVL+MDPtdv9L3tvci2Zy1yamer0WKxeQmZ/j9LJqLVCy89PcW87kQrbUYasYxkKWAkNZ274uH2PGCS65SBUfOlDd8hyvcLnww== X-Google-Smtp-Source: AGHT+IE+oC+vKPFFcVJEJb22ojo+8Uop8pYyYUzAx2m4dD94pLjv1uIxH3eUMjvZqPyUmbgu0YAb X-Received: by 2002:a17:906:7f8d:b0:a51:9fbd:6ec0 with SMTP id f13-20020a1709067f8d00b00a519fbd6ec0mr1530849ejr.63.1712333774056; Fri, 05 Apr 2024 09:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712333774; cv=none; d=google.com; s=arc-20160816; b=Wa3t3YcvbUBvv6+mpRBGA5RXzvE7QjQ4/rm2ifquOwb9sdVEupiUYKjbGgZXZyVqCq 5ImzYyk0/2j74I1cYFdwUYKwzW4LrkaJKXRDHvLX67VuXTKxRZAEkuMBPVEnYby8QWxv 2WjJXIpVT5bc+WY/o0PcuYcrsyfcSKALfFCL09BkWVbJGpqpoQLNH0F0pCbn0ArtCNCR 9tDybECLLZUa2GTwo/aMrsKNMgxoM9BxWEw8SMqZwDUkndmueaa8/dHK6q3RWP5EHR9d PHLp14VNAMJ+Vt2AeZbc/M5cmxMx+UmZf17JD4kZOEPSS1DXBPBCua53U1kjytXOtkwB 9StQ== 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=abdIgEiN7c7ebBbvD0ysRcEF3K8vsoA5fYrzRNqeiW0=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=OeFTATX0d2GDyhfzxPCMmVAMTVzDO+B4uyduD9KeaOeiAnnPq0oYTmGOnQZAWSb6Ot 2Mp9vXNF8V8mGysMC3sfcUPesGpaMPBWKP7V0ZUXxIWPLMpi3xIJN9mrhIEC7QcdCukn YEdcmMJtybCcHHSmvLUG29gitBgSw3lG+P5jQvmn9u94qYzW3Kmmy++OaZJ3aawL93Cq BQkn/OI6MEUWuoxKSyvMtNg0QQQyxlFyu5xODYVv7bbeuHeAOVBbxS73MjJ8e4XNPnSX z+5jvHSdRx0xQRk+HkCeEKzJMjaq2ukhzHkoyOihsgfKuvMsYPemA27VxH3Z92ld2qr/ ro+w==; 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=sBsCrlhL; 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 w26-20020a170906481a00b00a51970e93acsi810033ejq.640.2024.04.05.09.16.00; Fri, 05 Apr 2024 09:16:14 -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=sBsCrlhL; 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 EC5A868D293; Fri, 5 Apr 2024 19:13:28 +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 5F73B68D1AC for ; Fri, 5 Apr 2024 19:13:10 +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=sBsCrlhL; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 402F34D88 for ; Fri, 5 Apr 2024 18:13:08 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id h3EQIRtjurDD for ; Fri, 5 Apr 2024 18:13:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1712333583; bh=qNzgtm4Ys5p8ywgXNMugEuQwGRJucnBc8lMh7hDmh6k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sBsCrlhLqzY5VENLgvaK2BNsoWhFq4gqcpKult5PfnXgfutDauf01yV3R9REcV49U +E36tCing3NDO2/6HQbK+NIz7N068G/9ZBlBmEvFkv0fgKHTFknAadRsgeizhU69pU N5m78eLz2flKjQZ1WlezVAXZOcf8qbv/42nhYS+LbuWuL7589zhnEtF/JgoN/3uqXT ZUmF1kiiSJmTOM29fCJ/RMj4GaVEnjGni7AWsdovVdcdvANGtJlKn7409LVLXFm1B7 e8V4R1b6ukOO1p1+Fu/BLWXo9SFXGF8hzOEcfndeoZLkTheM1Z4tSUnVPxkayxMO+q +V58KCWj1+rHA== 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 A42564D9E for ; Fri, 5 Apr 2024 18:13:03 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id A49843A186D for ; Fri, 5 Apr 2024 18:12:56 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Apr 2024 18:12:07 +0200 Message-ID: <20240405161212.26167-26-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240405161212.26167-1-anton@khirnov.net> References: <20240405161212.26167-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 26/31] fftools/ffmpeg_filter: drop OutputFilter.ost 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: vHbhRqBp+drD All remaining code accessing it only needs to know whether this filtergraph output has been bound or not. --- fftools/ffmpeg.h | 2 +- fftools/ffmpeg_filter.c | 6 +++--- fftools/ffmpeg_mux_init.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index f77ec956b3..6446a141b5 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -314,12 +314,12 @@ typedef struct InputFilter { typedef struct OutputFilter { const AVClass *class; - struct OutputStream *ost; struct FilterGraph *graph; uint8_t *name; /* for filters that are not yet bound to an output stream, * this stores the output linklabel, if any */ + int bound; uint8_t *linklabel; char *apad; diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 9fc6e32960..3988cf5fc2 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -806,10 +806,10 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, FilterGraphPriv *fgp = fgp_from_fg(fg); int ret; - av_assert0(!ofilter->ost); + av_assert0(!ofilter->bound); av_assert0(ofilter->type == ost->type); - ofilter->ost = ost; + ofilter->bound = 1; av_freep(&ofilter->linklabel); ofp->flags = opts->flags; @@ -1279,7 +1279,7 @@ int fg_finalise_bindings(FilterGraph *fg) for (int i = 0; i < fg->nb_outputs; i++) { OutputFilter *output = fg->outputs[i]; - if (!output->ost) { + if (!output->bound) { av_log(filtergraphs[i], AV_LOG_FATAL, "Filter %s has an unconnected output\n", output->name); return AVERROR(EINVAL); diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 10421ae1b0..6d8bd5bcdf 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -1827,7 +1827,7 @@ static int create_streams(Muxer *mux, const OptionsContext *o) for (int j = 0; j < fg->nb_outputs; j++) { OutputFilter *ofilter = fg->outputs[j]; - if (ofilter->linklabel || ofilter->ost) + if (ofilter->linklabel || ofilter->bound) continue; auto_disable |= 1 << ofilter->type;