Merge branch 'whip-sdp-munging' into 'main'

webrtc: whip_signaller: Add a mechanism for SDP munging

Closes #516

See merge request gstreamer/gst-plugins-rs!1525
This commit is contained in:
Arun Raghavan 2024-04-27 03:20:45 +00:00
commit 285d0ae659

View file

@ -187,7 +187,11 @@ impl WhipClient {
let client = build_reqwest_client(pol);
let sdp = offer.sdp();
let body = sdp.as_text().unwrap();
let body_orig = sdp.as_text().unwrap();
let body = self
.obj()
.emit_by_name::<String>("munge-sdp", &[&body_orig]);
gst::debug!(CAT, imp: self, "Using endpoint {}", endpoint.as_str());
let mut headermap = HeaderMap::new();
@ -611,6 +615,28 @@ impl ObjectImpl for WhipClient {
_ => unimplemented!(),
}
}
fn signals() -> &'static [glib::subclass::Signal] {
static SIGNALS: Lazy<Vec<glib::subclass::Signal>> = Lazy::new(|| {
vec![
/**
* WhipClient::munge-sdp:
* @sdp: the computed SDP body that
*
* This signal can be used to tweak the SDP before sending it out for servers that
* are finicky about the SDP they expect.
*
* Returns: the SDP that should be sent to the server.
*/
glib::subclass::Signal::builder("munge-sdp")
.param_types([String::static_type()])
.return_type::<String>()
.build(),
]
});
SIGNALS.as_ref()
}
}
// WHIP server implementation