From: Anton Khirnov <anton@khirnov.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 3/5] lavfi: add a new filtergraph parsing API
Date: Wed, 01 Feb 2023 08:02:20 +0100
Message-ID: <167523494066.4503.2538286790214421557@lain.khirnov.net> (raw)
In-Reply-To: <Y9e/QFyS+8Oo6ApL@phare.normalesup.org>
Quoting Nicolas George (2023-01-30 13:59:44)
> > +static unsigned
> > +find_linklabel(AVFilterGraphSegment *seg, const char *label,
> > + int output, size_t idx_chain, size_t idx_filter,
> > + AVFilterParams **pp)
> > +{
> > + for (; idx_chain < seg->nb_chains; idx_chain++) {
> > + AVFilterChain *ch = seg->chains[idx_chain];
> > +
> > + for (; idx_filter < ch->nb_filters; idx_filter++) {
> > + AVFilterParams *p = ch->filters[idx_filter];
> > + AVFilterPadParams **io = output ? p->outputs : p->inputs;
> > + unsigned nb_io = output ? p->nb_outputs : p->nb_inputs;
> > + AVFilterLink **l;
> > + unsigned nb_l;
> > +
> > + if (!p->filter)
> > + continue;
> > +
> > + l = output ? p->filter->outputs : p->filter->inputs;
> > + nb_l = output ? p->filter->nb_outputs : p->filter->nb_inputs;
> > +
> > + for (unsigned i = 0; i < FFMIN(nb_io, nb_l); i++)
> > + if (!l[i] && io[i]->label && !strcmp(io[i]->label, label)) {
> > + *pp = p;
> > + return i;
> > + }
> > + }
> > +
> > + idx_filter = 0;
> > + }
> > +
> > + *pp = NULL;
> > + return 0;
> > +}
>
> If I read this code correctly, it will only find link labels that are
> defined later in the chain or in a later chain. But referring to earlier
> link labels is supported. Even cycles are meant to be supported at
> parsing level (format negotiation will likely fail, though, but being
> able to make cycles was a goal from the start).
The earlier filters have already been processed at this point, so if an
earlier filter had a link label that would match this one, then it's
already been linked. So there's no point in considering earlier filters.
--
Anton Khirnov
_______________________________________________
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".
next prev parent reply other threads:[~2023-02-01 7:02 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-20 19:31 [FFmpeg-devel] [PATCH 1/5] lavfi/avfilter: export process_options() Anton Khirnov
2023-01-20 19:31 ` [FFmpeg-devel] [PATCH 2/5] lavfi/avfilter: track whether a filter has been initialized Anton Khirnov
2023-01-20 19:31 ` [FFmpeg-devel] [PATCH 3/5] lavfi: add a new filtergraph parsing API Anton Khirnov
2023-01-30 12:59 ` Nicolas George
2023-02-01 7:02 ` Anton Khirnov [this message]
2023-02-03 9:14 ` [FFmpeg-devel] [PATCH] " Anton Khirnov
2023-02-10 9:49 ` Anton Khirnov
2023-01-20 19:31 ` [FFmpeg-devel] [PATCH 4/5] lavfi/graphparser: reimplement avfilter_graph_parse* using new API Anton Khirnov
2023-01-20 20:47 ` Nicolas George
2023-01-20 21:11 ` Jean-Baptiste Kempf
2023-01-20 21:32 ` Nicolas George
2023-01-20 21:39 ` Nicolas George
2023-01-23 12:29 ` James Almer
2023-01-30 13:04 ` Nicolas George
2023-01-24 21:51 ` Paul B Mahol
2023-01-20 22:36 ` Anton Khirnov
2023-05-30 21:09 ` Marton Balint
2023-05-31 14:39 ` Paul B Mahol
2023-06-03 10:02 ` Anton Khirnov
2023-01-20 19:31 ` [FFmpeg-devel] [PATCH 5/5] fftools/ffmpeg: add special syntax for loading filter options from files Anton Khirnov
2023-01-23 11:34 ` Anton Khirnov
2023-01-27 16:47 ` [FFmpeg-devel] [PATCH 1/5] lavfi/avfilter: export process_options() Anton Khirnov
2023-01-27 16:48 ` Nicolas George
2023-01-27 16:51 ` Anton Khirnov
2023-01-27 16:53 ` Nicolas George
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=167523494066.4503.2538286790214421557@lain.khirnov.net \
--to=anton@khirnov.net \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git