rtpgstdepay: Update pad caps if inline caps change

If the inlined caps change while using the same CV we need to update the
source pad caps.
This commit is contained in:
Jochen Henneberg 2018-12-04 18:50:51 +01:00 committed by Sebastian Dröge
parent 34233baae1
commit 9b6dcc7f1b

View file

@ -116,12 +116,19 @@ gst_rtp_gst_depay_finalize (GObject * object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
static gboolean
store_cache (GstRtpGSTDepay * rtpgstdepay, guint CV, GstCaps * caps)
{
gboolean changed = FALSE;
if (caps && rtpgstdepay->CV_cache[CV])
changed = !gst_caps_is_strictly_equal (caps, rtpgstdepay->CV_cache[CV]);
if (rtpgstdepay->CV_cache[CV])
gst_caps_unref (rtpgstdepay->CV_cache[CV]);
rtpgstdepay->CV_cache[CV] = caps;
return changed;
}
static void
@ -464,7 +471,8 @@ gst_rtp_gst_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
GST_DEBUG_OBJECT (rtpgstdepay,
"inline caps %u, length %u, %" GST_PTR_FORMAT, CV, size, outcaps);
store_cache (rtpgstdepay, CV, outcaps);
if (store_cache (rtpgstdepay, CV, outcaps))
gst_pad_set_caps (depayload->srcpad, outcaps);
/* skip caps */
offset += size;