From patchwork Fri Apr 5 16:12:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 47854 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:24a8:b0:1a3:b6bb:3029 with SMTP id m40csp1071446pzd; Fri, 5 Apr 2024 09:17:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX+uf+cxjBvVXgfNqnENBGfw6bYMmdiG0yAqDAcYa8SUt41vNGyOgDq+epeTXc4V63oKfcBiVApWbQUJJOuXJvRAyr14lh8jYHOuw== X-Google-Smtp-Source: AGHT+IFYGWj6xOidvHltBBJ38akvnUibCePa6tTAgYi6pVogXR7Diheyia3bNjridEPI+rl+JELQ X-Received: by 2002:a05:6402:4027:b0:568:d6a2:716 with SMTP id d39-20020a056402402700b00568d6a20716mr2775925eda.7.1712333826003; Fri, 05 Apr 2024 09:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712333825; cv=none; d=google.com; s=arc-20160816; b=GyLCDYWrN68kKoT3xjrbxZ30kLHI2H7t0M3dbsmbjcDNyUWnBfYtOYIVp05gITD6i2 2xtZ2Umjiv4fnEVfu/WmxPk4itodr9fURiAfwBtxtT/bvd0kGSvSH6NG2+g0g1awYK1f +OfcZgvPbwkikLZr3QOGtAcOGCGvhuafPs1WfCvoMlXcIdWPJ45lEMoFuiCKbbn5BUWJ waJRVUWdZIL5Ihmht4ZWUPMs8cJI/Xq/H/B59tbGdFJt7Np40zdphxbORlBst/cYmE21 3v1ezwlyJ3/ep/yIaMTEUBpTnMXIYsO3ygts3tj8gZYZenwxnsebV5SGUo1aSU0OxdEM D5Mg== 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=EPE8FCPa2SMbT0PnKq/PJNst5naMuvJo98gURMvMGgU=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=WAfHCCJ61xxI3k4j3zWyUjJJOYKSYwbY3k3VEhBXGOFUKppYDbzC/XZ7SjBgyueuJ6 dtg11S/9yyNcd+kzZnyMG/IyVan9YWuDLEo03fBUyfYH2Cv2G5hfnmOaeWfSkyG72xXX 4nMkBuHTZb5+GQ0q8e4cdd5YKbPpkFoQbEz0H27HcKK+tS/ACo9nFFDpMm/gPaJ33K2D N5Kv0P15J/LwijtPNfyjz11H3taaGW4uu3gC6/jRqXskiKNpkHfvly7oe3AHtdC6sgeF JR6LRgP/xXHrKvf/wfLTK520ZCOcw18Sqvy6LJ/SE+gyqo9jIchS7T46XO/e7nNlhjAq kJ3g==; 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=On9yZ8wX; 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 t22-20020a056402525600b0056e1de90460si871450edd.309.2024.04.05.09.17.05; Fri, 05 Apr 2024 09:17:05 -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=On9yZ8wX; 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 E727468D32A; Fri, 5 Apr 2024 19:13:36 +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 9DB9468D1C4 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=On9yZ8wX; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 8FA034D96 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 VwQABzpP3ss4 for ; Fri, 5 Apr 2024 18:13:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1712333583; bh=WmuRTSB0QgWORW06lP9dkxzOwQ2hk8tsq0CIxoWWd7I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=On9yZ8wX4Clb5PGPvAXGfzCDYCJqtVO2FaMVunuoi7RZKs1OLZCGq9u7szNcZY3xi lDzgrke1UFPTI7FdhB+TUZvDD5oYQJeeDNdURkA9+3OmviWmRsrJJG55THotuBKDwt hLXDZcqjmTPG/kgqIQCHpkmfrqsBJAm54u1OU1TMbBQm1z232krC7XUUMG4qZS+J84 SjITjLx2xNsm90W8ifmkrrsbIDzIvgVwP9Cl3X8EuoHhfk7q0QReY2lA2XAW4ujDst 7gzmlfoWgpACzp7tpWAQ4S+q33kJ7y7ltwB2ppkawtMYRXR2CkzxvmCsWLsgvl4ICH KY1AAEHZHf2Mg== 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 E4F2A4DA1 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 8D4203A17AF 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:05 +0200 Message-ID: <20240405161212.26167-24-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 24/31] fftools/ffmpeg_mux: drop OutputFile.format 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: Bd9kBirYusl+ It is no longer used outside of the muxing code (where we can access the muxer directly). --- fftools/ffmpeg.h | 1 - fftools/ffmpeg_mux.c | 15 +++++++++------ fftools/ffmpeg_mux_init.c | 1 - 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 1d32009f90..7135d9563c 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -611,7 +611,6 @@ typedef struct OutputFile { int index; - const AVOutputFormat *format; const char *url; OutputStream **streams; diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index 6a64cba72d..2b7a733501 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -370,10 +370,11 @@ fail: return ret; } -static void thread_set_name(OutputFile *of) +static void thread_set_name(Muxer *mux) { char name[16]; - snprintf(name, sizeof(name), "mux%d:%s", of->index, of->format->name); + snprintf(name, sizeof(name), "mux%d:%s", + mux->of.index, mux->fc->oformat->name); ff_thread_setname(name); } @@ -417,7 +418,7 @@ int muxer_thread(void *arg) if (ret < 0) goto finish; - thread_set_name(of); + thread_set_name(mux); while (1) { OutputStream *ost; @@ -515,8 +516,10 @@ int print_sdp(const char *filename) if (!avc) return AVERROR(ENOMEM); for (int i = 0; i < nb_output_files; i++) { - if (!strcmp(output_files[i]->format->name, "rtp")) { - avc[j] = mux_from_of(output_files[i])->fc; + Muxer *mux = mux_from_of(output_files[i]); + + if (!strcmp(mux->fc->oformat->name, "rtp")) { + avc[j] = mux->fc; j++; } } @@ -756,7 +759,7 @@ int of_write_trailer(OutputFile *of) mux->last_filesize = filesize(fc->pb); - if (!(of->format->flags & AVFMT_NOFILE)) { + if (!(fc->oformat->flags & AVFMT_NOFILE)) { ret = avio_closep(&fc->pb); if (ret < 0) { av_log(mux, AV_LOG_ERROR, "Error closing file: %s\n", av_err2str(ret)); diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 9aad19a85d..ffcc20a504 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -3063,7 +3063,6 @@ int of_open(const OptionsContext *o, const char *filename, Scheduler *sch) av_strlcat(mux->log_name, oc->oformat->name, sizeof(mux->log_name)); - of->format = oc->oformat; if (recording_time != INT64_MAX) oc->duration = recording_time;