From: Niklas Haas <ffmpeg@haasn.xyz> To: ffmpeg-devel@ffmpeg.org Cc: Niklas Haas <git@haasn.dev> Subject: [FFmpeg-devel] [PATCH v2 2/4] avfilter/filters: keep track of AVFilterPad labels Date: Tue, 18 Feb 2025 13:46:01 +0100 Message-ID: <20250218124603.95398-2-ffmpeg@haasn.xyz> (raw) In-Reply-To: <20250218124603.95398-1-ffmpeg@haasn.xyz> From: Niklas Haas <git@haasn.dev> For use in diagnostic code e.g. avfilter_graph_dump(). --- libavfilter/avfilter.c | 2 ++ libavfilter/filters.h | 6 ++++++ libavfilter/graphparser.c | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index e732556ffa..b434724694 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -825,11 +825,13 @@ void avfilter_free(AVFilterContext *filter) for (i = 0; i < filter->nb_inputs; i++) { free_link(filter->inputs[i]); + av_freep(&filter->input_pads[i].label); if (filter->input_pads[i].flags & AVFILTERPAD_FLAG_FREE_NAME) av_freep(&filter->input_pads[i].name); } for (i = 0; i < filter->nb_outputs; i++) { free_link(filter->outputs[i]); + av_freep(&filter->output_pads[i].label); if (filter->output_pads[i].flags & AVFILTERPAD_FLAG_FREE_NAME) av_freep(&filter->output_pads[i].name); } diff --git a/libavfilter/filters.h b/libavfilter/filters.h index 654aed5c9e..751a125f52 100644 --- a/libavfilter/filters.h +++ b/libavfilter/filters.h @@ -43,6 +43,12 @@ struct AVFilterPad { */ const char *name; + /** + * Parsed label for this filter pad in the filter graph, or NULL if + * anonymous or unknown. + */ + const char *label; + /** * AVFilterPad type. */ diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c index a23e26d2e3..9f8dd3190a 100644 --- a/libavfilter/graphparser.c +++ b/libavfilter/graphparser.c @@ -564,6 +564,12 @@ int avfilter_graph_segment_create_filters(AVFilterGraphSegment *seg, int flags) } } + /* Set all filter pad labels to their corresponding parsed labels */ + for (size_t i = 0; i < FFMIN(p->nb_inputs, p->filter->nb_inputs); i++) + p->filter->input_pads[i].label = av_strdup(p->inputs[i]->label); + for (size_t i = 0; i < FFMIN(p->nb_outputs, p->filter->nb_outputs); i++) + p->filter->output_pads[i].label = av_strdup(p->outputs[i]->label); + av_freep(&p->filter_name); av_freep(&p->instance_name); -- 2.47.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".
next prev parent reply other threads:[~2025-02-18 12:46 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-02-18 12:46 [FFmpeg-devel] [PATCH v2 1/4] avfilter/graphdump: implement options parsing Niklas Haas 2025-02-18 12:46 ` Niklas Haas [this message] 2025-02-18 12:46 ` [FFmpeg-devel] [PATCH v2 3/4] avfilter/graphdump: add complex format Niklas Haas 2025-02-18 12:46 ` [FFmpeg-devel] [PATCH v2 4/4] fftools/ffmpeg_filter: add -dump_filter_graph option Niklas Haas 2025-02-18 16:43 ` epirat07 2025-02-19 17:36 ` Niklas Haas 2025-02-18 12:50 ` [FFmpeg-devel] [PATCH v2 1/4] avfilter/graphdump: implement options parsing Niklas Haas
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=20250218124603.95398-2-ffmpeg@haasn.xyz \ --to=ffmpeg@haasn.xyz \ --cc=ffmpeg-devel@ffmpeg.org \ --cc=git@haasn.dev \ /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