From dcad6ffe3488618fa04e80579a340ce8089e9981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 13 May 2022 13:20:07 +0300 Subject: [PATCH] rtponvifdepay: Set caps on the source pad The RTP depayloader base class does not take care of this in any way and it has to be done manually. --- net/onvif/src/onvifdepay/imp.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/onvif/src/onvifdepay/imp.rs b/net/onvif/src/onvifdepay/imp.rs index 6f36d3b0..c86115b2 100644 --- a/net/onvif/src/onvifdepay/imp.rs +++ b/net/onvif/src/onvifdepay/imp.rs @@ -1,5 +1,6 @@ use gst::glib; use gst::subclass::prelude::*; +use gst_rtp::prelude::*; use gst_rtp::subclass::prelude::*; use once_cell::sync::Lazy; use std::sync::Mutex; @@ -83,6 +84,14 @@ impl ElementImpl for OnvifDepay { } impl RTPBaseDepayloadImpl for OnvifDepay { + fn set_caps(&self, element: &Self::Type, _caps: &gst::Caps) -> Result<(), gst::LoggableError> { + let src_pad = element.src_pad(); + let src_caps = src_pad.pad_template_caps(); + src_pad.push_event(gst::event::Caps::builder(&src_caps).build()); + + Ok(()) + } + fn process_rtp_packet( &self, element: &Self::Type,