From 594400a7f5da5df9e885e6be79184fc0ae9b8b1e Mon Sep 17 00:00:00 2001 From: Jordan Yelloz Date: Mon, 26 Feb 2024 11:34:39 -0700 Subject: [PATCH] webrtcsrc: Made producer-peer-id optional It may be necessary for some signalling clients but the source element doesn't need to depend on it. Also, the value will fall back to the pad's MSID for the first argument to the request-encoded-filter gobject signal when it isn't available from the signalling client. Part-of: --- net/webrtc/src/webrtcsrc/imp.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/webrtc/src/webrtcsrc/imp.rs b/net/webrtc/src/webrtcsrc/imp.rs index e8817f33..b978a0b4 100644 --- a/net/webrtc/src/webrtcsrc/imp.rs +++ b/net/webrtc/src/webrtcsrc/imp.rs @@ -211,7 +211,7 @@ impl ObjectImpl for BaseWebRTCSrc { vec![ /** * BaseWebRTCSrc::request-encoded-filter: - * @producer_id: Identifier of the producer + * @producer_id: (nullable): Identifier of the producer * @pad_name: The name of the output pad * @allowed_caps: the allowed caps for the output pad * @@ -404,7 +404,11 @@ impl BaseWebRTCSrc { .expect("Adding ghostpad to the bin should always work"); if let Some(srcpad) = srcpad { - let producer_id = self.signaller().property::("producer-peer-id"); + let producer_id = self + .signaller() + .property::>("producer-peer-id") + .or_else(|| pad.property("msid")); + let encoded_filter = self.obj().emit_by_name::>( "request-encoded-filter", &[&producer_id, &srcpad.name(), &srcpad.allowed_caps()],