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 5B50846C9F for ; Fri, 7 Jul 2023 09:50:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1661268C801; Fri, 7 Jul 2023 12:49:19 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B1EFA68C7BE for ; Fri, 7 Jul 2023 12:49:08 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id EF3F22404EE for ; Fri, 7 Jul 2023 11:49:07 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id gAVn9vV6Jq9K for ; Fri, 7 Jul 2023 11:49:07 +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 14F7F240705 for ; Fri, 7 Jul 2023 11:49:01 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id A37563A142E 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:35 +0200 Message-Id: <20230707094847.25324-10-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 10/22] fftools/ffmpeg_filter: make OutputFile.width, height 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: They are not used outside of the filtering code. --- fftools/ffmpeg.h | 3 --- fftools/ffmpeg_filter.c | 14 ++++++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index b789233a08..79f3f35b3a 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -294,9 +294,6 @@ typedef struct OutputFilter { enum AVMediaType type; - /* desired output stream properties */ - int width, height; - // 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. const int *formats; diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 0272b0a96b..0874187f3e 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -138,6 +138,7 @@ typedef struct OutputFilterPriv { /* desired output stream properties */ int format; + int width, height; int sample_rate; AVChannelLayout ch_layout; } OutputFilterPriv; @@ -683,8 +684,8 @@ void ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost) switch (ost->enc_ctx->codec_type) { case AVMEDIA_TYPE_VIDEO: - ofilter->width = ost->enc_ctx->width; - ofilter->height = ost->enc_ctx->height; + ofp->width = ost->enc_ctx->width; + ofp->height = ost->enc_ctx->height; if (ost->enc_ctx->pix_fmt != AV_PIX_FMT_NONE) { ofp->format = ost->enc_ctx->pix_fmt; } else { @@ -1068,6 +1069,7 @@ static int insert_filter(AVFilterContext **last_filter, int *pad_idx, static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out) { + OutputFilterPriv *ofp = ofp_from_ofilter(ofilter); OutputStream *ost = ofilter->ost; OutputFile *of = output_files[ost->file_index]; AVFilterContext *last_filter = out->filter_ctx; @@ -1085,13 +1087,13 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, if (ret < 0) return ret; - if ((ofilter->width || ofilter->height) && ofilter->ost->autoscale) { + if ((ofp->width || ofp->height) && ofilter->ost->autoscale) { char args[255]; AVFilterContext *filter; const AVDictionaryEntry *e = NULL; snprintf(args, sizeof(args), "%d:%d", - ofilter->width, ofilter->height); + ofp->width, ofp->height); while ((e = av_dict_iterate(ost->sws_dict, e))) { av_strlcatf(args, sizeof(args), ":%s=%s", e->key, e->value); @@ -1596,8 +1598,8 @@ static int configure_filtergraph(FilterGraph *fg) ofp->format = av_buffersink_get_format(sink); - ofilter->width = av_buffersink_get_w(sink); - ofilter->height = av_buffersink_get_h(sink); + ofp->width = av_buffersink_get_w(sink); + ofp->height = av_buffersink_get_h(sink); ofp->sample_rate = av_buffersink_get_sample_rate(sink); av_channel_layout_uninit(&ofp->ch_layout); -- 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".