webrtc: livekit: Set connection earlier during setup

Otherwise it's not available yet when handling the initial participants
that are already in the session when joining.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1794>
This commit is contained in:
Sebastian Dröge 2024-09-23 19:04:53 +03:00
parent cd2b641321
commit dcb072ee23

View file

@ -672,6 +672,16 @@ impl SignallableImpl for Signaller {
}
});
let connection = Connection {
signal_client,
signal_task,
pending_tracks: Default::default(),
early_candidates: Some(Vec::new()),
channels: None,
participants: HashMap::default(),
};
*imp.connection.lock().unwrap() = Some(connection);
if imp.is_subscriber() {
imp.obj()
.emit_by_name::<()>("session-started", &[&"unique", &"unique"]);
@ -724,19 +734,6 @@ impl SignallableImpl for Signaller {
),
);
let connection = Connection {
signal_client,
signal_task,
pending_tracks: Default::default(),
early_candidates: Some(Vec::new()),
channels: None,
participants: HashMap::default(),
};
if let Ok(mut sc) = imp.connection.lock() {
*sc = Some(connection);
}
imp.obj().emit_by_name::<()>(
"session-requested",
&[