From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3AFB246C9F for ; Fri, 7 Jul 2023 09:52:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7FAD268C84C; Fri, 7 Jul 2023 12:49:29 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7AC2A68C7E2 for ; Fri, 7 Jul 2023 12:49:07 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 605902404F8 for ; Fri, 7 Jul 2023 11:49:04 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id w4K20OEJAxcl for ; Fri, 7 Jul 2023 11:49:03 +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 D25C92405EC for ; Fri, 7 Jul 2023 11:49:00 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 978D63A12EC for ; Fri, 7 Jul 2023 11:48:54 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 7 Jul 2023 11:48:34 +0200 Message-Id: <20230707094847.25324-9-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230707094847.25324-1-anton@khirnov.net> References: <20230707094847.25324-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/22] fftools/ffmpeg_filter: make OutputFile.ch_layout private 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: It is not used outside of the filtering code. --- fftools/ffmpeg.h | 1 - fftools/ffmpeg_filter.c | 17 ++++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 5b4117eeea..b789233a08 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -296,7 +296,6 @@ typedef struct OutputFilter { /* desired output stream properties */ int width, height; - AVChannelLayout ch_layout; // those are only set if no format is specified and the encoder gives us multiple options // They point directly to the relevant lists of the encoder. diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index b1fda7b9e8..0272b0a96b 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -139,6 +139,7 @@ typedef struct OutputFilterPriv { /* desired output stream properties */ int format; int sample_rate; + AVChannelLayout ch_layout; } OutputFilterPriv; static OutputFilterPriv *ofp_from_ofilter(OutputFilter *ofilter) @@ -375,9 +376,10 @@ DEF_CHOOSE_FORMAT(sample_rates, int, sample_rate, sample_rates, 0, static void choose_channel_layouts(OutputFilter *ofilter, AVBPrint *bprint) { - if (av_channel_layout_check(&ofilter->ch_layout)) { + OutputFilterPriv *ofp = ofp_from_ofilter(ofilter); + if (av_channel_layout_check(&ofp->ch_layout)) { av_bprintf(bprint, "channel_layouts="); - av_channel_layout_describe_bprint(&ofilter->ch_layout, bprint); + av_channel_layout_describe_bprint(&ofp->ch_layout, bprint); } else if (ofilter->ch_layouts) { const AVChannelLayout *p; @@ -630,7 +632,7 @@ static int ifilter_bind_ist(InputFilter *ifilter, InputStream *ist) return 0; } -static void set_channel_layout(OutputFilter *f, OutputStream *ost) +static void set_channel_layout(OutputFilterPriv *f, OutputStream *ost) { const AVCodec *c = ost->enc_ctx->codec; int i, err; @@ -701,7 +703,7 @@ void ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost) ofilter->sample_rates = c->supported_samplerates; } if (ost->enc_ctx->ch_layout.nb_channels) { - set_channel_layout(ofilter, ost); + set_channel_layout(ofp, ost); } else if (c->ch_layouts) { ofilter->ch_layouts = c->ch_layouts; } @@ -782,10 +784,11 @@ void fg_free(FilterGraph **pfg) av_freep(&fg->inputs); for (int j = 0; j < fg->nb_outputs; j++) { OutputFilter *ofilter = fg->outputs[j]; + OutputFilterPriv *ofp = ofp_from_ofilter(ofilter); av_freep(&ofilter->linklabel); av_freep(&ofilter->name); - av_channel_layout_uninit(&ofilter->ch_layout); + av_channel_layout_uninit(&ofp->ch_layout); av_freep(&fg->outputs[j]); } av_freep(&fg->outputs); @@ -1597,8 +1600,8 @@ static int configure_filtergraph(FilterGraph *fg) ofilter->height = av_buffersink_get_h(sink); ofp->sample_rate = av_buffersink_get_sample_rate(sink); - av_channel_layout_uninit(&ofilter->ch_layout); - ret = av_buffersink_get_ch_layout(sink, &ofilter->ch_layout); + av_channel_layout_uninit(&ofp->ch_layout); + ret = av_buffersink_get_ch_layout(sink, &ofp->ch_layout); if (ret < 0) goto fail; } -- 2.40.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".