net/webrtc: deprecate consumer-added on the signaller

add a new signal webrtcbin-ready in this place doing same
thing but can be used for both consumers and producers

Please note this change is only to the consumer-added
signal on the signaller interface.
The consumer-added signal on the webrtcsink is unchanged

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1284>
This commit is contained in:
Taruntej Kanakamalla 2023-08-14 12:11:57 +05:30 committed by GStreamer Marge Bot
parent 2d3d03b4d3
commit ed3aa740be
6 changed files with 33 additions and 3 deletions

View file

@ -7131,6 +7131,20 @@
"args": [],
"return-type": "gboolean",
"when": "last"
},
"webrtcbin-ready": {
"args": [
{
"name": "arg0",
"type": "gchararray"
},
{
"name": "arg1",
"type": "GstElement"
}
],
"return-type": "void",
"when": "last"
}
}
},

View file

@ -345,7 +345,7 @@ impl Signaller {
gst::info!(CAT, "Ice servers: {:?}", ice_servers);
self.obj().connect_closure(
"consumer-added",
"webrtcbin-ready",
false,
glib::closure!(|_signaller: &super::AwsKvsSignaller,
_consumer_identifier: &str,

View file

@ -269,7 +269,7 @@ impl SignallableImpl for Signaller {
let weak_imp = imp.downgrade();
imp.obj().connect_closure(
"consumer-added",
"webrtcbin-ready",
false,
glib::closure!(|_signaler: &super::LiveKitSignaller,
_consumer_identifier: &str,

View file

@ -284,9 +284,12 @@ unsafe impl prelude::ObjectInterface for Signallable {
*
* This signal can be used to tweak @webrtcbin, creating a data
* channel for example.
*
* Deprecated: 1.24: Use `webrtcbin-ready` instead
*/
Signal::builder("consumer-added")
.param_types([String::static_type(), gst::Element::static_type()])
.deprecated()
.build(),
/**
* GstRSWebRTCSignallableIface::consumer-removed:
@ -386,6 +389,18 @@ unsafe impl prelude::ObjectInterface for Signallable {
false
})
.build(),
/**
* GstRSWebRTCSignallableIface::webrtcbin-ready:
* @self: The object implementing #GstRSWebRTCSignallableIface
* @peer_id: Id of the consumer/producer
* @webrtcbin: The internal WebRTCBin element
*
* This signal can be used to tweak @webrtcbin, creating a data
* channel for example.
*/
Signal::builder("webrtcbin-ready")
.param_types([String::static_type(), gst::Element::static_type()])
.build(),
]
});
SIGNALS.as_ref()

View file

@ -2613,6 +2613,7 @@ impl BaseWebRTCSink {
// moment.
element.emit_by_name::<()>("consumer-added", &[&peer_id, &webrtcbin]);
signaller.emit_by_name::<()>("consumer-added", &[&peer_id, &webrtcbin]);
signaller.emit_by_name::<()>("webrtcbin-ready", &[&peer_id, &webrtcbin]);
// We don't connect to on-negotiation-needed, this in order to call the above
// signal without holding the state lock:

View file

@ -426,7 +426,7 @@ impl SignallableImpl for WhipClient {
}
self.obj().connect_closure(
"consumer-added",
"webrtcbin-ready",
false,
glib::closure!(|signaller: &super::WhipClientSignaller,
_consumer_identifier: &str,