From patchwork Tue Sep 24 07:09:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51785 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:ad12:0:b0:48e:c0f8:d0de with SMTP id w18csp173938vqy; Tue, 24 Sep 2024 00:19:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVbWkS4bNGJBUaZMonb55ax7xIV2B9elCNwkuuaA15800XOfg5zfkXOE1x9goG2pyPCYrOTmEub+qjkEpseZIrU@gmail.com X-Google-Smtp-Source: AGHT+IEbzLAe1QfQyTwpmAUtulEHhbtTu5w8sjHu5JInMKIIB5srK7FQTi5mLS2AVfJiO95cMXqq X-Received: by 2002:a05:6402:4401:b0:5c5:b6f0:71cf with SMTP id 4fb4d7f45d1cf-5c5b6f07262mr8616330a12.21.1727162356727; Tue, 24 Sep 2024 00:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727162356; cv=none; d=google.com; s=arc-20240605; b=icigq1kdmYQQxESExA+jAXvqaUby9TJ6HvWzT0pgMkse/65uauQqXaHRio/nf05l0Y pww9tzT5j2UiNhR9kqclOSEtGvWBmSA+I0NtQGsh2/bB6oHJISnvfB42dWoqEuv5JUyM FcOl1JwfxdFTDUnz40Ku384lKjcTqCx/neKPfB9QUsJTBlYG9Q3qzxCGoO7XjG7Lsojd PiIJEgz9hw7cw5lQt3VXCAxCMA+xcVxoAB+ZmLEPxW4iIHueUIKb0qQ+wUD6/f2OfbD3 N2bOLlAzGzG3S9VrxLrO3Ays6TowoHXBRqENjKAbY/KGBipO4oislcFCnTX7OiSXaFxy ybgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=dTk3RQHwcVs+Cb4PnRbXPadKcnnUy0/DrK+OVOVcVhI=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=cpu5fiy9EmJB7rng0SvNf8qdheED+Ibt2phhdGX/DwHMXrViHKO/bOiesCtqsaUTeX fylV2zzepe9yeNweG6llw/gS9gnqZ7xHlicVqcbJLQ9jRbXIC3DRP9iFjzBE5oDcRK14 kqinNvsoVrsir2hL2OGxSPSDBLyJvGrZytHP3YedQIsfDlzyd5gWOfq5ChCbNJiXEjNp lmPQE3sHmsTGxXJwiio0JHgoCEuDVf1cO1CTfk4RisrVmhBY6YVq/3Osp3j3YYIBY0jB rlvK+20XVfhchmJ+yzPxMsGOBOKWBQpgcmmSs4TlaCMqKCBa/XPeh8oxrIors4o9SM8F paOA==; 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=d80BtSoJ; 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-5c5cf4c4224si597738a12.209.2024.09.24.00.19.16; Tue, 24 Sep 2024 00:19:16 -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=d80BtSoJ; 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 2DC5668DAB2; Tue, 24 Sep 2024 10:10:37 +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 7375C68DB57 for ; Tue, 24 Sep 2024 10:10:22 +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=d80BtSoJ; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 172F74E0B for ; Tue, 24 Sep 2024 09:10:18 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id zfw0XxEXH6ap for ; Tue, 24 Sep 2024 09:10:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727161815; bh=oefIfuELdLRKz8eiD75flZU6iL96VrCsWvNjiZD92T0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=d80BtSoJ8LAdHg+jH3kVZHCanhm1Luq0b/AlkDX3BZ9SA+FWLv9zcm0X0Ph//joB4 kgmG04quqWrwsK/siVxVO0wog445+Jl6sdi1XlsEihBUdqjSHfaHS221V1gIeMeWdU Rp2bRK5PEsANkwEf43T7nNLQnZ3SfkksjduGQ6g1W1dDKUfF6UhfKeA37IQ5Q5CUmX y2y6h+S93up1ypiGOfjNBQ06G1d/7vsfcK2ud8UgZDY9gn0RJ6t18gREeocCYRPt2l MRDDZw3l3izLFXg+jXXLKHmDnGpxptTiK/JlVercYxRVRYft02wCcjZ8QXF2IOMD5W fUWo820nCk+1w== 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 8A72E4E12 for ; Tue, 24 Sep 2024 09:10:15 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 643CE3A1A81 for ; Tue, 24 Sep 2024 09:10:10 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 24 Sep 2024 09:09:53 +0200 Message-ID: <20240924071000.11428-12-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240924071000.11428-1-anton@khirnov.net> References: <20240924071000.11428-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/13] fftools/ffmpeg_filter: drop the OutputStream parameter to ofilter_bind_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: e1ACWRjrjyJn It is no longer used for anything besides a sanity-checking assert. Rename the function to ofilter_bind_enc(), as it no longer has any assumptions about the target being an output stream. --- fftools/ffmpeg.h | 2 +- fftools/ffmpeg_filter.c | 8 ++++---- fftools/ffmpeg_mux_init.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 29679432c6..d20034efb0 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -772,7 +772,7 @@ const FrameData *frame_data_c(AVFrame *frame); FrameData *packet_data (AVPacket *pkt); const FrameData *packet_data_c(AVPacket *pkt); -int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, +int ofilter_bind_enc(OutputFilter *ofilter, unsigned sched_idx_enc, const OutputFilterOptions *opts); diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 94b4f4bb31..7faa666d2d 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -783,8 +783,7 @@ static int set_channel_layout(OutputFilterPriv *f, const AVChannelLayout *layout return 0; } -int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, - unsigned sched_idx_enc, +int ofilter_bind_enc(OutputFilter *ofilter, unsigned sched_idx_enc, const OutputFilterOptions *opts) { OutputFilterPriv *ofp = ofp_from_ofilter(ofilter); @@ -793,7 +792,8 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, int ret; av_assert0(!ofilter->bound); - av_assert0(ofilter->type == ost->type); + av_assert0(!opts->enc || + ofilter->type == opts->enc->type); ofilter->bound = 1; av_freep(&ofilter->linklabel); @@ -1222,7 +1222,7 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost, if (ret < 0) return ret; - ret = ofilter_bind_ost(fg->outputs[0], ost, sched_idx_enc, opts); + ret = ofilter_bind_enc(fg->outputs[0], sched_idx_enc, opts); if (ret < 0) return ret; diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 1435d8339d..53a17c33a6 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -1008,7 +1008,7 @@ ost_bind_filter(const Muxer *mux, MuxStream *ms, OutputFilter *ofilter, if (ofilter) { ost->filter = ofilter; - ret = ofilter_bind_ost(ofilter, ost, ms->sch_idx_enc, &opts); + ret = ofilter_bind_enc(ofilter, ms->sch_idx_enc, &opts); } else { ret = init_simple_filtergraph(ost->ist, ost, filters, mux->sch, ms->sch_idx_enc, &opts);