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 06BDA48D01 for ; Sun, 24 Mar 2024 20:34:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F36CC68D40F; Sun, 24 Mar 2024 22:34:21 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0D89768D22A for ; Sun, 24 Mar 2024 22:34:15 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 92BF9EA289 for ; Sun, 24 Mar 2024 21:34:14 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2bR1DPo822Oy for ; Sun, 24 Mar 2024 21:34:09 +0100 (CET) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id B3C6AE8274 for ; Sun, 24 Mar 2024 21:34:08 +0100 (CET) Date: Sun, 24 Mar 2024 21:34:08 +0100 (CET) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: Message-ID: References: <79a25348-0193-4acb-8844-cd2dfaa73ac6@gmail.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] Fixes #10509 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, 24 Mar 2024, Poorva wrote: > From 0874a55ad33bb4df2789cbafc5247c0ae3d97e6a Mon Sep 17 00:00:00 2001 > From: PoorvaGaikar > Date: Sat, 9 Mar 2024 00:27:25 +0530 > Subject: [PATCH v2] avfilter/f_select.c: add support for iw and ih constants You should mention the fixed ticket number in the commit message. > > --- > doc/filters.texi | 6 ++++++ > libavfilter/f_select.c | 14 ++++++++++++++ > 2 files changed, 20 insertions(+) > > diff --git a/doc/filters.texi b/doc/filters.texi > index 913365671d..e73dc9c1bf 100644 > --- a/doc/filters.texi > +++ b/doc/filters.texi > @@ -30737,6 +30737,12 @@ missing. > That basically means that an input frame is selected if its pts is within the > interval set by the concat demuxer. > > +@item iw @emph{(video only)} > +Represents the width of the input video frame > + > +@item ih @emph{(video only)} > +Represents the height of the input video frame > + > @end table > > The default value of the select expression is "1". > diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c > index 9b330a0673..ccfe915ee1 100644 > --- a/libavfilter/f_select.c > +++ b/libavfilter/f_select.c > @@ -90,6 +90,9 @@ static const char *const var_names[] = { > > "concatdec_select", ///< frame is within the interval set by the concat demuxer > > + "ih", ///< ih: Represents the height of the input video frame. > + "iw", ///< iw: Represents the width of the input video frame. > + > NULL > }; > > @@ -144,6 +147,9 @@ enum var_name { > > VAR_CONCATDEC_SELECT, > > + VAR_IH, > + VAR_IW, > + > VAR_VARS_NB > }; > > @@ -264,6 +270,9 @@ static int config_input(AVFilterLink *inlink) > select->var_values[VAR_CONSUMED_SAMPLES_N] = NAN; > select->var_values[VAR_SAMPLES_N] = NAN; > > + select->var_values[VAR_IH] = NAN; > + select->var_values[VAR_IW] = NAN; > + > select->var_values[VAR_SAMPLE_RATE] = > inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN; > > @@ -370,6 +379,10 @@ FF_ENABLE_DEPRECATION_WARNINGS > } > break; > } > + if (inlink->type == AVMEDIA_TYPE_VIDEO){ > + select->var_values[VAR_IH] = frame->height; > + select->var_values[VAR_IW] = frame->width; > + } There is a switch(inlink->type) just above this, so you should put these there to the corresponding case AVMEDIA_TYPE_VIDEO, and not create a new block. > > select->select = res = av_expr_eval(select->expr, select->var_values, NULL); > av_log(inlink->dst, AV_LOG_DEBUG, > @@ -546,3 +559,4 @@ const AVFilter ff_vf_select = { > .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS | AVFILTER_FLAG_METADATA_ONLY, > }; > #endif /* CONFIG_SELECT_FILTER */ > + This is still an uneeded newline. Regards, Marton _______________________________________________ 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".