Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avfilter/f_select: also handle global side data in filter links (PR #21072)
@ 2025-12-01 14:11 James Almer via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: James Almer via ffmpeg-devel @ 2025-12-01 14:11 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: James Almer

PR #21072 opened by James Almer (jamrial)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21072
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21072.patch

Should fix issue ffmpeg/ffmpeg#21071


>From e977f97b75681984fbd8e93e37687ad6d989131c Mon Sep 17 00:00:00 2001
From: James Almer <jamrial@gmail.com>
Date: Mon, 1 Dec 2025 11:07:43 -0300
Subject: [PATCH] avfilter/f_select: also handle global side data in filter
 links

Should fix issue #21071

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavfilter/f_sidedata.c | 45 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 43 insertions(+), 2 deletions(-)

diff --git a/libavfilter/f_sidedata.c b/libavfilter/f_sidedata.c
index b88a8cbd02..dc7da5a19a 100644
--- a/libavfilter/f_sidedata.c
+++ b/libavfilter/f_sidedata.c
@@ -96,6 +96,31 @@ static av_cold int init(AVFilterContext *ctx)
     return 0;
 }
 
+static int config_props(AVFilterLink *outlink)
+{
+    AVFilterContext *ctx = outlink->src;
+    SideDataContext *s = ctx->priv;
+    const AVFrameSideData *sd = NULL;
+
+    if (s->type != -1)
+       sd = av_frame_side_data_get(outlink->side_data, outlink->nb_side_data, s->type);
+
+    switch (s->mode) {
+    case SIDEDATA_SELECT:
+        break;
+    case SIDEDATA_DELETE:
+        if (s->type == -1)
+            av_frame_side_data_free(&outlink->side_data, &outlink->nb_side_data);
+        else if (sd)
+            av_frame_side_data_remove(&outlink->side_data, &outlink->nb_side_data, s->type);
+        break;
+    default:
+        av_assert0(0);
+    };
+
+    return 0;
+}
+
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 {
     AVFilterContext *ctx = inlink->dst;
@@ -143,6 +168,14 @@ static const AVFilterPad ainputs[] = {
     },
 };
 
+static const AVFilterPad aoutputs[] = {
+    {
+        .name         = "default",
+        .type         = AVMEDIA_TYPE_AUDIO,
+        .config_props = config_props,
+    },
+};
+
 const FFFilter ff_af_asidedata = {
     .p.name        = "asidedata",
     .p.description = NULL_IF_CONFIG_SMALL("Manipulate audio frame side data."),
@@ -152,7 +185,7 @@ const FFFilter ff_af_asidedata = {
     .priv_size     = sizeof(SideDataContext),
     .init          = init,
     FILTER_INPUTS(ainputs),
-    FILTER_OUTPUTS(ff_audio_default_filterpad),
+    FILTER_OUTPUTS(aoutputs),
 };
 #endif /* CONFIG_ASIDEDATA_FILTER */
 
@@ -169,6 +202,14 @@ static const AVFilterPad inputs[] = {
     },
 };
 
+static const AVFilterPad outputs[] = {
+    {
+        .name         = "default",
+        .type         = AVMEDIA_TYPE_VIDEO,
+        .config_props = config_props,
+    },
+};
+
 const FFFilter ff_vf_sidedata = {
     .p.name        = "sidedata",
     .p.description = NULL_IF_CONFIG_SMALL("Manipulate video frame side data."),
@@ -178,6 +219,6 @@ const FFFilter ff_vf_sidedata = {
     .priv_size   = sizeof(SideDataContext),
     .init        = init,
     FILTER_INPUTS(inputs),
-    FILTER_OUTPUTS(ff_video_default_filterpad),
+    FILTER_OUTPUTS(outputs),
 };
 #endif /* CONFIG_SIDEDATA_FILTER */
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-01 14:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-01 14:11 [FFmpeg-devel] [PATCH] avfilter/f_select: also handle global side data in filter links (PR #21072) James Almer via ffmpeg-devel

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