From f7ab9f91e70740084368ae5ec371eac0db194e93 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 23 Oct 2024 14:25:52 +0200 Subject: [PATCH] parsebin: Store caps on parsepad as early as possible When analyzing a new pad, we can store the updated caps on the GstStream if they are fixed. If they are not fixed, this function will be called again once the element will provide them. Part-of: --- subprojects/gst-plugins-base/gst/playback/gstparsebin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subprojects/gst-plugins-base/gst/playback/gstparsebin.c b/subprojects/gst-plugins-base/gst/playback/gstparsebin.c index 5097cac478..8f7f6d23a4 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstparsebin.c +++ b/subprojects/gst-plugins-base/gst/playback/gstparsebin.c @@ -1339,6 +1339,11 @@ analyze_new_pad (GstParseBin * parsebin, GstElement * src, GstPad * pad, gst_pad_set_active (GST_PAD_CAST (parsepad), TRUE); parse_pad_set_target (parsepad, pad); + /* If we know the caps, store them in the parsepad GstStream */ + if (gst_caps_is_fixed (caps)) { + gst_parse_pad_update_caps (parsepad, caps); + } + /* 1. Emit 'autoplug-continue' the result will tell us if this pads needs * further autoplugging. Only do this for fixed caps, for unfixed caps * we will later come here again from the notify::caps handler. The