webrtc: Update to livekit 0.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1293>
This commit is contained in:
Sebastian Dröge 2023-08-07 11:30:25 +03:00
parent aacfe546d5
commit 2ce04c6a78
2 changed files with 5 additions and 18 deletions

View file

@ -51,8 +51,8 @@ reqwest = { version = "0.11", features = ["default-tls"] }
parse_link_header = {version = "0.3", features = ["url"]}
async-recursion = "1.0.0"
livekit-protocol = { version = "0.1.3" }
livekit-api = { version = "0.1.3", default-features = false, features = ["signal-client", "access-token", "native-tls"] }
livekit-protocol = { version = "0.2" }
livekit-api = { version = "0.2", default-features = false, features = ["signal-client", "access-token", "native-tls"] }
[dev-dependencies]
tracing = { version = "0.1", features = ["log"] }

View file

@ -97,9 +97,8 @@ impl Signaller {
loop {
match wait_async(&self.signal_task_canceller, signal_events.recv(), 0).await {
Ok(Some(signal)) => match signal {
signal_client::SignalEvent::Open => {}
signal_client::SignalEvent::Signal(signal) => {
self.on_signal_event(signal).await;
signal_client::SignalEvent::Message(signal) => {
self.on_signal_event(*signal).await;
}
signal_client::SignalEvent::Close => {
gst::debug!(CAT, imp: self, "Close");
@ -138,21 +137,9 @@ impl Signaller {
.emit_by_name::<()>("session-description", &[&"unique", &answer]);
}
proto::signal_response::Message::Trickle(trickle) => {
let target = if let Some(target) = proto::SignalTarget::from_i32(trickle.target) {
target
} else {
gst::warning!(
CAT,
imp: self,
"Received ice_candidate {:?} from invalid target, ignoring",
trickle
);
return;
};
gst::debug!(CAT, imp: self, "Received ice_candidate {:?}", trickle);
if target == proto::SignalTarget::Publisher {
if trickle.target() == proto::SignalTarget::Publisher {
if let Ok(json) =
serde_json::from_str::<IceCandidateJson>(&trickle.candidate_init)
{