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 B94A749193 for ; Fri, 5 Apr 2024 16:16:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CB3EE68D2C1; Fri, 5 Apr 2024 19:13:30 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7326E68D1B0 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=gJTvoabY; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 4095E4D81 for ; Fri, 5 Apr 2024 18:13:09 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id bvZIOUOhDrKU 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=1712333584; bh=H/Of/nW9VwlhWLb0dnncGr52ZVh627nM2J1F2T92/io=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gJTvoabYGk398jCjmHCbIgiD0ugPlnupZ22D7gZRnRCN/0qMfV/vEEw6sgUM2BGAN N6sFY2bTO2Yy1e3XN3KFfwujdesJ15bEKnNy9Puh0ZOcTpiX9bYS/b8ZMa48DdeshC ittrWJevvhd/SGn1C8KR2EEyXM4wdLeQ1V2VdVxTGojyy5vl6OwhzOG9JBkeRyoeih HcOEPzV4OOX/EvsaQOpEOqnyAsAFKLr8S4fIoyoqUonUNbquCgG5qqITcNXMNx0FUj li+ZQnnePthWo59l8zn3D2yA77jVEr61HoYlNrj3ktl/EbO9r7SKalVOHRadaOObVo mUODf7PH6PtwQ== 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 2A0314DA2 for ; Fri, 5 Apr 2024 18:13:04 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 5E4033A167C 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:01 +0200 Message-ID: <20240405161212.26167-20-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 20/31] fftools/ffmpeg_filter: pass autoscale through OutputFilterOptions 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: Do not read it from OutputStream directly. Will allow decoupling filtering from encoding in future commits. --- fftools/ffmpeg.h | 2 +- fftools/ffmpeg_filter.c | 2 +- fftools/ffmpeg_mux_init.c | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index c61a670103..4059b1dcc3 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -267,6 +267,7 @@ enum OFilterFlags { OFILTER_FLAG_DISABLE_CONVERT = (1 << 0), // produce 24-bit audio OFILTER_FLAG_AUDIO_24BIT = (1 << 1), + OFILTER_FLAG_AUTOSCALE = (1 << 2), }; typedef struct OutputFilterOptions { @@ -565,7 +566,6 @@ typedef struct OutputStream { #if FFMPEG_OPT_TOP int top_field_first; #endif - int autoscale; int bitexact; int bits_per_raw_sample; diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 8aa4053716..dc9556bbc1 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -1366,7 +1366,7 @@ static int configure_output_video_filter(FilterGraph *fg, AVFilterGraph *graph, if (ret < 0) return ret; - if ((ofp->width || ofp->height) && ofilter->ost->autoscale) { + if ((ofp->width || ofp->height) && (ofp->flags & OFILTER_FLAG_AUTOSCALE)) { char args[255]; AVFilterContext *filter; const AVDictionaryEntry *e = NULL; diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c index 8f4b73f8a7..51c31eeb72 100644 --- a/fftools/ffmpeg_mux_init.c +++ b/fftools/ffmpeg_mux_init.c @@ -1045,7 +1045,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, OutputStream *ost; const AVCodec *enc; AVStream *st; - int ret = 0, keep_pix_fmt = 0; + int ret = 0, keep_pix_fmt = 0, autoscale = 1; AVRational enc_tb = { 0, 0 }; enum VideoSyncMethod vsync_method = VSYNC_AUTO; const char *bsfs = NULL, *time_base = NULL; @@ -1170,8 +1170,8 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, return ret; MATCH_PER_STREAM_OPT(presets, str, preset, oc, st); - ost->autoscale = 1; - MATCH_PER_STREAM_OPT(autoscale, i, ost->autoscale, oc, st); + + MATCH_PER_STREAM_OPT(autoscale, i, autoscale, oc, st); if (preset && (!(ret = get_preset_file_2(preset, enc->codec->name, &s)))) { AVBPrint bprint; av_bprint_init(&bprint, 0, AV_BPRINT_SIZE_UNLIMITED); @@ -1392,6 +1392,7 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type, .ts_offset = mux->of.start_time == AV_NOPTS_VALUE ? 0 : mux->of.start_time, .flags = OFILTER_FLAG_DISABLE_CONVERT * !!keep_pix_fmt | + OFILTER_FLAG_AUTOSCALE * !!autoscale | OFILTER_FLAG_AUDIO_24BIT * !!(av_get_exact_bits_per_sample(ost->enc_ctx->codec_id) == 24), }; -- 2.43.0 _______________________________________________ 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".