From 4280262750391c42ac16fdd4902f504dd91ff3cb Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Fri, 3 Jan 2020 19:07:51 +0300 Subject: [PATCH 01/15] Add connection through relay --- _dev/specs/relay-pub-pub-video-call.yml | 35 +++++++++++++++++++ jason/Cargo.toml | 1 + jason/src/api/room.rs | 5 ++- jason/src/peer/conn.rs | 20 +++++++---- jason/src/peer/mod.rs | 6 ++-- jason/src/peer/repo.rs | 7 ++-- proto/client-api/src/lib.rs | 7 ++++ .../endpoints/webrtc_publish_endpoint.rs | 10 ++++++ src/media/peer.rs | 12 +++++-- src/signalling/peers.rs | 9 +++-- src/signalling/room.rs | 2 ++ 11 files changed, 99 insertions(+), 15 deletions(-) create mode 100644 _dev/specs/relay-pub-pub-video-call.yml diff --git a/_dev/specs/relay-pub-pub-video-call.yml b/_dev/specs/relay-pub-pub-video-call.yml new file mode 100644 index 000000000..8c466c2d4 --- /dev/null +++ b/_dev/specs/relay-pub-pub-video-call.yml @@ -0,0 +1,35 @@ +kind: Room +id: relay-pub-pub-video-call +spec: + pipeline: + caller: + kind: Member + credentials: test + on_join: "grpc://127.0.0.1:9099" + on_leave: "grpc://127.0.0.1:9099" + spec: + pipeline: + publish: + kind: WebRtcPublishEndpoint + spec: + p2p: Never + play-responder: + kind: WebRtcPlayEndpoint + spec: + src: "local://relay-pub-pub-video-call/responder/publish" + responder: + kind: Member + credentials: test + on_join: "grpc://127.0.0.1:9099" + on_leave: "grpc://127.0.0.1:9099" + spec: + pipeline: + publish: + kind: WebRtcPublishEndpoint + spec: + p2p: Never + play-caller: + kind: WebRtcPlayEndpoint + spec: + src: "local://relay-pub-pub-video-call/caller/publish" + diff --git a/jason/Cargo.toml b/jason/Cargo.toml index 726e09ef3..f29dfa632 100644 --- a/jason/Cargo.toml +++ b/jason/Cargo.toml @@ -56,6 +56,7 @@ wee_alloc = { version = "0.4", optional = true } "RtcIceCandidate", "RtcIceCandidateInit", "RtcIceConnectionState", "RtcIceServer", + "RtcIceTransportPolicy", "RtcPeerConnection", "RtcPeerConnectionIceEvent", "RtcRtpReceiver", "RtcRtpSender", "RtcRtpTransceiver", "RtcRtpTransceiverDirection", diff --git a/jason/src/api/room.rs b/jason/src/api/room.rs index 52f40d587..244823276 100644 --- a/jason/src/api/room.rs +++ b/jason/src/api/room.rs @@ -12,7 +12,8 @@ use futures::{channel::mpsc, stream, Future, FutureExt as _, StreamExt as _}; use js_sys::Promise; use medea_client_api_proto::{ Command, Direction, Event as RpcEvent, EventHandler, IceCandidate, - IceConnectionState, IceServer, PeerId, PeerMetrics, Track, + IceConnectionState, IceServer, IceTransportPolicy, PeerId, PeerMetrics, + Track, }; use tracerr::Traced; use wasm_bindgen::{prelude::*, JsValue}; @@ -540,6 +541,7 @@ impl EventHandler for InnerRoom { sdp_offer: Option, tracks: Vec, ice_servers: Vec, + ice_transport_policy: IceTransportPolicy, ) { let peer = match self .peers @@ -549,6 +551,7 @@ impl EventHandler for InnerRoom { self.peer_event_sender.clone(), self.enabled_audio, self.enabled_video, + ice_transport_policy, ) .map_err(tracerr::map_from_and_wrap!(=> RoomError)) { diff --git a/jason/src/peer/conn.rs b/jason/src/peer/conn.rs index 803b3080a..736bbee16 100644 --- a/jason/src/peer/conn.rs +++ b/jason/src/peer/conn.rs @@ -1,15 +1,15 @@ use std::{cell::RefCell, rc::Rc}; use derive_more::Display; -use medea_client_api_proto::IceServer; +use medea_client_api_proto::{IceServer, IceTransportPolicy}; use tracerr::Traced; use wasm_bindgen_futures::JsFuture; use web_sys::{ Event, RtcConfiguration, RtcIceCandidateInit, RtcIceConnectionState, - RtcPeerConnection as SysRtcPeerConnection, RtcPeerConnectionIceEvent, - RtcRtpTransceiver, RtcRtpTransceiverDirection, RtcRtpTransceiverInit, - RtcSdpType, RtcSessionDescription, RtcSessionDescriptionInit, - RtcTrackEvent, + RtcIceTransportPolicy, RtcPeerConnection as SysRtcPeerConnection, + RtcPeerConnectionIceEvent, RtcRtpTransceiver, RtcRtpTransceiverDirection, + RtcRtpTransceiverInit, RtcSdpType, RtcSessionDescription, + RtcSessionDescriptionInit, RtcTrackEvent, }; use crate::{ @@ -211,12 +211,20 @@ pub struct RtcPeerConnection { impl RtcPeerConnection { /// Instantiates new [`RtcPeerConnection`]. - pub fn new(ice_servers: I) -> Result + pub fn new( + ice_servers: I, + ice_transport_policy: IceTransportPolicy, + ) -> Result where I: IntoIterator, { // TODO: RTCBundlePolicy = "max-bundle"? let mut peer_conf = RtcConfiguration::new(); + let ice_transport_policy = match ice_transport_policy { + IceTransportPolicy::All => RtcIceTransportPolicy::All, + IceTransportPolicy::Relay => RtcIceTransportPolicy::Relay, + }; + peer_conf.ice_transport_policy(ice_transport_policy); peer_conf.ice_servers(&RtcIceServers::from(ice_servers)); let peer = SysRtcPeerConnection::new_with_configuration(&peer_conf) .map_err(Into::into) diff --git a/jason/src/peer/mod.rs b/jason/src/peer/mod.rs index 7cf260c3a..abc1432bf 100644 --- a/jason/src/peer/mod.rs +++ b/jason/src/peer/mod.rs @@ -15,7 +15,8 @@ use std::{cell::RefCell, collections::HashMap, convert::TryFrom, rc::Rc}; use derive_more::{Display, From}; use futures::{channel::mpsc, future}; use medea_client_api_proto::{ - Direction, IceConnectionState, IceServer, PeerId as Id, Track, TrackId, + Direction, IceConnectionState, IceServer, IceTransportPolicy, PeerId as Id, + Track, TrackId, }; use medea_macro::dispatchable; use tracerr::Traced; @@ -180,9 +181,10 @@ impl PeerConnection { media_manager: Rc, enabled_audio: bool, enabled_video: bool, + ice_transport_policy: IceTransportPolicy, ) -> Result { let peer = Rc::new( - RtcPeerConnection::new(ice_servers) + RtcPeerConnection::new(ice_servers, ice_transport_policy) .map_err(tracerr::map_from_and_wrap!())?, ); let media_connections = Rc::new(MediaConnections::new( diff --git a/jason/src/peer/repo.rs b/jason/src/peer/repo.rs index d7d1f1d15..7daac6fd5 100644 --- a/jason/src/peer/repo.rs +++ b/jason/src/peer/repo.rs @@ -1,7 +1,7 @@ use std::{collections::HashMap, rc::Rc}; use futures::channel::mpsc; -use medea_client_api_proto::{IceServer, PeerId}; +use medea_client_api_proto::{IceServer, IceTransportPolicy, PeerId}; use tracerr::Traced; use crate::media::MediaManager; @@ -19,9 +19,10 @@ pub trait PeerRepository { &mut self, id: PeerId, ice_servers: Vec, - events_sender: mpsc::UnboundedSender, + peer_events_sender: mpsc::UnboundedSender, enabled_audio: bool, enabled_video: bool, + ice_transport_policy: IceTransportPolicy, ) -> Result, Traced>; /// Returns [`PeerConnection`] stored in repository by its ID. @@ -64,6 +65,7 @@ impl PeerRepository for Repository { peer_events_sender: mpsc::UnboundedSender, enabled_audio: bool, enabled_video: bool, + ice_transport_policy: IceTransportPolicy, ) -> Result, Traced> { let peer = Rc::new( PeerConnection::new( @@ -73,6 +75,7 @@ impl PeerRepository for Repository { Rc::clone(&self.media_manager), enabled_audio, enabled_video, + ice_transport_policy, ) .map_err(tracerr::map_from_and_wrap!())?, ); diff --git a/proto/client-api/src/lib.rs b/proto/client-api/src/lib.rs index 959be5601..38a7ce589 100644 --- a/proto/client-api/src/lib.rs +++ b/proto/client-api/src/lib.rs @@ -173,6 +173,12 @@ pub struct CloseDescription { pub reason: CloseReason, } +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Copy)] +pub enum IceTransportPolicy { + All, + Relay, +} + /// WebSocket message from Medea to Jason. #[dispatchable] #[cfg_attr(feature = "medea", derive(Serialize, Debug, Clone, PartialEq))] @@ -186,6 +192,7 @@ pub enum Event { sdp_offer: Option, tracks: Vec, ice_servers: Vec, + ice_transport_policy: IceTransportPolicy, }, /// Media Server notifies Web Client about necessity to apply specified SDP /// Answer to Web Client's RTCPeerConnection. diff --git a/src/api/control/endpoints/webrtc_publish_endpoint.rs b/src/api/control/endpoints/webrtc_publish_endpoint.rs index ab575a660..c46c672ad 100644 --- a/src/api/control/endpoints/webrtc_publish_endpoint.rs +++ b/src/api/control/endpoints/webrtc_publish_endpoint.rs @@ -5,6 +5,7 @@ use derive_more::{Display, From, Into}; use serde::Deserialize; +use medea_client_api_proto::IceTransportPolicy; use medea_control_api_proto::grpc::api::{ WebRtcPublishEndpoint as WebRtcPublishEndpointProto, WebRtcPublishEndpoint_P2P as WebRtcPublishEndpointP2pProto, @@ -49,6 +50,15 @@ impl Into for P2pMode { } } +impl Into for P2pMode { + fn into(self) -> IceTransportPolicy { + match self { + Self::Always | Self::IfPossible => IceTransportPolicy::All, + Self::Never => IceTransportPolicy::Relay, + } + } +} + /// Media element which is able to publish media data for another client via /// WebRTC. #[derive(Clone, Deserialize, Debug)] diff --git a/src/media/peer.rs b/src/media/peer.rs index fbc831c4c..cedfbab15 100644 --- a/src/media/peer.rs +++ b/src/media/peer.rs @@ -9,8 +9,8 @@ use std::{collections::HashMap, convert::TryFrom, fmt, rc::Rc}; use derive_more::Display; use failure::Fail; use medea_client_api_proto::{ - AudioSettings, Direction, MediaType, PeerId as Id, Track, TrackId, - VideoSettings, + AudioSettings, Direction, IceTransportPolicy, MediaType, PeerId as Id, + Track, TrackId, VideoSettings, }; use medea_macro::enum_delegate; @@ -70,6 +70,7 @@ impl PeerError { #[enum_delegate(pub fn member_id(&self) -> MemberId)] #[enum_delegate(pub fn partner_peer_id(&self) -> Id)] #[enum_delegate(pub fn partner_member_id(&self) -> MemberId)] +#[enum_delegate(pub fn ice_transport_policy(&self) -> IceTransportPolicy)] #[derive(Debug)] pub enum PeerStateMachine { New(Peer), @@ -151,6 +152,7 @@ pub struct Context { sdp_answer: Option, receivers: HashMap>, senders: HashMap>, + ice_transport_policy: IceTransportPolicy, } /// [RTCPeerConnection] representation. @@ -223,6 +225,10 @@ impl Peer { pub fn is_sender(&self) -> bool { !self.context.senders.is_empty() } + + pub fn ice_transport_policy(&self) -> IceTransportPolicy { + self.context.ice_transport_policy + } } impl Peer { @@ -234,6 +240,7 @@ impl Peer { member_id: MemberId, partner_peer: Id, partner_member: MemberId, + ice_transport_policy: IceTransportPolicy, ) -> Self { let context = Context { id, @@ -244,6 +251,7 @@ impl Peer { sdp_answer: None, receivers: HashMap::new(), senders: HashMap::new(), + ice_transport_policy, }; Self { context, diff --git a/src/signalling/peers.rs b/src/signalling/peers.rs index 1752ef574..3d34f56b5 100644 --- a/src/signalling/peers.rs +++ b/src/signalling/peers.rs @@ -9,7 +9,9 @@ use std::{ }; use derive_more::Display; -use medea_client_api_proto::{Incrementable, PeerId, TrackId}; +use medea_client_api_proto::{ + IceTransportPolicy, Incrementable, PeerId, TrackId, +}; use crate::{ api::control::MemberId, @@ -83,6 +85,7 @@ impl PeerRepository { &mut self, first_member: &Member, second_member: &Member, + ice_transport_policy: IceTransportPolicy, ) -> (Peer, Peer) { let first_member_id = first_member.id(); let second_member_id = second_member.id(); @@ -99,12 +102,14 @@ impl PeerRepository { first_member_id.clone(), second_peer_id, second_member_id.clone(), + ice_transport_policy, ); let second_peer = Peer::new( second_peer_id, second_member_id, first_peer_id, first_member_id, + ice_transport_policy, ); (first_peer, second_peer) @@ -311,7 +316,7 @@ impl PeerRepository { self.add_peer(sink_peer); } else { let (mut src_peer, mut sink_peer) = - self.create_peers(&src_owner, &sink_owner); + self.create_peers(&src_owner, &sink_owner, src.p2p().into()); src_peer.add_publisher(&mut sink_peer, self.get_tracks_counter()); diff --git a/src/signalling/room.rs b/src/signalling/room.rs index 7b3370b88..0c0842d8f 100644 --- a/src/signalling/room.rs +++ b/src/signalling/room.rs @@ -248,6 +248,7 @@ impl Room { sdp_offer: None, tracks: sender.tracks(), ice_servers, + ice_transport_policy: sender.ice_transport_policy(), }; self.peers.add_peer(sender); Ok(Box::new(wrap_future( @@ -816,6 +817,7 @@ impl CommandHandler for Room { sdp_offer: Some(sdp_offer), tracks: to_peer.tracks(), ice_servers, + ice_transport_policy: to_peer.ice_transport_policy(), }; self.peers.add_peer(from_peer); From 4d4bbcb8d43daae236299e244da39a32a0d3a74b Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Fri, 3 Jan 2020 19:22:25 +0300 Subject: [PATCH 02/15] Fix tests --- jason/tests/api/room.rs | 13 ++- jason/tests/peer/media.rs | 14 ++- jason/tests/peer/mod.rs | 116 ++++++++++++++++++---- proto/client-api/src/lib.rs | 2 +- tests/e2e/signalling/pub_sub_signallng.rs | 7 +- tests/specs/pub-sub-video-call.yml | 2 +- 6 files changed, 123 insertions(+), 31 deletions(-) diff --git a/jason/tests/api/room.rs b/jason/tests/api/room.rs index 1354fe179..21282f26a 100644 --- a/jason/tests/api/room.rs +++ b/jason/tests/api/room.rs @@ -3,7 +3,7 @@ use std::rc::Rc; use futures::channel::mpsc; -use medea_client_api_proto::{Event, IceServer, PeerId}; +use medea_client_api_proto::{Event, IceServer, IceTransportPolicy, PeerId}; use medea_jason::{ api::Room, media::{AudioTrackConstraints, MediaManager, MediaStreamConstraints}, @@ -33,6 +33,7 @@ fn get_test_room_and_exist_peer( Rc::new(MediaManager::default()), true, true, + IceTransportPolicy::All, ) .unwrap(), ); @@ -102,6 +103,7 @@ fn get_test_room_and_new_peer( Rc::new(MediaManager::default()), with_enabled_audio, with_enabled_video, + IceTransportPolicy::All, ) .unwrap(), ); @@ -112,13 +114,14 @@ fn get_test_room_and_new_peer( _ice_servers: &Vec, _peer_events_sender: &mpsc::UnboundedSender, enabled_audio: &bool, - enabled_video: &bool| { + enabled_video: &bool, + _ice_transport_policy: &IceTransportPolicy| { *id == PeerId(1) && *enabled_audio == with_enabled_audio && *enabled_video == with_enabled_video }, ) - .return_once_st(move |_, _, _, _, _| Ok(peer_clone)); + .return_once_st(move |_, _, _, _, _, _| Ok(peer_clone)); rpc.expect_send_command().return_const(()); rpc.expect_unsub().return_const(()); rpc.expect_set_close_reason().return_const(()); @@ -140,6 +143,7 @@ async fn mute_audio_room_before_init_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], + ice_transport_policy: IceTransportPolicy::All, }) .unwrap(); @@ -162,6 +166,7 @@ async fn mute_video_room_before_init_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], + ice_transport_policy: IceTransportPolicy::All, }) .unwrap(); @@ -213,6 +218,7 @@ async fn error_inject_invalid_local_stream_into_new_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], + ice_transport_policy: IceTransportPolicy::All, }) .unwrap(); @@ -285,6 +291,7 @@ async fn error_get_local_stream_on_new_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], + ice_transport_policy: IceTransportPolicy::All, }) .unwrap(); diff --git a/jason/tests/peer/media.rs b/jason/tests/peer/media.rs index 2f064d25f..792ec87e8 100644 --- a/jason/tests/peer/media.rs +++ b/jason/tests/peer/media.rs @@ -2,7 +2,7 @@ use std::{convert::TryFrom, rc::Rc}; -use medea_client_api_proto::TrackId; +use medea_client_api_proto::{IceTransportPolicy, TrackId}; use medea_jason::{ media::MediaManager, peer::{ @@ -21,7 +21,9 @@ async fn get_test_media_connections( enabled_video: bool, ) -> (MediaConnections, TrackId, TrackId) { let media_connections = MediaConnections::new( - Rc::new(RtcPeerConnection::new(vec![]).unwrap()), + Rc::new( + RtcPeerConnection::new(vec![], IceTransportPolicy::All).unwrap(), + ), enabled_audio, enabled_video, ); @@ -47,7 +49,9 @@ async fn get_test_media_connections( #[wasm_bindgen_test] fn get_stream_request() { let media_connections = MediaConnections::new( - Rc::new(RtcPeerConnection::new(vec![]).unwrap()), + Rc::new( + RtcPeerConnection::new(vec![], IceTransportPolicy::All).unwrap(), + ), true, true, ); @@ -59,7 +63,9 @@ fn get_stream_request() { assert!(request.is_some()); let media_connections = MediaConnections::new( - Rc::new(RtcPeerConnection::new(vec![]).unwrap()), + Rc::new( + RtcPeerConnection::new(vec![], IceTransportPolicy::All).unwrap(), + ), true, true, ); diff --git a/jason/tests/peer/mod.rs b/jason/tests/peer/mod.rs index 8c28163df..2aee55797 100644 --- a/jason/tests/peer/mod.rs +++ b/jason/tests/peer/mod.rs @@ -5,7 +5,7 @@ mod media; use std::rc::Rc; use futures::{channel::mpsc, StreamExt as _}; -use medea_client_api_proto::{IceConnectionState, PeerId}; +use medea_client_api_proto::{IceConnectionState, IceTransportPolicy, PeerId}; use medea_jason::{ media::MediaManager, peer::{PeerConnection, PeerEvent}, @@ -21,8 +21,16 @@ async fn mute_unmute_audio() { let (tx, _rx) = mpsc::unbounded(); let manager = Rc::new(MediaManager::default()); let (audio_track, video_track) = get_test_tracks(); - let peer = PeerConnection::new(PeerId(1), tx, vec![], manager, true, true) - .unwrap(); + let peer = PeerConnection::new( + PeerId(1), + tx, + vec![], + manager, + true, + true, + IceTransportPolicy::All, + ) + .unwrap(); peer.get_offer(vec![audio_track, video_track], None) .await @@ -45,8 +53,16 @@ async fn mute_unmute_video() { let (tx, _rx) = mpsc::unbounded(); let manager = Rc::new(MediaManager::default()); let (audio_track, video_track) = get_test_tracks(); - let peer = PeerConnection::new(PeerId(1), tx, vec![], manager, true, true) - .unwrap(); + let peer = PeerConnection::new( + PeerId(1), + tx, + vec![], + manager, + true, + true, + IceTransportPolicy::All, + ) + .unwrap(); peer.get_offer(vec![audio_track, video_track], None) .await .unwrap(); @@ -68,8 +84,16 @@ async fn new_with_mute_audio() { let (tx, _rx) = mpsc::unbounded(); let manager = Rc::new(MediaManager::default()); let (audio_track, video_track) = get_test_tracks(); - let peer = PeerConnection::new(PeerId(1), tx, vec![], manager, false, true) - .unwrap(); + let peer = PeerConnection::new( + PeerId(1), + tx, + vec![], + manager, + false, + true, + IceTransportPolicy::All, + ) + .unwrap(); peer.get_offer(vec![audio_track, video_track], None) .await @@ -84,8 +108,16 @@ async fn new_with_mute_video() { let (tx, _rx) = mpsc::unbounded(); let manager = Rc::new(MediaManager::default()); let (audio_track, video_track) = get_test_tracks(); - let peer = PeerConnection::new(PeerId(1), tx, vec![], manager, true, false) - .unwrap(); + let peer = PeerConnection::new( + PeerId(1), + tx, + vec![], + manager, + true, + false, + IceTransportPolicy::All, + ) + .unwrap(); peer.get_offer(vec![audio_track, video_track], None) .await .unwrap(); @@ -107,11 +139,20 @@ async fn add_candidates_to_answerer_before_offer() { Rc::clone(&manager), true, true, + IceTransportPolicy::All, ) .unwrap(); - let pc2 = PeerConnection::new(PeerId(2), tx2, vec![], manager, true, true) - .unwrap(); + let pc2 = PeerConnection::new( + PeerId(2), + tx2, + vec![], + manager, + true, + true, + IceTransportPolicy::All, + ) + .unwrap(); let (audio_track, video_track) = get_test_tracks(); let offer = pc1 .get_offer(vec![audio_track, video_track], None) @@ -142,12 +183,21 @@ async fn add_candidates_to_offerer_before_answer() { Rc::clone(&manager), true, true, + IceTransportPolicy::All, ) .unwrap(), ); let pc2 = Rc::new( - PeerConnection::new(PeerId(2), tx2, vec![], manager, true, true) - .unwrap(), + PeerConnection::new( + PeerId(2), + tx2, + vec![], + manager, + true, + true, + IceTransportPolicy::All, + ) + .unwrap(), ); let (audio_track, video_track) = get_test_tracks(); @@ -179,11 +229,19 @@ async fn normal_exchange_of_candidates() { Rc::clone(&manager), true, true, + IceTransportPolicy::All, + ) + .unwrap(); + let peer2 = PeerConnection::new( + PeerId(2), + tx2, + vec![], + manager, + true, + true, + IceTransportPolicy::All, ) .unwrap(); - let peer2 = - PeerConnection::new(PeerId(2), tx2, vec![], manager, true, true) - .unwrap(); let (audio_track, video_track) = get_test_tracks(); let offer = peer1 @@ -238,8 +296,16 @@ async fn send_event_on_new_local_stream() { let manager = Rc::new(MediaManager::default()); let (audio_track, video_track) = get_test_tracks(); let id = PeerId(1); - let peer = - PeerConnection::new(id, tx, vec![], manager, true, false).unwrap(); + let peer = PeerConnection::new( + id, + tx, + vec![], + manager, + true, + false, + IceTransportPolicy::All, + ) + .unwrap(); peer.get_offer(vec![audio_track, video_track], None) .await .unwrap(); @@ -271,11 +337,19 @@ async fn ice_connection_state_changed_is_emitted() { Rc::clone(&manager), true, true, + IceTransportPolicy::All, + ) + .unwrap(); + let peer2 = PeerConnection::new( + PeerId(2), + tx2, + vec![], + manager, + true, + true, + IceTransportPolicy::All, ) .unwrap(); - let peer2 = - PeerConnection::new(PeerId(2), tx2, vec![], manager, true, true) - .unwrap(); let (audio_track, video_track) = get_test_tracks(); let offer = peer1 diff --git a/proto/client-api/src/lib.rs b/proto/client-api/src/lib.rs index 38a7ce589..3b5959e2d 100644 --- a/proto/client-api/src/lib.rs +++ b/proto/client-api/src/lib.rs @@ -173,7 +173,7 @@ pub struct CloseDescription { pub reason: CloseReason, } -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Copy)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Copy, Eq)] pub enum IceTransportPolicy { All, Relay, diff --git a/tests/e2e/signalling/pub_sub_signallng.rs b/tests/e2e/signalling/pub_sub_signallng.rs index a8119a136..21787c71e 100644 --- a/tests/e2e/signalling/pub_sub_signallng.rs +++ b/tests/e2e/signalling/pub_sub_signallng.rs @@ -1,5 +1,5 @@ use actix::{Context, System}; -use medea_client_api_proto::{Direction, Event}; +use medea_client_api_proto::{Direction, Event, IceTransportPolicy}; use crate::signalling::TestMember; @@ -30,6 +30,7 @@ fn pub_sub_video_call() { sdp_offer, tracks, ice_servers, + ice_transport_policy, } = &events[0] { assert_eq!(ice_servers.len(), 2); @@ -45,6 +46,10 @@ fn pub_sub_video_call() { ice_servers[1].urls[1], "turn:localhost:3478?transport=tcp".to_string() ); + assert_eq!( + ice_transport_policy, + &IceTransportPolicy::Relay + ); if sdp_offer.is_some() { is_caller = false; diff --git a/tests/specs/pub-sub-video-call.yml b/tests/specs/pub-sub-video-call.yml index 171f34559..e2a5ddcc9 100644 --- a/tests/specs/pub-sub-video-call.yml +++ b/tests/specs/pub-sub-video-call.yml @@ -10,7 +10,7 @@ spec: publish: kind: WebRtcPublishEndpoint spec: - p2p: Always + p2p: Never responder: kind: Member credentials: test From fe346549b01784e4100ca5866db791a1d38e7fe3 Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Mon, 6 Jan 2020 14:03:59 +0300 Subject: [PATCH 03/15] Use is_relay field in Control API --- _dev/specs/relay-pub-pub-video-call.yml | 6 +- jason/e2e-demo/js/index.js | 9 ++- jason/e2e-demo/video-call.html | 7 +++ jason/src/api/room.rs | 7 +-- jason/src/peer/conn.rs | 14 ++--- jason/src/peer/mod.rs | 7 +-- jason/src/peer/repo.rs | 8 +-- mock/control-api/src/api/endpoint.rs | 4 ++ proto/client-api/src/lib.rs | 8 +-- proto/control-api/src/grpc/api.proto | 1 + proto/control-api/src/grpc/api.rs | 55 +++++++++++++++---- .../endpoints/webrtc_publish_endpoint.rs | 16 ++---- src/media/peer.rs | 16 +++--- .../endpoints/webrtc/publish_endpoint.rs | 17 +++++- src/signalling/elements/member.rs | 6 +- src/signalling/peers.rs | 12 ++-- src/signalling/room.rs | 8 ++- 17 files changed, 127 insertions(+), 74 deletions(-) diff --git a/_dev/specs/relay-pub-pub-video-call.yml b/_dev/specs/relay-pub-pub-video-call.yml index 8c466c2d4..fe43c0d62 100644 --- a/_dev/specs/relay-pub-pub-video-call.yml +++ b/_dev/specs/relay-pub-pub-video-call.yml @@ -12,7 +12,8 @@ spec: publish: kind: WebRtcPublishEndpoint spec: - p2p: Never + p2p: Always + is_relay: true play-responder: kind: WebRtcPlayEndpoint spec: @@ -27,7 +28,8 @@ spec: publish: kind: WebRtcPublishEndpoint spec: - p2p: Never + p2p: Always + is_relay: true play-caller: kind: WebRtcPlayEndpoint spec: diff --git a/jason/e2e-demo/js/index.js b/jason/e2e-demo/js/index.js index 722fa2539..18b1f9f98 100644 --- a/jason/e2e-demo/js/index.js +++ b/jason/e2e-demo/js/index.js @@ -17,7 +17,8 @@ async function createRoom(roomId, memberId) { pipeline: { publish: { kind: 'WebRtcPublishEndpoint', - p2p: 'Always' + p2p: 'Always', + is_relay: false }, }, on_join: "grpc://127.0.0.1:9099", @@ -36,7 +37,8 @@ async function createMember(roomId, memberId) { let pipeline = { publish: { kind: 'WebRtcPublishEndpoint', - p2p: 'Always' + p2p: 'Always', + is_relay: false } }; @@ -137,9 +139,12 @@ const controlDebugWindows = { switch (endpointType) { case 'WebRtcPublishEndpoint': let p2pMode = container.getElementsByClassName('webrtc-publish-endpoint-spec__p2p')[0].value; + let isRelay = container.getElementsByClassName('webrtc-publish-endpoint-spec__is-relay')[0].value === 'true'; + console.log(isRelay); await controlApi.createEndpoint(roomId, memberId, endpointId, { kind: endpointType, p2p: p2pMode, + is_relay: isRelay, }); break; case 'WebRtcPlayEndpoint': diff --git a/jason/e2e-demo/video-call.html b/jason/e2e-demo/video-call.html index 4ada5d0ea..aa4720c62 100644 --- a/jason/e2e-demo/video-call.html +++ b/jason/e2e-demo/video-call.html @@ -265,10 +265,17 @@
P2P mode: + Is relay: +
diff --git a/jason/src/api/room.rs b/jason/src/api/room.rs index 244823276..086c93596 100644 --- a/jason/src/api/room.rs +++ b/jason/src/api/room.rs @@ -12,8 +12,7 @@ use futures::{channel::mpsc, stream, Future, FutureExt as _, StreamExt as _}; use js_sys::Promise; use medea_client_api_proto::{ Command, Direction, Event as RpcEvent, EventHandler, IceCandidate, - IceConnectionState, IceServer, IceTransportPolicy, PeerId, PeerMetrics, - Track, + IceConnectionState, IceServer, PeerId, PeerMetrics, Track, }; use tracerr::Traced; use wasm_bindgen::{prelude::*, JsValue}; @@ -541,7 +540,7 @@ impl EventHandler for InnerRoom { sdp_offer: Option, tracks: Vec, ice_servers: Vec, - ice_transport_policy: IceTransportPolicy, + is_relay: bool, ) { let peer = match self .peers @@ -551,7 +550,7 @@ impl EventHandler for InnerRoom { self.peer_event_sender.clone(), self.enabled_audio, self.enabled_video, - ice_transport_policy, + is_relay, ) .map_err(tracerr::map_from_and_wrap!(=> RoomError)) { diff --git a/jason/src/peer/conn.rs b/jason/src/peer/conn.rs index 736bbee16..694a116ed 100644 --- a/jason/src/peer/conn.rs +++ b/jason/src/peer/conn.rs @@ -1,7 +1,7 @@ use std::{cell::RefCell, rc::Rc}; use derive_more::Display; -use medea_client_api_proto::{IceServer, IceTransportPolicy}; +use medea_client_api_proto::IceServer; use tracerr::Traced; use wasm_bindgen_futures::JsFuture; use web_sys::{ @@ -211,18 +211,16 @@ pub struct RtcPeerConnection { impl RtcPeerConnection { /// Instantiates new [`RtcPeerConnection`]. - pub fn new( - ice_servers: I, - ice_transport_policy: IceTransportPolicy, - ) -> Result + pub fn new(ice_servers: I, is_relay: bool) -> Result where I: IntoIterator, { // TODO: RTCBundlePolicy = "max-bundle"? let mut peer_conf = RtcConfiguration::new(); - let ice_transport_policy = match ice_transport_policy { - IceTransportPolicy::All => RtcIceTransportPolicy::All, - IceTransportPolicy::Relay => RtcIceTransportPolicy::Relay, + let ice_transport_policy = if is_relay { + RtcIceTransportPolicy::Relay + } else { + RtcIceTransportPolicy::All }; peer_conf.ice_transport_policy(ice_transport_policy); peer_conf.ice_servers(&RtcIceServers::from(ice_servers)); diff --git a/jason/src/peer/mod.rs b/jason/src/peer/mod.rs index abc1432bf..070249870 100644 --- a/jason/src/peer/mod.rs +++ b/jason/src/peer/mod.rs @@ -15,8 +15,7 @@ use std::{cell::RefCell, collections::HashMap, convert::TryFrom, rc::Rc}; use derive_more::{Display, From}; use futures::{channel::mpsc, future}; use medea_client_api_proto::{ - Direction, IceConnectionState, IceServer, IceTransportPolicy, PeerId as Id, - Track, TrackId, + Direction, IceConnectionState, IceServer, PeerId as Id, Track, TrackId, }; use medea_macro::dispatchable; use tracerr::Traced; @@ -181,10 +180,10 @@ impl PeerConnection { media_manager: Rc, enabled_audio: bool, enabled_video: bool, - ice_transport_policy: IceTransportPolicy, + is_relay: bool, ) -> Result { let peer = Rc::new( - RtcPeerConnection::new(ice_servers, ice_transport_policy) + RtcPeerConnection::new(ice_servers, is_relay) .map_err(tracerr::map_from_and_wrap!())?, ); let media_connections = Rc::new(MediaConnections::new( diff --git a/jason/src/peer/repo.rs b/jason/src/peer/repo.rs index 7daac6fd5..53b821a6e 100644 --- a/jason/src/peer/repo.rs +++ b/jason/src/peer/repo.rs @@ -1,7 +1,7 @@ use std::{collections::HashMap, rc::Rc}; use futures::channel::mpsc; -use medea_client_api_proto::{IceServer, IceTransportPolicy, PeerId}; +use medea_client_api_proto::{IceServer, PeerId}; use tracerr::Traced; use crate::media::MediaManager; @@ -22,7 +22,7 @@ pub trait PeerRepository { peer_events_sender: mpsc::UnboundedSender, enabled_audio: bool, enabled_video: bool, - ice_transport_policy: IceTransportPolicy, + is_relay: bool, ) -> Result, Traced>; /// Returns [`PeerConnection`] stored in repository by its ID. @@ -65,7 +65,7 @@ impl PeerRepository for Repository { peer_events_sender: mpsc::UnboundedSender, enabled_audio: bool, enabled_video: bool, - ice_transport_policy: IceTransportPolicy, + is_relay: bool, ) -> Result, Traced> { let peer = Rc::new( PeerConnection::new( @@ -75,7 +75,7 @@ impl PeerRepository for Repository { Rc::clone(&self.media_manager), enabled_audio, enabled_video, - ice_transport_policy, + is_relay, ) .map_err(tracerr::map_from_and_wrap!())?, ); diff --git a/mock/control-api/src/api/endpoint.rs b/mock/control-api/src/api/endpoint.rs index 4731d399f..7ddd386ee 100644 --- a/mock/control-api/src/api/endpoint.rs +++ b/mock/control-api/src/api/endpoint.rs @@ -48,6 +48,8 @@ pub struct WebRtcPublishEndpoint { /// Mode of connection for this [`WebRtcPublishEndpoint`]. p2p: P2pMode, + + is_relay: bool, } impl WebRtcPublishEndpoint { @@ -58,6 +60,7 @@ impl WebRtcPublishEndpoint { let mut proto = WebRtcPublishEndpointProto::new(); proto.set_id(id); proto.set_p2p(self.p2p.into()); + proto.set_is_relay(self.is_relay); proto } } @@ -67,6 +70,7 @@ impl From for WebRtcPublishEndpoint { Self { id: proto.take_id(), p2p: proto.get_p2p().into(), + is_relay: proto.get_is_relay(), } } } diff --git a/proto/client-api/src/lib.rs b/proto/client-api/src/lib.rs index 3b5959e2d..f3d931160 100644 --- a/proto/client-api/src/lib.rs +++ b/proto/client-api/src/lib.rs @@ -173,12 +173,6 @@ pub struct CloseDescription { pub reason: CloseReason, } -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Copy, Eq)] -pub enum IceTransportPolicy { - All, - Relay, -} - /// WebSocket message from Medea to Jason. #[dispatchable] #[cfg_attr(feature = "medea", derive(Serialize, Debug, Clone, PartialEq))] @@ -192,7 +186,7 @@ pub enum Event { sdp_offer: Option, tracks: Vec, ice_servers: Vec, - ice_transport_policy: IceTransportPolicy, + is_relay: bool, }, /// Media Server notifies Web Client about necessity to apply specified SDP /// Answer to Web Client's RTCPeerConnection. diff --git a/proto/control-api/src/grpc/api.proto b/proto/control-api/src/grpc/api.proto index 4bdf05bf8..17a1a55ab 100644 --- a/proto/control-api/src/grpc/api.proto +++ b/proto/control-api/src/grpc/api.proto @@ -163,6 +163,7 @@ message WebRtcPublishEndpoint { string on_start = 3; // Callback which fires when a client stops publishing media data. string on_stop = 4; + bool is_relay = 5; // P2P mode of WebRTC interaction. enum P2P { diff --git a/proto/control-api/src/grpc/api.rs b/proto/control-api/src/grpc/api.rs index ba225e60a..a12f4abd4 100644 --- a/proto/control-api/src/grpc/api.rs +++ b/proto/control-api/src/grpc/api.rs @@ -3244,6 +3244,7 @@ pub struct WebRtcPublishEndpoint { pub p2p: WebRtcPublishEndpoint_P2P, pub on_start: ::std::string::String, pub on_stop: ::std::string::String, + pub is_relay: bool, // special fields pub unknown_fields: ::protobuf::UnknownFields, pub cached_size: ::protobuf::CachedSize, @@ -3352,6 +3353,21 @@ impl WebRtcPublishEndpoint { pub fn take_on_stop(&mut self) -> ::std::string::String { ::std::mem::replace(&mut self.on_stop, ::std::string::String::new()) } + + // bool is_relay = 5; + + + pub fn get_is_relay(&self) -> bool { + self.is_relay + } + pub fn clear_is_relay(&mut self) { + self.is_relay = false; + } + + // Param is passed by value, moved + pub fn set_is_relay(&mut self, v: bool) { + self.is_relay = v; + } } impl ::protobuf::Message for WebRtcPublishEndpoint { @@ -3375,6 +3391,13 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { 4 => { ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.on_stop)?; }, + 5 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.is_relay = tmp; + }, _ => { ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, @@ -3399,6 +3422,9 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { if !self.on_stop.is_empty() { my_size += ::protobuf::rt::string_size(4, &self.on_stop); } + if self.is_relay != false { + my_size += 2; + } my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); my_size @@ -3417,6 +3443,9 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { if !self.on_stop.is_empty() { os.write_string(4, &self.on_stop)?; } + if self.is_relay != false { + os.write_bool(5, self.is_relay)?; + } os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3479,6 +3508,11 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { |m: &WebRtcPublishEndpoint| { &m.on_stop }, |m: &mut WebRtcPublishEndpoint| { &mut m.on_stop }, )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "is_relay", + |m: &WebRtcPublishEndpoint| { &m.is_relay }, + |m: &mut WebRtcPublishEndpoint| { &mut m.is_relay }, + )); ::protobuf::reflect::MessageDescriptor::new::( "WebRtcPublishEndpoint", fields, @@ -3505,6 +3539,7 @@ impl ::protobuf::Clear for WebRtcPublishEndpoint { self.p2p = WebRtcPublishEndpoint_P2P::NEVER; self.on_start.clear(); self.on_stop.clear(); + self.is_relay = false; self.unknown_fields.clear(); } } @@ -3916,19 +3951,19 @@ static file_descriptor_proto_data: &'static [u8] = b"\ \x20\x01(\x0b2\x15.medea.Member.ElementR\x05value:\x028\x01\x1a\x8c\x01\ \n\x07Element\x12<\n\x0bwebrtc_play\x18\x01\x20\x01(\x0b2\x19.medea.WebR\ tcPlayEndpointH\0R\nwebrtcPlay\x12=\n\nwebrtc_pub\x18\x02\x20\x01(\x0b2\ - \x1c.medea.WebRtcPublishEndpointH\0R\twebrtcPubB\x04\n\x02el\"\xbe\x01\n\ + \x1c.medea.WebRtcPublishEndpointH\0R\twebrtcPubB\x04\n\x02el\"\xd9\x01\n\ \x15WebRtcPublishEndpoint\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x122\ \n\x03p2p\x18\x02\x20\x01(\x0e2\x20.medea.WebRtcPublishEndpoint.P2PR\x03\ p2p\x12\x19\n\x08on_start\x18\x03\x20\x01(\tR\x07onStart\x12\x17\n\x07on\ - _stop\x18\x04\x20\x01(\tR\x06onStop\"-\n\x03P2P\x12\t\n\x05NEVER\x10\0\ - \x12\x0f\n\x0bIF_POSSIBLE\x10\x01\x12\n\n\x06ALWAYS\x10\x02\"j\n\x12WebR\ - tcPlayEndpoint\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x10\n\x03sr\ - c\x18\x02\x20\x01(\tR\x03src\x12\x19\n\x08on_start\x18\x03\x20\x01(\tR\ - \x07onStart\x12\x17\n\x07on_stop\x18\x04\x20\x01(\tR\x06onStop2\x9d\x01\ - \n\nControlApi\x125\n\x06Create\x12\x14.medea.CreateRequest\x1a\x15.mede\ - a.CreateResponse\x12+\n\x06Delete\x12\x10.medea.IdRequest\x1a\x0f.medea.\ - Response\x12+\n\x03Get\x12\x10.medea.IdRequest\x1a\x12.medea.GetResponse\ - b\x06proto3\ + _stop\x18\x04\x20\x01(\tR\x06onStop\x12\x19\n\x08is_relay\x18\x05\x20\ + \x01(\x08R\x07isRelay\"-\n\x03P2P\x12\t\n\x05NEVER\x10\0\x12\x0f\n\x0bIF\ + _POSSIBLE\x10\x01\x12\n\n\x06ALWAYS\x10\x02\"j\n\x12WebRtcPlayEndpoint\ + \x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x10\n\x03src\x18\x02\x20\ + \x01(\tR\x03src\x12\x19\n\x08on_start\x18\x03\x20\x01(\tR\x07onStart\x12\ + \x17\n\x07on_stop\x18\x04\x20\x01(\tR\x06onStop2\x9d\x01\n\nControlApi\ + \x125\n\x06Create\x12\x14.medea.CreateRequest\x1a\x15.medea.CreateRespon\ + se\x12+\n\x06Delete\x12\x10.medea.IdRequest\x1a\x0f.medea.Response\x12+\ + \n\x03Get\x12\x10.medea.IdRequest\x1a\x12.medea.GetResponseb\x06proto3\ "; static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { diff --git a/src/api/control/endpoints/webrtc_publish_endpoint.rs b/src/api/control/endpoints/webrtc_publish_endpoint.rs index c46c672ad..9abe3acd7 100644 --- a/src/api/control/endpoints/webrtc_publish_endpoint.rs +++ b/src/api/control/endpoints/webrtc_publish_endpoint.rs @@ -5,7 +5,6 @@ use derive_more::{Display, From, Into}; use serde::Deserialize; -use medea_client_api_proto::IceTransportPolicy; use medea_control_api_proto::grpc::api::{ WebRtcPublishEndpoint as WebRtcPublishEndpointProto, WebRtcPublishEndpoint_P2P as WebRtcPublishEndpointP2pProto, @@ -18,7 +17,7 @@ use medea_control_api_proto::grpc::api::{ pub struct WebRtcPublishId(String); /// Peer-to-peer mode of [`WebRtcPublishEndpoint`]. -#[derive(Clone, Deserialize, Debug)] +#[derive(Copy, Clone, Deserialize, Debug)] pub enum P2pMode { /// Always connect peer-to-peer. Always, @@ -50,27 +49,22 @@ impl Into for P2pMode { } } -impl Into for P2pMode { - fn into(self) -> IceTransportPolicy { - match self { - Self::Always | Self::IfPossible => IceTransportPolicy::All, - Self::Never => IceTransportPolicy::Relay, - } - } -} - /// Media element which is able to publish media data for another client via /// WebRTC. #[derive(Clone, Deserialize, Debug)] pub struct WebRtcPublishEndpoint { /// Peer-to-peer mode of this [`WebRtcPublishEndpoint`]. pub p2p: P2pMode, + + #[serde(default)] + pub is_relay: bool, } impl From<&WebRtcPublishEndpointProto> for WebRtcPublishEndpoint { fn from(value: &WebRtcPublishEndpointProto) -> Self { Self { p2p: P2pMode::from(value.get_p2p()), + is_relay: value.get_is_relay(), } } } diff --git a/src/media/peer.rs b/src/media/peer.rs index cedfbab15..32ccf2047 100644 --- a/src/media/peer.rs +++ b/src/media/peer.rs @@ -9,8 +9,8 @@ use std::{collections::HashMap, convert::TryFrom, fmt, rc::Rc}; use derive_more::Display; use failure::Fail; use medea_client_api_proto::{ - AudioSettings, Direction, IceTransportPolicy, MediaType, PeerId as Id, - Track, TrackId, VideoSettings, + AudioSettings, Direction, MediaType, PeerId as Id, Track, TrackId, + VideoSettings, }; use medea_macro::enum_delegate; @@ -70,7 +70,7 @@ impl PeerError { #[enum_delegate(pub fn member_id(&self) -> MemberId)] #[enum_delegate(pub fn partner_peer_id(&self) -> Id)] #[enum_delegate(pub fn partner_member_id(&self) -> MemberId)] -#[enum_delegate(pub fn ice_transport_policy(&self) -> IceTransportPolicy)] +#[enum_delegate(pub fn is_relay(&self) -> bool)] #[derive(Debug)] pub enum PeerStateMachine { New(Peer), @@ -152,7 +152,7 @@ pub struct Context { sdp_answer: Option, receivers: HashMap>, senders: HashMap>, - ice_transport_policy: IceTransportPolicy, + is_relay: bool, } /// [RTCPeerConnection] representation. @@ -226,8 +226,8 @@ impl Peer { !self.context.senders.is_empty() } - pub fn ice_transport_policy(&self) -> IceTransportPolicy { - self.context.ice_transport_policy + pub fn is_relay(&self) -> bool { + self.context.is_relay } } @@ -240,7 +240,7 @@ impl Peer { member_id: MemberId, partner_peer: Id, partner_member: MemberId, - ice_transport_policy: IceTransportPolicy, + is_relay: bool, ) -> Self { let context = Context { id, @@ -251,7 +251,7 @@ impl Peer { sdp_answer: None, receivers: HashMap::new(), senders: HashMap::new(), - ice_transport_policy, + is_relay, }; Self { context, diff --git a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs index bfc4058f0..3377be63f 100644 --- a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs +++ b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs @@ -32,6 +32,8 @@ struct WebRtcPublishEndpointInner { /// P2P connection mode for this [`WebRtcPublishEndpoint`]. p2p: P2pMode, + is_relay: bool, + /// All sinks of this [`WebRtcPublishEndpoint`]. sinks: Vec, @@ -109,10 +111,16 @@ pub struct WebRtcPublishEndpoint(Rc>); impl WebRtcPublishEndpoint { /// Creates new [`WebRtcPublishEndpoint`]. - pub fn new(id: Id, p2p: P2pMode, owner: WeakMember) -> Self { + pub fn new( + id: Id, + p2p: P2pMode, + owner: WeakMember, + is_relay: bool, + ) -> Self { Self(Rc::new(RefCell::new(WebRtcPublishEndpointInner { id, p2p, + is_relay, sinks: Vec::new(), owner, peer_ids: HashSet::new(), @@ -187,7 +195,11 @@ impl WebRtcPublishEndpoint { /// Peer-to-peer mode of this [`WebRtcPublishEndpoint`]. pub fn p2p(&self) -> P2pMode { - self.0.borrow().p2p.clone() + self.0.borrow().p2p + } + + pub fn is_relay(&self) -> bool { + self.0.borrow().is_relay } /// Downgrades [`WebRtcPublishEndpoint`] to weak pointer @@ -232,6 +244,7 @@ impl Into for WebRtcPublishEndpoint { let mut publish = WebRtcPublishEndpointProto::new(); publish.set_p2p(self.p2p().into()); publish.set_id(self.id().to_string()); + publish.set_is_relay(self.is_relay()); element.set_webrtc_pub(publish); element diff --git a/src/signalling/elements/member.rs b/src/signalling/elements/member.rs index 57d9e15c8..715a56649 100644 --- a/src/signalling/elements/member.rs +++ b/src/signalling/elements/member.rs @@ -201,8 +201,9 @@ impl Member { let new_publish_id = spec_play_endpoint.src.endpoint_id.clone(); let new_publish = WebRtcPublishEndpoint::new( new_publish_id, - publisher_endpoint.p2p.clone(), + publisher_endpoint.p2p, publisher_member.downgrade(), + publisher_endpoint.is_relay, ); let new_self_play = WebRtcPlayEndpoint::new( @@ -228,8 +229,9 @@ impl Member { .for_each(|(endpoint_id, e)| { self.insert_src(WebRtcPublishEndpoint::new( endpoint_id, - e.p2p.clone(), + e.p2p, this_member.downgrade(), + e.is_relay, )); }); diff --git a/src/signalling/peers.rs b/src/signalling/peers.rs index 3d34f56b5..a8417fdef 100644 --- a/src/signalling/peers.rs +++ b/src/signalling/peers.rs @@ -9,9 +9,7 @@ use std::{ }; use derive_more::Display; -use medea_client_api_proto::{ - IceTransportPolicy, Incrementable, PeerId, TrackId, -}; +use medea_client_api_proto::{Incrementable, PeerId, TrackId}; use crate::{ api::control::MemberId, @@ -85,7 +83,7 @@ impl PeerRepository { &mut self, first_member: &Member, second_member: &Member, - ice_transport_policy: IceTransportPolicy, + is_relay: bool, ) -> (Peer, Peer) { let first_member_id = first_member.id(); let second_member_id = second_member.id(); @@ -102,14 +100,14 @@ impl PeerRepository { first_member_id.clone(), second_peer_id, second_member_id.clone(), - ice_transport_policy, + is_relay, ); let second_peer = Peer::new( second_peer_id, second_member_id, first_peer_id, first_member_id, - ice_transport_policy, + is_relay, ); (first_peer, second_peer) @@ -316,7 +314,7 @@ impl PeerRepository { self.add_peer(sink_peer); } else { let (mut src_peer, mut sink_peer) = - self.create_peers(&src_owner, &sink_owner, src.p2p().into()); + self.create_peers(&src_owner, &sink_owner, src.is_relay()); src_peer.add_publisher(&mut sink_peer, self.get_tracks_counter()); diff --git a/src/signalling/room.rs b/src/signalling/room.rs index 0c0842d8f..e20526131 100644 --- a/src/signalling/room.rs +++ b/src/signalling/room.rs @@ -248,7 +248,7 @@ impl Room { sdp_offer: None, tracks: sender.tracks(), ice_servers, - ice_transport_policy: sender.ice_transport_policy(), + is_relay: sender.is_relay(), }; self.peers.add_peer(sender); Ok(Box::new(wrap_future( @@ -574,6 +574,7 @@ impl Room { String::from(play_id).into(), spec.p2p, member.downgrade(), + spec.is_relay, ); debug!( @@ -682,8 +683,9 @@ impl Room { for (id, publish) in spec.publish_endpoints() { let signalling_publish = WebRtcPublishEndpoint::new( id.clone(), - publish.p2p.clone(), + publish.p2p, signalling_member.downgrade(), + publish.is_relay, ); signalling_member.insert_src(signalling_publish); } @@ -817,7 +819,7 @@ impl CommandHandler for Room { sdp_offer: Some(sdp_offer), tracks: to_peer.tracks(), ice_servers, - ice_transport_policy: to_peer.ice_transport_policy(), + is_relay: to_peer.is_relay(), }; self.peers.add_peer(from_peer); From 48edbc0aefe5625925a8fab884f66bf01635f04b Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Mon, 6 Jan 2020 14:44:21 +0300 Subject: [PATCH 04/15] Update RFCs --- docs/rfc/0001-control-api.md | 3 + docs/rfc/0002-webrc-client-api.md | 240 +++++++++++++++--------------- 2 files changed, 124 insertions(+), 119 deletions(-) diff --git a/docs/rfc/0001-control-api.md b/docs/rfc/0001-control-api.md index f1c98433a..dfc1b93a7 100644 --- a/docs/rfc/0001-control-api.md +++ b/docs/rfc/0001-control-api.md @@ -70,6 +70,8 @@ spec: on_start: "http://127.0.0.1:8080/publish/started" # Fires when "caller" client stops publishing media data. on_stop: "http://127.0.0.1:8080/publish/stopped" + # All media will be relayed through TURN server. + is_relay: false # Media element which is able to play media data for client via WebRTC. play: kind: WebRtcPlayEndpoint @@ -796,6 +798,7 @@ message WebRtcPublishEndpoint { optional string dst = 2; optional string on_start = 3; optional string on_stop = 4; + optional bool is_relay = 5; enum P2P { NEVER = 0; diff --git a/docs/rfc/0002-webrc-client-api.md b/docs/rfc/0002-webrc-client-api.md index 501535d72..f0d8167b8 100644 --- a/docs/rfc/0002-webrc-client-api.md +++ b/docs/rfc/0002-webrc-client-api.md @@ -213,15 +213,17 @@ Where: ```rust struct PeerCreated { - peer: Peer, + peer_id: PeerId, sdp_offer: Option, - ice_servers: Vec, + tracks: Vec, + ice_servers: Vec, + is_relay: bool, } ``` Related objects: ```rust -struct ICEServer { +struct IceServer { urls: Vec, username: String, credential: String, @@ -231,9 +233,11 @@ struct ICEServer { `Media Server` notifies about necessity of [RTCPeerConnection] creation. Params: -1. `peer`: peer connection settings. +1. `peer_id`: created `Peer`'s ID. 2. `sdp_offer`: if `None`, client should create [SDP Offer] and pass it to the server; if `Some`, client should set it as remote description, then create [SDP Answer], set it as local description, and pass it to the server. -3. `ice_servers`: list of [ICE server]s that should be used to construct [RTCPeerConnection]. +3. `tracks`: tracks of this `Peer`. +4. `ice_servers`: list of [ICE server]s that should be used to construct [RTCPeerConnection]. +5. `is_relay`: if `true` then all media will be relayed through [TURN] server. The most important part of `Peer` object is a list of `Track`s. - All `TrackDirection::Send` `Track`s must be created according to their settings and added to the `Peer`. @@ -246,31 +250,37 @@ The most important part of `Peer` object is a list of `Track`s. ```json { - "peer": { - "peer_id": 1, - "tracks": [{ + "peer_id": 1, + "tracks": [ + { "id": 1, "media_type": { "Audio": {} }, "direction": { "Send": { - "receivers": [2], + "receivers": [ + 2 + ], "mid": null } } - }, { + }, + { "id": 2, "media_type": { "Video": {} }, "direction": { "Send": { - "receivers": [2], + "receivers": [ + 2 + ], "mid": null } } - }, { + }, + { "id": 3, "media_type": { "Audio": {} @@ -281,9 +291,10 @@ The most important part of `Peer` object is a list of `Track`s. "mid": null } } - }, { + }, + { "id": 4, - "media_type": { + "media_type": { "Video": {} }, "direction": { @@ -293,16 +304,19 @@ The most important part of `Peer` object is a list of `Track`s. } } } - ]}, + ], "sdp_offer": null, - "ice_servers": [{ - "urls": [ - "turn:turnserver.com:3478", - "turn:turnserver.com:3478?transport=tcp" - ], - "username": "turn_user", - "credential": "turn_credential" - }] + "ice_servers": [ + { + "urls": [ + "turn:turnserver.com:3478", + "turn:turnserver.com:3478?transport=tcp" + ], + "username": "turn_user", + "credential": "turn_credential" + } + ], + "is_relay": false } ``` @@ -323,12 +337,12 @@ After negotiation is done and media starts flowing, `Web Client` might receive n ```json { - "peer": { - "peer_id": 1, - "tracks": [{ + "peer_id": 1, + "tracks": [ + { "id": 1, - "media_type": { - "Audio": {} + "media_type":{ + "Audio":{} }, "direction": { "Send": { @@ -336,17 +350,20 @@ After negotiation is done and media starts flowing, `Web Client` might receive n "mid": null } } - }] - }, + } + ], "sdp_offer": "server_user1_recvonly_offer", - "ice_servers": [{ - "urls": [ - "turn:turnserver.com:3478", - "turn:turnserver.com:3478?transport=tcp" - ], - "username": "turn_user", - "credential": "turn_credential" - }] + "ice_servers": [ + { + "urls": [ + "turn:turnserver.com:3478", + "turn:turnserver.com:3478?transport=tcp" + ], + "username": "turn_user", + "credential": "turn_credential" + } + ], + "is_relay": false } ``` @@ -1082,70 +1099,84 @@ Metrics list will be extended as needed. 1. `Media Server` sends `PeerCreated` event to `user1`: - ```json - { - "event": "PeerCreated", - "data": { - "peer": { - "peer_id": 1, - "tracks": [{ - "id": 1, - "media_type": { - "Audio": {} - }, - "direction": { - "Send": { - "receivers": [2], - "mid": null - } + ```json + { + "event": "PeerCreated", + "data": { + "peer_id": 1, + "tracks": [ + { + "id": 1, + "media_type": { + "Audio": {} + }, + "direction": { + "Send": { + "receivers": [ + 2 + ], + "mid": null } - }, { - "id": 2, - "media_type": { - "Video": {} - }, - "direction": { - "Send": { - "receivers": [2], - "mid": null - } + } + }, + { + "id": 2, + "media_type": { + "Video": { + } - }, { - "id": 3, - "media_type": { - "Audio": {} - }, - "direction": { - "Recv": { - "sender": 2, - "mid": null - } + }, + "direction": { + "Send": { + "receivers": [ + 2 + ], + "mid": null } - }, { - "id": 4, - "media_type": { - "Video": {} - }, - "direction": { - "Recv": { - "sender": 2, - "mid": null - } + } + }, + { + "id": 3, + "media_type": { + "Audio": { + } - }] + }, + "direction": { + "Recv": { + "sender": 2, + "mid": null + } + } }, - "sdp_offer": null, - "ice_servers": [{ + { + "id": 4, + "media_type": { + "Video": {} + }, + "direction": { + "Recv": { + "sender": 2, + "mid": null + } + } + } + ], + "sdp_offer": null, + "ice_servers": [ + { "urls": [ "turn:turnserver.com:3478", "turn:turnserver.com:3478?transport=tcp" ], "username": "turn_user", "credential": "turn_credential" - }] - } + } + ], + "is_relay": false } - ``` + } + ``` 2. `user1` answers with [SDP Offer]: @@ -1465,35 +1496,6 @@ Metrics list will be extended as needed. 15. `Media Server` updates `user1` `Track`s: - ```json - { - "event": "TracksApplied", - "data": { - "peer_id": 1, - "tracks": [{ - "id": 1, - "media_type": { - "Audio": {} - }, - "direction": { - "Send": { - "receivers": [2] - } - } - }, { - "id": 2, - "media_type": { - "Video": {} - }, - "direction": { - "Send": { - "receivers": [2] - } - } - }] - } - } - ``` 16. SDP re-negotiation: From 6b9e9cd0550b50ab5b05883c3ae0b077e36950c5 Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Mon, 6 Jan 2020 14:44:43 +0300 Subject: [PATCH 05/15] Fix Jason tests --- jason/e2e-demo/video-call.html | 2 -- jason/tests/api/room.rs | 16 ++++++++-------- jason/tests/peer/media.rs | 8 ++++---- jason/tests/peer/mod.rs | 28 ++++++++++++++-------------- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/jason/e2e-demo/video-call.html b/jason/e2e-demo/video-call.html index aa4720c62..69b9962b4 100644 --- a/jason/e2e-demo/video-call.html +++ b/jason/e2e-demo/video-call.html @@ -265,14 +265,12 @@
P2P mode: Is relay: diff --git a/jason/tests/api/room.rs b/jason/tests/api/room.rs index 21282f26a..f0b5b1118 100644 --- a/jason/tests/api/room.rs +++ b/jason/tests/api/room.rs @@ -3,7 +3,7 @@ use std::rc::Rc; use futures::channel::mpsc; -use medea_client_api_proto::{Event, IceServer, IceTransportPolicy, PeerId}; +use medea_client_api_proto::{Event, IceServer, PeerId}; use medea_jason::{ api::Room, media::{AudioTrackConstraints, MediaManager, MediaStreamConstraints}, @@ -33,7 +33,7 @@ fn get_test_room_and_exist_peer( Rc::new(MediaManager::default()), true, true, - IceTransportPolicy::All, + false, ) .unwrap(), ); @@ -103,7 +103,7 @@ fn get_test_room_and_new_peer( Rc::new(MediaManager::default()), with_enabled_audio, with_enabled_video, - IceTransportPolicy::All, + false, ) .unwrap(), ); @@ -115,7 +115,7 @@ fn get_test_room_and_new_peer( _peer_events_sender: &mpsc::UnboundedSender, enabled_audio: &bool, enabled_video: &bool, - _ice_transport_policy: &IceTransportPolicy| { + _is_relay: &bool| { *id == PeerId(1) && *enabled_audio == with_enabled_audio && *enabled_video == with_enabled_video @@ -143,7 +143,7 @@ async fn mute_audio_room_before_init_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - ice_transport_policy: IceTransportPolicy::All, + is_relay: false, }) .unwrap(); @@ -166,7 +166,7 @@ async fn mute_video_room_before_init_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - ice_transport_policy: IceTransportPolicy::All, + is_relay: false, }) .unwrap(); @@ -218,7 +218,7 @@ async fn error_inject_invalid_local_stream_into_new_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - ice_transport_policy: IceTransportPolicy::All, + is_relay: false, }) .unwrap(); @@ -291,7 +291,7 @@ async fn error_get_local_stream_on_new_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - ice_transport_policy: IceTransportPolicy::All, + is_relay: false, }) .unwrap(); diff --git a/jason/tests/peer/media.rs b/jason/tests/peer/media.rs index 792ec87e8..de7894572 100644 --- a/jason/tests/peer/media.rs +++ b/jason/tests/peer/media.rs @@ -2,7 +2,7 @@ use std::{convert::TryFrom, rc::Rc}; -use medea_client_api_proto::{IceTransportPolicy, TrackId}; +use medea_client_api_proto::{TrackId}; use medea_jason::{ media::MediaManager, peer::{ @@ -22,7 +22,7 @@ async fn get_test_media_connections( ) -> (MediaConnections, TrackId, TrackId) { let media_connections = MediaConnections::new( Rc::new( - RtcPeerConnection::new(vec![], IceTransportPolicy::All).unwrap(), + RtcPeerConnection::new(vec![], false).unwrap(), ), enabled_audio, enabled_video, @@ -50,7 +50,7 @@ async fn get_test_media_connections( fn get_stream_request() { let media_connections = MediaConnections::new( Rc::new( - RtcPeerConnection::new(vec![], IceTransportPolicy::All).unwrap(), + RtcPeerConnection::new(vec![], false).unwrap(), ), true, true, @@ -64,7 +64,7 @@ fn get_stream_request() { let media_connections = MediaConnections::new( Rc::new( - RtcPeerConnection::new(vec![], IceTransportPolicy::All).unwrap(), + RtcPeerConnection::new(vec![], false).unwrap(), ), true, true, diff --git a/jason/tests/peer/mod.rs b/jason/tests/peer/mod.rs index 2aee55797..8162a0fb0 100644 --- a/jason/tests/peer/mod.rs +++ b/jason/tests/peer/mod.rs @@ -5,7 +5,7 @@ mod media; use std::rc::Rc; use futures::{channel::mpsc, StreamExt as _}; -use medea_client_api_proto::{IceConnectionState, IceTransportPolicy, PeerId}; +use medea_client_api_proto::{IceConnectionState, PeerId}; use medea_jason::{ media::MediaManager, peer::{PeerConnection, PeerEvent}, @@ -28,7 +28,7 @@ async fn mute_unmute_audio() { manager, true, true, - IceTransportPolicy::All, + false, ) .unwrap(); @@ -60,7 +60,7 @@ async fn mute_unmute_video() { manager, true, true, - IceTransportPolicy::All, + false, ) .unwrap(); peer.get_offer(vec![audio_track, video_track], None) @@ -91,7 +91,7 @@ async fn new_with_mute_audio() { manager, false, true, - IceTransportPolicy::All, + false, ) .unwrap(); @@ -115,7 +115,7 @@ async fn new_with_mute_video() { manager, true, false, - IceTransportPolicy::All, + false, ) .unwrap(); peer.get_offer(vec![audio_track, video_track], None) @@ -139,7 +139,7 @@ async fn add_candidates_to_answerer_before_offer() { Rc::clone(&manager), true, true, - IceTransportPolicy::All, + false, ) .unwrap(); @@ -150,7 +150,7 @@ async fn add_candidates_to_answerer_before_offer() { manager, true, true, - IceTransportPolicy::All, + false, ) .unwrap(); let (audio_track, video_track) = get_test_tracks(); @@ -183,7 +183,7 @@ async fn add_candidates_to_offerer_before_answer() { Rc::clone(&manager), true, true, - IceTransportPolicy::All, + false, ) .unwrap(), ); @@ -195,7 +195,7 @@ async fn add_candidates_to_offerer_before_answer() { manager, true, true, - IceTransportPolicy::All, + false, ) .unwrap(), ); @@ -229,7 +229,7 @@ async fn normal_exchange_of_candidates() { Rc::clone(&manager), true, true, - IceTransportPolicy::All, + false, ) .unwrap(); let peer2 = PeerConnection::new( @@ -239,7 +239,7 @@ async fn normal_exchange_of_candidates() { manager, true, true, - IceTransportPolicy::All, + false, ) .unwrap(); let (audio_track, video_track) = get_test_tracks(); @@ -303,7 +303,7 @@ async fn send_event_on_new_local_stream() { manager, true, false, - IceTransportPolicy::All, + false, ) .unwrap(); peer.get_offer(vec![audio_track, video_track], None) @@ -337,7 +337,7 @@ async fn ice_connection_state_changed_is_emitted() { Rc::clone(&manager), true, true, - IceTransportPolicy::All, + false, ) .unwrap(); let peer2 = PeerConnection::new( @@ -347,7 +347,7 @@ async fn ice_connection_state_changed_is_emitted() { manager, true, true, - IceTransportPolicy::All, + false, ) .unwrap(); let (audio_track, video_track) = get_test_tracks(); From 1336f7e92208e3d0712d068cf8660a0059c902d6 Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Mon, 6 Jan 2020 14:45:22 +0300 Subject: [PATCH 06/15] Add docs --- mock/control-api/src/api/endpoint.rs | 1 + proto/control-api/src/grpc/api.proto | 1 + src/api/control/endpoints/webrtc_publish_endpoint.rs | 1 + src/media/peer.rs | 1 + src/signalling/elements/endpoints/webrtc/publish_endpoint.rs | 1 + 5 files changed, 5 insertions(+) diff --git a/mock/control-api/src/api/endpoint.rs b/mock/control-api/src/api/endpoint.rs index 7ddd386ee..c459e6948 100644 --- a/mock/control-api/src/api/endpoint.rs +++ b/mock/control-api/src/api/endpoint.rs @@ -49,6 +49,7 @@ pub struct WebRtcPublishEndpoint { /// Mode of connection for this [`WebRtcPublishEndpoint`]. p2p: P2pMode, + /// If 'true' then all media will be relayed through TURN server. is_relay: bool, } diff --git a/proto/control-api/src/grpc/api.proto b/proto/control-api/src/grpc/api.proto index 17a1a55ab..6180b9972 100644 --- a/proto/control-api/src/grpc/api.proto +++ b/proto/control-api/src/grpc/api.proto @@ -163,6 +163,7 @@ message WebRtcPublishEndpoint { string on_start = 3; // Callback which fires when a client stops publishing media data. string on_stop = 4; + // If 'true' then all media will be relayed through TURN server. bool is_relay = 5; // P2P mode of WebRTC interaction. diff --git a/src/api/control/endpoints/webrtc_publish_endpoint.rs b/src/api/control/endpoints/webrtc_publish_endpoint.rs index 9abe3acd7..4a85c453e 100644 --- a/src/api/control/endpoints/webrtc_publish_endpoint.rs +++ b/src/api/control/endpoints/webrtc_publish_endpoint.rs @@ -56,6 +56,7 @@ pub struct WebRtcPublishEndpoint { /// Peer-to-peer mode of this [`WebRtcPublishEndpoint`]. pub p2p: P2pMode, + /// If 'true' then all media will be relayed through TURN server. #[serde(default)] pub is_relay: bool, } diff --git a/src/media/peer.rs b/src/media/peer.rs index 32ccf2047..1381d0072 100644 --- a/src/media/peer.rs +++ b/src/media/peer.rs @@ -226,6 +226,7 @@ impl Peer { !self.context.senders.is_empty() } + /// If 'true' is returned then all media should be relayed through TURN server. pub fn is_relay(&self) -> bool { self.context.is_relay } diff --git a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs index 3377be63f..ec6642ddb 100644 --- a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs +++ b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs @@ -32,6 +32,7 @@ struct WebRtcPublishEndpointInner { /// P2P connection mode for this [`WebRtcPublishEndpoint`]. p2p: P2pMode, + /// If 'true' then all media will be relayed through TURN server. is_relay: bool, /// All sinks of this [`WebRtcPublishEndpoint`]. From ca140df229e8eadd5a13cfb5d39b45582a396f62 Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Mon, 6 Jan 2020 14:52:28 +0300 Subject: [PATCH 07/15] Upd CHANGELOGs --- CHANGELOG.md | 3 ++- jason/CHANGELOG.md | 3 ++- proto/client-api/CHANGELOG.md | 3 ++- proto/control-api/CHANGELOG.md | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98e40db74..f1c235315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,8 @@ All user visible changes to this project will be documented in this file. This p - Dynamic `Peer`s creation when client connects ([#28]); - Auto-removing `Peer`s when `Member` disconnects ([#28]); - Filter `SetIceCandidate` messages without `candidate` ([#50](/../../pull/50)); - - Send reason of closing WebSocket connection as [Close](https://tools.ietf.org/html/rfc4566#section-5.14) frame's description ([#58](/../../pull/58)). + - Send reason of closing WebSocket connection as [Close](https://tools.ietf.org/html/rfc4566#section-5.14) frame's description ([#58](/../../pull/58)); + - Send relay mode in `Event::PeerCreated` which will be used in client side's `RtcIceTransportPolicy` ([#78](/../../pull/78)). - Configuration: - `[server.control.grpc]` section to configure Control API gRPC server ([#33]); - `server.client.http.public_url` option to configure public URL of Client API HTTP server ([#33]). diff --git a/jason/CHANGELOG.md b/jason/CHANGELOG.md index b364f4ebf..4fe058f32 100644 --- a/jason/CHANGELOG.md +++ b/jason/CHANGELOG.md @@ -40,7 +40,8 @@ All user visible changes to this project will be documented in this file. This p - `Room.join()`; - Ability to inject local video/audio stream into `Room` via `Room.inject_local_stream()` ([#54]); - `Room.on_failed_local_stream` callback ([#54]); - - `Room.on_close` callback for WebSocket close initiated by server ([#55]). + - `Room.on_close` callback for WebSocket close initiated by server ([#55]); + - `RtcIceTransportPolicy` configuration ([#78](/../../pull/78)). - RPC messaging: - Cleanup Jason state on normal (`code = 1000`) WebSocket close ([#55]). - Signalling: diff --git a/proto/client-api/CHANGELOG.md b/proto/client-api/CHANGELOG.md index 26876f41d..f287c0d84 100644 --- a/proto/client-api/CHANGELOG.md +++ b/proto/client-api/CHANGELOG.md @@ -14,7 +14,8 @@ All user visible changes to this project will be documented in this file. This p - `TrackId` and `PeerId` types ([#28]); - `Incrementable` trait ([#28]); - `CloseReason` and `CloseDescription` types ([#58](/../../pull/58)); -- `AddPeerConnectionMetrics` client command with `IceConnectionState` metric ([#71](/../../pull/71)). +- `AddPeerConnectionMetrics` client command with `IceConnectionState` metric ([#71](/../../pull/71)); +- `is_relay` into `Event::PeerCreated` ([#78](/../../pull/78)). [#28]: /../../pull/28 diff --git a/proto/control-api/CHANGELOG.md b/proto/control-api/CHANGELOG.md index 63192811c..5b02355ad 100644 --- a/proto/control-api/CHANGELOG.md +++ b/proto/control-api/CHANGELOG.md @@ -27,6 +27,7 @@ All user visible changes to this project will be documented in this file. This p - `Member`; - `WebRtcPlayEndpoint`; - `WebRtcPublishEndpoint`. + - `is_relay` field into `WebRtcPublishEndpoint` ([#78](/../../pull/78)). - `Callback` service: - Callbacks ([#63]): - `OnJoin`; From a1d0935d38866905b1369a85cee2a927eeb9436c Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Mon, 6 Jan 2020 15:02:28 +0300 Subject: [PATCH 08/15] Reread [run ci] --- docs/rfc/0002-webrc-client-api.md | 163 +++++++++++------- jason/e2e-demo/js/index.js | 1 - jason/tests/peer/media.rs | 14 +- jason/tests/peer/mod.rs | 115 +++--------- src/media/peer.rs | 3 +- .../endpoints/webrtc/publish_endpoint.rs | 2 + src/signalling/room.rs | 4 +- tests/e2e/signalling/pub_sub_signallng.rs | 9 +- tests/specs/pub-sub-video-call.yml | 3 +- 9 files changed, 136 insertions(+), 178 deletions(-) diff --git a/docs/rfc/0002-webrc-client-api.md b/docs/rfc/0002-webrc-client-api.md index f0d8167b8..048289d47 100644 --- a/docs/rfc/0002-webrc-client-api.md +++ b/docs/rfc/0002-webrc-client-api.md @@ -1099,84 +1099,84 @@ Metrics list will be extended as needed. 1. `Media Server` sends `PeerCreated` event to `user1`: - ```json - { - "event": "PeerCreated", - "data": { - "peer_id": 1, - "tracks": [ - { - "id": 1, - "media_type": { - "Audio": {} - }, - "direction": { - "Send": { - "receivers": [ - 2 - ], - "mid": null + ```json + { + "event": "PeerCreated", + "data": { + "peer_id": 1, + "tracks": [ + { + "id": 1, + "media_type": { + "Audio": {} + }, + "direction": { + "Send": { + "receivers": [ + 2 + ], + "mid": null + } } - } - }, - { - "id": 2, - "media_type": { - "Video": { + }, + { + "id": 2, + "media_type": { + "Video": { + } + }, + "direction": { + "Send": { + "receivers": [ + 2 + ], + "mid": null + } } }, - "direction": { - "Send": { - "receivers": [ - 2 - ], - "mid": null - } - } - }, - { - "id": 3, - "media_type": { - "Audio": { + { + "id": 3, + "media_type": { + "Audio": { + } + }, + "direction": { + "Recv": { + "sender": 2, + "mid": null + } } }, - "direction": { - "Recv": { - "sender": 2, - "mid": null + { + "id": 4, + "media_type": { + "Video": {} + }, + "direction": { + "Recv": { + "sender": 2, + "mid": null + } } } - }, - { - "id": 4, - "media_type": { - "Video": {} - }, - "direction": { - "Recv": { - "sender": 2, - "mid": null - } + ], + "sdp_offer": null, + "ice_servers": [ + { + "urls": [ + "turn:turnserver.com:3478", + "turn:turnserver.com:3478?transport=tcp" + ], + "username": "turn_user", + "credential": "turn_credential" } - } - ], - "sdp_offer": null, - "ice_servers": [ - { - "urls": [ - "turn:turnserver.com:3478", - "turn:turnserver.com:3478?transport=tcp" - ], - "username": "turn_user", - "credential": "turn_credential" - } - ], - "is_relay": false + ], + "is_relay": false + } } - } - ``` + ``` 2. `user1` answers with [SDP Offer]: @@ -1496,6 +1496,35 @@ Metrics list will be extended as needed. 15. `Media Server` updates `user1` `Track`s: + ```json + { + "event": "TracksApplied", + "data": { + "peer_id": 1, + "tracks": [{ + "id": 1, + "media_type": { + "Audio": {} + }, + "direction": { + "Send": { + "receivers": [2] + } + } + }, { + "id": 2, + "media_type": { + "Video": {} + }, + "direction": { + "Send": { + "receivers": [2] + } + } + }] + } + } + ``` 16. SDP re-negotiation: diff --git a/jason/e2e-demo/js/index.js b/jason/e2e-demo/js/index.js index 18b1f9f98..fb1461585 100644 --- a/jason/e2e-demo/js/index.js +++ b/jason/e2e-demo/js/index.js @@ -140,7 +140,6 @@ const controlDebugWindows = { case 'WebRtcPublishEndpoint': let p2pMode = container.getElementsByClassName('webrtc-publish-endpoint-spec__p2p')[0].value; let isRelay = container.getElementsByClassName('webrtc-publish-endpoint-spec__is-relay')[0].value === 'true'; - console.log(isRelay); await controlApi.createEndpoint(roomId, memberId, endpointId, { kind: endpointType, p2p: p2pMode, diff --git a/jason/tests/peer/media.rs b/jason/tests/peer/media.rs index de7894572..d77190d6f 100644 --- a/jason/tests/peer/media.rs +++ b/jason/tests/peer/media.rs @@ -2,7 +2,7 @@ use std::{convert::TryFrom, rc::Rc}; -use medea_client_api_proto::{TrackId}; +use medea_client_api_proto::TrackId; use medea_jason::{ media::MediaManager, peer::{ @@ -21,9 +21,7 @@ async fn get_test_media_connections( enabled_video: bool, ) -> (MediaConnections, TrackId, TrackId) { let media_connections = MediaConnections::new( - Rc::new( - RtcPeerConnection::new(vec![], false).unwrap(), - ), + Rc::new(RtcPeerConnection::new(vec![], false).unwrap()), enabled_audio, enabled_video, ); @@ -49,9 +47,7 @@ async fn get_test_media_connections( #[wasm_bindgen_test] fn get_stream_request() { let media_connections = MediaConnections::new( - Rc::new( - RtcPeerConnection::new(vec![], false).unwrap(), - ), + Rc::new(RtcPeerConnection::new(vec![], false).unwrap()), true, true, ); @@ -63,9 +59,7 @@ fn get_stream_request() { assert!(request.is_some()); let media_connections = MediaConnections::new( - Rc::new( - RtcPeerConnection::new(vec![], false).unwrap(), - ), + Rc::new(RtcPeerConnection::new(vec![], false).unwrap()), true, true, ); diff --git a/jason/tests/peer/mod.rs b/jason/tests/peer/mod.rs index 8162a0fb0..b6d50641d 100644 --- a/jason/tests/peer/mod.rs +++ b/jason/tests/peer/mod.rs @@ -21,16 +21,9 @@ async fn mute_unmute_audio() { let (tx, _rx) = mpsc::unbounded(); let manager = Rc::new(MediaManager::default()); let (audio_track, video_track) = get_test_tracks(); - let peer = PeerConnection::new( - PeerId(1), - tx, - vec![], - manager, - true, - true, - false, - ) - .unwrap(); + let peer = + PeerConnection::new(PeerId(1), tx, vec![], manager, true, true, false) + .unwrap(); peer.get_offer(vec![audio_track, video_track], None) .await @@ -53,16 +46,9 @@ async fn mute_unmute_video() { let (tx, _rx) = mpsc::unbounded(); let manager = Rc::new(MediaManager::default()); let (audio_track, video_track) = get_test_tracks(); - let peer = PeerConnection::new( - PeerId(1), - tx, - vec![], - manager, - true, - true, - false, - ) - .unwrap(); + let peer = + PeerConnection::new(PeerId(1), tx, vec![], manager, true, true, false) + .unwrap(); peer.get_offer(vec![audio_track, video_track], None) .await .unwrap(); @@ -84,16 +70,9 @@ async fn new_with_mute_audio() { let (tx, _rx) = mpsc::unbounded(); let manager = Rc::new(MediaManager::default()); let (audio_track, video_track) = get_test_tracks(); - let peer = PeerConnection::new( - PeerId(1), - tx, - vec![], - manager, - false, - true, - false, - ) - .unwrap(); + let peer = + PeerConnection::new(PeerId(1), tx, vec![], manager, false, true, false) + .unwrap(); peer.get_offer(vec![audio_track, video_track], None) .await @@ -108,16 +87,9 @@ async fn new_with_mute_video() { let (tx, _rx) = mpsc::unbounded(); let manager = Rc::new(MediaManager::default()); let (audio_track, video_track) = get_test_tracks(); - let peer = PeerConnection::new( - PeerId(1), - tx, - vec![], - manager, - true, - false, - false, - ) - .unwrap(); + let peer = + PeerConnection::new(PeerId(1), tx, vec![], manager, true, false, false) + .unwrap(); peer.get_offer(vec![audio_track, video_track], None) .await .unwrap(); @@ -143,16 +115,9 @@ async fn add_candidates_to_answerer_before_offer() { ) .unwrap(); - let pc2 = PeerConnection::new( - PeerId(2), - tx2, - vec![], - manager, - true, - true, - false, - ) - .unwrap(); + let pc2 = + PeerConnection::new(PeerId(2), tx2, vec![], manager, true, true, false) + .unwrap(); let (audio_track, video_track) = get_test_tracks(); let offer = pc1 .get_offer(vec![audio_track, video_track], None) @@ -188,16 +153,8 @@ async fn add_candidates_to_offerer_before_answer() { .unwrap(), ); let pc2 = Rc::new( - PeerConnection::new( - PeerId(2), - tx2, - vec![], - manager, - true, - true, - false, - ) - .unwrap(), + PeerConnection::new(PeerId(2), tx2, vec![], manager, true, true, false) + .unwrap(), ); let (audio_track, video_track) = get_test_tracks(); @@ -232,16 +189,9 @@ async fn normal_exchange_of_candidates() { false, ) .unwrap(); - let peer2 = PeerConnection::new( - PeerId(2), - tx2, - vec![], - manager, - true, - true, - false, - ) - .unwrap(); + let peer2 = + PeerConnection::new(PeerId(2), tx2, vec![], manager, true, true, false) + .unwrap(); let (audio_track, video_track) = get_test_tracks(); let offer = peer1 @@ -296,16 +246,8 @@ async fn send_event_on_new_local_stream() { let manager = Rc::new(MediaManager::default()); let (audio_track, video_track) = get_test_tracks(); let id = PeerId(1); - let peer = PeerConnection::new( - id, - tx, - vec![], - manager, - true, - false, - false, - ) - .unwrap(); + let peer = PeerConnection::new(id, tx, vec![], manager, true, false, false) + .unwrap(); peer.get_offer(vec![audio_track, video_track], None) .await .unwrap(); @@ -340,16 +282,9 @@ async fn ice_connection_state_changed_is_emitted() { false, ) .unwrap(); - let peer2 = PeerConnection::new( - PeerId(2), - tx2, - vec![], - manager, - true, - true, - false, - ) - .unwrap(); + let peer2 = + PeerConnection::new(PeerId(2), tx2, vec![], manager, true, true, false) + .unwrap(); let (audio_track, video_track) = get_test_tracks(); let offer = peer1 diff --git a/src/media/peer.rs b/src/media/peer.rs index 1381d0072..f5d0dbe1f 100644 --- a/src/media/peer.rs +++ b/src/media/peer.rs @@ -226,7 +226,8 @@ impl Peer { !self.context.senders.is_empty() } - /// If 'true' is returned then all media should be relayed through TURN server. + /// If 'true' is returned then all media should be relayed through TURN + /// server. pub fn is_relay(&self) -> bool { self.context.is_relay } diff --git a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs index ec6642ddb..923b7add7 100644 --- a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs +++ b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs @@ -199,6 +199,8 @@ impl WebRtcPublishEndpoint { self.0.borrow().p2p } + /// If 'true' is returned then all media should be relayed through TURN + /// server. pub fn is_relay(&self) -> bool { self.0.borrow().is_relay } diff --git a/src/signalling/room.rs b/src/signalling/room.rs index e20526131..1c9ee2490 100644 --- a/src/signalling/room.rs +++ b/src/signalling/room.rs @@ -553,7 +553,7 @@ impl Room { &mut self, member_id: &MemberId, publish_id: WebRtcPublishId, - spec: WebRtcPublishEndpointSpec, + spec: &WebRtcPublishEndpointSpec, ) -> Result<(), RoomError> { let member = self.members.get_member(&member_id)?; @@ -1273,7 +1273,7 @@ impl Handler for Room { self.create_src_endpoint( &msg.member_id, msg.endpoint_id.into(), - endpoint, + &endpoint, )?; } } diff --git a/tests/e2e/signalling/pub_sub_signallng.rs b/tests/e2e/signalling/pub_sub_signallng.rs index 21787c71e..60265fcf4 100644 --- a/tests/e2e/signalling/pub_sub_signallng.rs +++ b/tests/e2e/signalling/pub_sub_signallng.rs @@ -1,5 +1,5 @@ use actix::{Context, System}; -use medea_client_api_proto::{Direction, Event, IceTransportPolicy}; +use medea_client_api_proto::{Direction, Event}; use crate::signalling::TestMember; @@ -30,7 +30,7 @@ fn pub_sub_video_call() { sdp_offer, tracks, ice_servers, - ice_transport_policy, + is_relay, } = &events[0] { assert_eq!(ice_servers.len(), 2); @@ -46,10 +46,7 @@ fn pub_sub_video_call() { ice_servers[1].urls[1], "turn:localhost:3478?transport=tcp".to_string() ); - assert_eq!( - ice_transport_policy, - &IceTransportPolicy::Relay - ); + assert_eq!(is_relay, &true); if sdp_offer.is_some() { is_caller = false; diff --git a/tests/specs/pub-sub-video-call.yml b/tests/specs/pub-sub-video-call.yml index e2a5ddcc9..8255280f7 100644 --- a/tests/specs/pub-sub-video-call.yml +++ b/tests/specs/pub-sub-video-call.yml @@ -10,7 +10,8 @@ spec: publish: kind: WebRtcPublishEndpoint spec: - p2p: Never + p2p: Always + is_relay: true responder: kind: Member credentials: test From 686dfe1e0c739c30d791f651a481ab63624bd1b2 Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Mon, 6 Jan 2020 15:21:23 +0300 Subject: [PATCH 09/15] Fix PRs links in CHANGELOGs --- CHANGELOG.md | 2 +- jason/CHANGELOG.md | 2 +- proto/client-api/CHANGELOG.md | 2 +- proto/control-api/CHANGELOG.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1c235315..7ce37cfc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ All user visible changes to this project will be documented in this file. This p - Auto-removing `Peer`s when `Member` disconnects ([#28]); - Filter `SetIceCandidate` messages without `candidate` ([#50](/../../pull/50)); - Send reason of closing WebSocket connection as [Close](https://tools.ietf.org/html/rfc4566#section-5.14) frame's description ([#58](/../../pull/58)); - - Send relay mode in `Event::PeerCreated` which will be used in client side's `RtcIceTransportPolicy` ([#78](/../../pull/78)). + - Send relay mode in `Event::PeerCreated` which will be used in client side's `RtcIceTransportPolicy` ([#79](/../../pull/79)). - Configuration: - `[server.control.grpc]` section to configure Control API gRPC server ([#33]); - `server.client.http.public_url` option to configure public URL of Client API HTTP server ([#33]). diff --git a/jason/CHANGELOG.md b/jason/CHANGELOG.md index 4fe058f32..a878d8b65 100644 --- a/jason/CHANGELOG.md +++ b/jason/CHANGELOG.md @@ -41,7 +41,7 @@ All user visible changes to this project will be documented in this file. This p - Ability to inject local video/audio stream into `Room` via `Room.inject_local_stream()` ([#54]); - `Room.on_failed_local_stream` callback ([#54]); - `Room.on_close` callback for WebSocket close initiated by server ([#55]); - - `RtcIceTransportPolicy` configuration ([#78](/../../pull/78)). + - `RtcIceTransportPolicy` configuration ([#79](/../../pull/79)). - RPC messaging: - Cleanup Jason state on normal (`code = 1000`) WebSocket close ([#55]). - Signalling: diff --git a/proto/client-api/CHANGELOG.md b/proto/client-api/CHANGELOG.md index f287c0d84..063b8d1b1 100644 --- a/proto/client-api/CHANGELOG.md +++ b/proto/client-api/CHANGELOG.md @@ -15,7 +15,7 @@ All user visible changes to this project will be documented in this file. This p - `Incrementable` trait ([#28]); - `CloseReason` and `CloseDescription` types ([#58](/../../pull/58)); - `AddPeerConnectionMetrics` client command with `IceConnectionState` metric ([#71](/../../pull/71)); -- `is_relay` into `Event::PeerCreated` ([#78](/../../pull/78)). +- `is_relay` into `Event::PeerCreated` ([#79](/../../pull/79)). [#28]: /../../pull/28 diff --git a/proto/control-api/CHANGELOG.md b/proto/control-api/CHANGELOG.md index 5b02355ad..780c07665 100644 --- a/proto/control-api/CHANGELOG.md +++ b/proto/control-api/CHANGELOG.md @@ -27,7 +27,7 @@ All user visible changes to this project will be documented in this file. This p - `Member`; - `WebRtcPlayEndpoint`; - `WebRtcPublishEndpoint`. - - `is_relay` field into `WebRtcPublishEndpoint` ([#78](/../../pull/78)). + - `is_relay` field into `WebRtcPublishEndpoint` ([#79](/../../pull/79)). - `Callback` service: - Callbacks ([#63]): - `OnJoin`; From 4a2d89890c8b1f56aae9eb80d676106c27cf43ae Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Mon, 6 Jan 2020 15:24:24 +0300 Subject: [PATCH 10/15] Bump medea-client-api-proto version to 0.2.0-dev --- proto/client-api/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/client-api/Cargo.toml b/proto/client-api/Cargo.toml index da0dfde74..9f24dee8e 100644 --- a/proto/client-api/Cargo.toml +++ b/proto/client-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "medea-client-api-proto" -version = "0.1.1-dev" +version = "0.2.0-dev" edition = "2018" description = "Client API protocol implementation for Medea media server" authors = ["Instrumentisto Team "] From a1f01a70885169e20cc757caf49a63f830185f01 Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Mon, 6 Jan 2020 15:30:04 +0300 Subject: [PATCH 11/15] Fix demo --- jason/demo/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/jason/demo/index.html b/jason/demo/index.html index 014dee0d7..7cf09cbf8 100644 --- a/jason/demo/index.html +++ b/jason/demo/index.html @@ -40,6 +40,7 @@ publish: { kind: 'WebRtcPublishEndpoint', p2p: 'Always', + is_relay: false, }, }; From 2a91cde11f77b4ea404627fef5f348ca68f238aa Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Tue, 14 Jan 2020 19:11:06 +0300 Subject: [PATCH 12/15] is_force_relay and add it into WebRtcPlayEndpoint too --- Cargo.lock | 436 +++++++++--------- _dev/specs/relay-pub-pub-video-call.yml | 6 +- jason/e2e-demo/js/index.js | 16 +- jason/e2e-demo/video-call.html | 7 +- jason/tests/api/room.rs | 10 +- mock/control-api/src/api/endpoint.rs | 10 +- proto/client-api/src/lib.rs | 2 +- proto/control-api/src/grpc/api.proto | 4 +- proto/control-api/src/grpc/api.rs | 95 ++-- proto/control-api/src/grpc/callback.rs | 6 +- .../control/endpoints/webrtc_play_endpoint.rs | 4 + .../endpoints/webrtc_publish_endpoint.rs | 4 +- src/media/peer.rs | 10 +- .../endpoints/webrtc/play_endpoint.rs | 9 + .../endpoints/webrtc/publish_endpoint.rs | 12 +- src/signalling/elements/member.rs | 7 +- src/signalling/peers.rs | 43 +- src/signalling/room.rs | 10 +- tests/e2e/signalling/pub_sub_signallng.rs | 4 +- tests/specs/pub-sub-video-call.yml | 3 +- 20 files changed, 385 insertions(+), 313 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0451bddd9..2a53f8af2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,7 +6,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -108,10 +108,10 @@ dependencies = [ "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -161,7 +161,7 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -287,15 +287,15 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -316,9 +316,9 @@ name = "actix-web-codegen" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -349,7 +349,7 @@ name = "aho-corasick" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -395,9 +395,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "atty" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -407,6 +408,11 @@ name = "autocfg" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "awc" version = "0.2.8" @@ -420,9 +426,9 @@ dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -431,7 +437,7 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", @@ -445,7 +451,7 @@ name = "backtrace-sys" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -485,12 +491,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "blake2b_simd" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -498,7 +504,7 @@ name = "brotli-sys" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -513,7 +519,7 @@ dependencies = [ [[package]] name = "bumpalo" -version = "2.6.0" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -540,7 +546,7 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -553,8 +559,8 @@ name = "chrono" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -564,7 +570,7 @@ version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -585,7 +591,7 @@ name = "cmake" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -596,7 +602,7 @@ dependencies = [ "ascii 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -606,7 +612,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "nom 5.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 5.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rust-ini 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde-hjson 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -621,7 +627,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -639,12 +645,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "constant_time_eq" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -768,10 +774,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -781,7 +787,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling_core 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -791,9 +797,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "derive_builder_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -802,9 +808,9 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -826,7 +832,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -836,9 +842,9 @@ name = "derive_more" version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -873,7 +879,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -919,11 +925,11 @@ name = "env_logger" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -931,7 +937,7 @@ name = "failure" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -940,9 +946,9 @@ name = "failure_derive" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -963,7 +969,7 @@ name = "float-cmp" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1049,9 +1055,9 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1075,7 +1081,7 @@ dependencies = [ "futures-macro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1089,12 +1095,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "getrandom" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1106,7 +1112,7 @@ dependencies = [ "grpcio-sys 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1114,7 +1120,7 @@ name = "grpcio-compiler" version = "0.5.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1123,7 +1129,7 @@ name = "grpcio-sys" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1170,7 +1176,7 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1205,7 +1211,7 @@ name = "humantime" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1276,10 +1282,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "js-sys" -version = "0.3.33" +version = "0.3.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1342,7 +1348,7 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1405,12 +1411,12 @@ dependencies = [ "grpcio 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "humantime-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "medea-client-api-proto 0.1.1-dev", + "medea-client-api-proto 0.2.0-dev", "medea-control-api-proto 0.1.0-dev", "medea-macro 0.2.0-dev", "mockall 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "redis 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1429,12 +1435,12 @@ dependencies = [ "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-signal 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "medea-client-api-proto" -version = "0.1.1-dev" +version = "0.2.0-dev" dependencies = [ "derive_more 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "medea-macro 0.2.0-dev", @@ -1454,7 +1460,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "grpcio 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "medea-control-api-proto 0.1.0-dev", - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1470,7 +1476,7 @@ version = "0.1.0-dev" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "grpcio 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "protoc-grpcio 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1483,18 +1489,18 @@ dependencies = [ "downcast 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "fragile 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", - "medea-client-api-proto 0.1.1-dev", + "js-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "medea-client-api-proto 0.2.0-dev", "medea-macro 0.2.0-dev", "mockall 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "tracerr 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-futures 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-test 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", "wee_alloc 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1504,15 +1510,15 @@ version = "0.2.0-dev" dependencies = [ "Inflector 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", "medea-jason 0.2.0-dev", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "memchr" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1530,7 +1536,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "mime" -version = "0.3.14" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1538,7 +1544,7 @@ name = "miniz-sys" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1623,9 +1629,9 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1634,9 +1640,9 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1659,17 +1665,17 @@ name = "nom" version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "nom" -version = "5.0.1" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lexical-core 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1680,11 +1686,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "num-integer" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1692,15 +1698,15 @@ name = "num-traits" version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1708,7 +1714,7 @@ name = "num_cpus" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1727,7 +1733,7 @@ name = "parking_lot" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1795,7 +1801,7 @@ dependencies = [ "float-cmp 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "normalize-line-endings 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1817,9 +1823,9 @@ name = "proc-macro-hack" version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1837,7 +1843,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1845,20 +1851,20 @@ dependencies = [ [[package]] name = "protobuf" -version = "2.8.1" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "protobuf-codegen" -version = "2.8.1" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "protoc" -version = "2.8.1" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1871,15 +1877,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "grpcio-compiler 0.5.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf-codegen 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "protoc 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf-codegen 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protoc 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quick-error" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1895,7 +1901,7 @@ name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1939,10 +1945,10 @@ dependencies = [ [[package]] name = "rand" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1985,7 +1991,7 @@ name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2098,18 +2104,18 @@ dependencies = [ [[package]] name = "regex" -version = "1.3.1" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2126,7 +2132,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2135,7 +2141,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2223,7 +2229,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2232,9 +2238,9 @@ name = "serde_derive" version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2263,7 +2269,7 @@ dependencies = [ "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2343,7 +2349,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "slog-scope 4.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2399,7 +2405,7 @@ name = "slog-term" version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2480,10 +2486,10 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2493,9 +2499,9 @@ name = "synstructure" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2511,7 +2517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2528,10 +2534,10 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.0.5" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2550,6 +2556,14 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "threadpool" version = "1.7.1" @@ -2872,7 +2886,7 @@ dependencies = [ [[package]] name = "url" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2897,118 +2911,118 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasi" -version = "0.7.0" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasm-bindgen" -version = "0.2.56" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.56" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bumpalo 3.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.56" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro-support 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.56" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.56" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasm-bindgen-test" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-futures 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-test-macro 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test-macro 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-webidl" -version = "0.2.56" +version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", "weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "web-sys" -version = "0.3.33" +version = "0.3.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", "sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-webidl 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-webidl 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3061,7 +3075,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3072,15 +3086,6 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "wincolor" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "winreg" version = "0.6.2" @@ -3144,23 +3149,24 @@ dependencies = [ "checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" "checksum ascii 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" -"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum awc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "5e995283278dd3bf0449e7534e77184adb1570c0de8b6a50bf7c9d01ad8db8c4" -"checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" +"checksum backtrace 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)" = "a4ed64ae6d9ebfd9893193c4b2532b1292ec97bd8271c9d7d0fa90cd78a34cba" "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" "checksum bb8 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0ac73ee3406f475415bba792942016291b87bac08839c38a032de56085a73b2c" "checksum bb8-redis 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39945a33c03edfba8c353d330b921961e2137d4fc4215331c1b2397f32acff80" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -"checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" +"checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" "checksum brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" "checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" -"checksum bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad807f2fc2bf185eeb98ff3a901bd46dc5ad58163d0fa4577ba0d25674d71708" +"checksum bumpalo 3.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb8038c1ddc0a5f73787b130f4cc75151e96ed33e417fde765eb5a81e3532f4" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" -"checksum cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "f52a465a666ca3d838ebbf08b241383421412fe7ebb463527bba275526d89f76" +"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" @@ -3171,7 +3177,7 @@ dependencies = [ "checksum console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" "checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" "checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" -"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" +"checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" "checksum copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ff9c56c9fb2a49c05ef0e431485a22400af20d33226dc0764d891d09e724127" "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" "checksum crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "bd66663db5a988098a89599d4857919b3acf7f61402e61365acfd3919857b9be" @@ -3223,7 +3229,7 @@ dependencies = [ "checksum futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0bae52d6b29cf440e298856fec3965ee6fa71b06aa7495178615953fd669e5f9" "checksum futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d66274fb76985d3c62c886d1da7ac4c0903a8c9f754e8fe0f35a6a6cc39e76" "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" -"checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" +"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" "checksum grpcio 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9ac757a85603e4f8c40a9f94be06a5ad412acab80b39b4e8895ca931b6619910" "checksum grpcio-compiler 0.5.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)" = "3c8c6f6d181ac240958853a3b95a4eac9b23816a0a922b9d30b991142938b9ff" "checksum grpcio-sys 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "7b2f22fb0327f153acccedbe91894dd0fb15bb6f202d8195665cd206af0402b0" @@ -3231,7 +3237,7 @@ dependencies = [ "checksum hashbrown 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "29fba9abe4742d586dfd0c06ae4f7e73a1c2d86b856933509b269d82cdf06e18" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" -"checksum hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f629dc602392d3ec14bfc8a09b5e644d7ffd725102b48b81e59f90f2633621d7" +"checksum hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772" "checksum hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "21ceb46a83a85e824ef93669c8b390009623863b5c195d1ba747292c0c72f94e" "checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" @@ -3244,7 +3250,7 @@ dependencies = [ "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" "checksum ipconfig 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa79fa216fbe60834a9c0737d7fcd30425b32d1c58854663e24d4c4b328ed83f" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" -"checksum js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)" = "367647c532db6f1555d7151e619540ec5f713328235b8c062c6b4f63e84adfe3" +"checksum js-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "7889c7c36282151f6bf465be4700359318aef36baa951462382eae49e9577cf9" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" @@ -3253,16 +3259,16 @@ dependencies = [ "checksum linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d262045c5b87c0861b3f004610afd0e2c851e2908d08b6c870cbb9d5f494ecd" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum lock_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed946d4529956a20f2d63ebe1b69996d5a2137c91913fe3ebbeff957f5bca7ff" -"checksum lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e57b3997725d2b60dbec1297f6c2e2957cc383db1cebd6be812163f969c7d586" +"checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" -"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" +"checksum memchr 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3197e20c7edb283f87c071ddfc7a2cca8f8e0b888c242959846a6fce03c72223" "checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" "checksum memory_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" -"checksum mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "dd1d63acd1b78403cc0c325605908475dd9b9a3acbf65ed8bcab97e27014afcf" +"checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" "checksum miniz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9e3ae51cea1576ceba0dde3d484d30e6e5b86dee0b2d412fe3a16a15c98202" "checksum miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" @@ -3275,11 +3281,11 @@ dependencies = [ "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" -"checksum nom 5.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c618b63422da4401283884e6668d39f819a106ef51f5f59b81add00075da35ca" +"checksum nom 5.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c433f4d505fe6ce7ff78523d2fa13a0b9f2690e181fc26168bcbe5ccc5d14e07" "checksum normalize-line-endings 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2e0a1a39eab95caf4f5556da9289b9e68f0aafac901b2ce80daaf020d3b733a8" -"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" +"checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -"checksum num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4" +"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" "checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" "checksum parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa7767817701cce701d5585b9c4db3cdd02086398322c1d7e8bf5094a96a2ce7" "checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" @@ -3296,18 +3302,18 @@ dependencies = [ "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" "checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" -"checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" -"checksum protobuf-codegen 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "12c6abd78435445fc86898ebbd0521a68438063d4a73e23527b7134e6bf58b4a" -"checksum protoc 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3998c4bc0af8ccbd3cc68245ee9f72663c5ae2fb78bc48ff7719aef11562edea" +"checksum proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc" +"checksum protobuf 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6686ddd96a8dbe2687b5f2a687b2cfb520854010ec480f2d74c32e7c9873d3c5" +"checksum protobuf-codegen 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6456421eecf7fc72905868cd760c3e35848ded3552e480cfe67726ed4dbd8d23" +"checksum protoc 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd83d2547a9e2c8bc6016607281b3ec7ef4871c55be6930915481d80350ab88" "checksum protoc-grpcio 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7bb9b76be44d96453f528030c03713f57fa725565036cc9d72037ad75babadf" -"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" +"checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" "checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -"checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" +"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" @@ -3324,8 +3330,8 @@ dependencies = [ "checksum redis 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03b599645e2db97724125cdff11196b56a70b21837a6e68f0e55955989e0cc" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" -"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" -"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" +"checksum regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b5508c1941e4e7cb19965abef075d35a9a8b5cdf0846f30b4050e9b55dc55e87" +"checksum regex-syntax 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e734e891f5b408a29efbf8309e656876276f49ab6a6ac208600b4419bd893d90" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum resolv-conf 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b263b4aa1b5de9ffc0054a2386f96992058bb6870aab516f8cdeb8a667d56dcb" "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" @@ -3371,14 +3377,15 @@ dependencies = [ "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" "checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -"checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" +"checksum syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4ff033220a41d1a57d8125eab57bf5263783dfdcc18688b1dacc6ce9651ef8" "checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" "checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum term 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c0863a3345e70f61d613eab32ee046ccd1bcc5f9105fe402c61fcd0c13eeb8b5" -"checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" +"checksum termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" "checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" @@ -3408,21 +3415,21 @@ dependencies = [ "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" +"checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" -"checksum wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "99de4b68939a880d530aed51289a7c7baee154e3ea8ac234b542c49da7134aaf" -"checksum wasm-bindgen-backend 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "b58e66a093a7b7571cb76409763c495b8741ac4319ac20acc2b798f6766d92ee" -"checksum wasm-bindgen-futures 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "3bf1b55e0dc85085cfab2c0c520b977afcf16ac5801ee0de8dde42a4f5649b2a" -"checksum wasm-bindgen-macro 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "a80f89daea7b0a67b11f6e9f911422ed039de9963dce00048a653b63d51194bf" -"checksum wasm-bindgen-macro-support 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "4f9dbc3734ad6cff6b76b75b7df98c06982becd0055f651465a08f769bca5c61" -"checksum wasm-bindgen-shared 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "d907984f8506b3554eab48b8efff723e764ddbf76d4cd4a3fe4196bc00c49a70" -"checksum wasm-bindgen-test 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "87d10750e72390ddfaad9420525f4e3ed565408586c859aa2bf91f8ebad65774" -"checksum wasm-bindgen-test-macro 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "5b84bb462de0772abdec0394671153f280483828f883cbaa12d71f6142196a01" -"checksum wasm-bindgen-webidl 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "f85a3825a459cf6a929d03bacb54dca37a614d43032ad1343ef2d4822972947d" -"checksum web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)" = "2fb60433d0dc12c803b9b017b3902d80c9451bab78d27bc3210bf2a7b96593f1" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +"checksum wasm-bindgen 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "5205e9afdf42282b192e2310a5b463a6d1c1d774e30dc3c791ac37ab42d2616c" +"checksum wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "11cdb95816290b525b32587d76419facd99662a07e59d3cdb560488a819d9a45" +"checksum wasm-bindgen-futures 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8bbdd49e3e28b40dec6a9ba8d17798245ce32b019513a845369c641b275135d9" +"checksum wasm-bindgen-macro 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "574094772ce6921576fb6f2e3f7497b8a76273b6db092be18fc48a082de09dc3" +"checksum wasm-bindgen-macro-support 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "e85031354f25eaebe78bb7db1c3d86140312a911a106b2e29f9cc440ce3e7668" +"checksum wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e7e61fc929f4c0dddb748b102ebf9f632e2b8d739f2016542b4de2965a9601" +"checksum wasm-bindgen-test 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "98fd0ec352c44d1726b6c2bec524612b1c81e34a7d858f597a6c71f8e018c82e" +"checksum wasm-bindgen-test-macro 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "97837a6e83ab24a4b3a38d44a257e13335b54f4b4548b2c9d71edd0bf570cb4f" +"checksum wasm-bindgen-webidl 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "ef012a0d93fc0432df126a8eaf547b2dce25a8ce9212e1d3cbeef5c11157975d" +"checksum web-sys 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "aaf97caf6aa8c2b1dac90faf0db529d9d63c93846cca4911856f78a83cebf53b" "checksum wee_alloc 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" "checksum weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bb43f70885151e629e2a19ce9e50bd730fd436cfd4b666894c9ce4de9141164" "checksum widestring 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effc0e4ff8085673ea7b9b2e3c73f6bd4d118810c9009ed8f1e16bd96c331db6" @@ -3430,9 +3437,8 @@ dependencies = [ "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" +"checksum winapi-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" "checksum winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" "checksum winutil 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7daf138b6b14196e3830a588acf1e86966c694d3e8fb026fb105b8b5dca07e6e" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/_dev/specs/relay-pub-pub-video-call.yml b/_dev/specs/relay-pub-pub-video-call.yml index fe43c0d62..7cda9d719 100644 --- a/_dev/specs/relay-pub-pub-video-call.yml +++ b/_dev/specs/relay-pub-pub-video-call.yml @@ -13,11 +13,12 @@ spec: kind: WebRtcPublishEndpoint spec: p2p: Always - is_relay: true + is_force_relay: true play-responder: kind: WebRtcPlayEndpoint spec: src: "local://relay-pub-pub-video-call/responder/publish" + is_force_relay: true responder: kind: Member credentials: test @@ -29,9 +30,10 @@ spec: kind: WebRtcPublishEndpoint spec: p2p: Always - is_relay: true + is_force_relay: true play-caller: kind: WebRtcPlayEndpoint spec: src: "local://relay-pub-pub-video-call/caller/publish" + is_force_relay: true diff --git a/jason/e2e-demo/js/index.js b/jason/e2e-demo/js/index.js index fb1461585..c01bba95a 100644 --- a/jason/e2e-demo/js/index.js +++ b/jason/e2e-demo/js/index.js @@ -18,7 +18,7 @@ async function createRoom(roomId, memberId) { publish: { kind: 'WebRtcPublishEndpoint', p2p: 'Always', - is_relay: false + is_force_relay: false }, }, on_join: "grpc://127.0.0.1:9099", @@ -38,7 +38,7 @@ async function createMember(roomId, memberId) { publish: { kind: 'WebRtcPublishEndpoint', p2p: 'Always', - is_relay: false + is_force_relay: false } }; @@ -136,21 +136,21 @@ const controlDebugWindows = { let memberId = container.getElementsByClassName('control-debug__id_member')[0].value; let endpointId = container.getElementsByClassName('control-debug__id_endpoint')[0].value; let endpointType = container.getElementsByClassName('control-debug__endpoint-type')[0].value; - switch (endpointType) { - case 'WebRtcPublishEndpoint': + if (endpointType === 'WebRtcPublishEndpoint') { let p2pMode = container.getElementsByClassName('webrtc-publish-endpoint-spec__p2p')[0].value; - let isRelay = container.getElementsByClassName('webrtc-publish-endpoint-spec__is-relay')[0].value === 'true'; + let isForceRelay = container.getElementsByClassName('webrtc-publish-endpoint-spec__is-force-relay')[0].value === 'true'; await controlApi.createEndpoint(roomId, memberId, endpointId, { kind: endpointType, p2p: p2pMode, - is_relay: isRelay, + is_force_relay: isForceRelay, }); - break; - case 'WebRtcPlayEndpoint': + } else if (endpointType === 'WebRtcPlayEndpoint') { let source = container.getElementsByClassName('webrtc-play-endpoint-spec__src')[0].value; + let isForceRelay = container.getElementsByClassName('webrtc-play-endpoint-spec__is-force-relay')[0].value === 'true'; await controlApi.createEndpoint(roomId, memberId, endpointId, { kind: endpointType, src: source, + is_force_relay: isForceRelay, }); } }) diff --git a/jason/e2e-demo/video-call.html b/jason/e2e-demo/video-call.html index 69b9962b4..313a75ba4 100644 --- a/jason/e2e-demo/video-call.html +++ b/jason/e2e-demo/video-call.html @@ -260,6 +260,11 @@
+ Is relay: +
@@ -270,7 +275,7 @@ Is relay: - diff --git a/jason/tests/api/room.rs b/jason/tests/api/room.rs index f0b5b1118..f49fa16a9 100644 --- a/jason/tests/api/room.rs +++ b/jason/tests/api/room.rs @@ -115,7 +115,7 @@ fn get_test_room_and_new_peer( _peer_events_sender: &mpsc::UnboundedSender, enabled_audio: &bool, enabled_video: &bool, - _is_relay: &bool| { + _is_force_relay: &bool| { *id == PeerId(1) && *enabled_audio == with_enabled_audio && *enabled_video == with_enabled_video @@ -143,7 +143,7 @@ async fn mute_audio_room_before_init_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - is_relay: false, + is_force_relay: false, }) .unwrap(); @@ -166,7 +166,7 @@ async fn mute_video_room_before_init_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - is_relay: false, + is_force_relay: false, }) .unwrap(); @@ -218,7 +218,7 @@ async fn error_inject_invalid_local_stream_into_new_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - is_relay: false, + is_force_relay: false, }) .unwrap(); @@ -291,7 +291,7 @@ async fn error_get_local_stream_on_new_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - is_relay: false, + is_force_relay: false, }) .unwrap(); diff --git a/mock/control-api/src/api/endpoint.rs b/mock/control-api/src/api/endpoint.rs index c459e6948..47b0168d5 100644 --- a/mock/control-api/src/api/endpoint.rs +++ b/mock/control-api/src/api/endpoint.rs @@ -50,7 +50,7 @@ pub struct WebRtcPublishEndpoint { p2p: P2pMode, /// If 'true' then all media will be relayed through TURN server. - is_relay: bool, + is_force_relay: bool, } impl WebRtcPublishEndpoint { @@ -61,7 +61,7 @@ impl WebRtcPublishEndpoint { let mut proto = WebRtcPublishEndpointProto::new(); proto.set_id(id); proto.set_p2p(self.p2p.into()); - proto.set_is_relay(self.is_relay); + proto.set_is_force_relay(self.is_force_relay); proto } } @@ -71,7 +71,7 @@ impl From for WebRtcPublishEndpoint { Self { id: proto.take_id(), p2p: proto.get_p2p().into(), - is_relay: proto.get_is_relay(), + is_force_relay: proto.get_is_force_relay(), } } } @@ -88,6 +88,9 @@ pub struct WebRtcPlayEndpoint { /// URI in format `local://{room_id}/{member_id}/{endpoint_id}` pointing to /// [`WebRtcPublishEndpoint`] which this [`WebRtcPlayEndpoint`] plays. src: String, + + /// If 'true' then all media will be relayed through TURN server. + is_force_relay: bool, } impl WebRtcPlayEndpoint { @@ -107,6 +110,7 @@ impl From for WebRtcPlayEndpoint { Self { id: proto.take_id(), src: proto.take_src(), + is_force_relay: proto.get_is_force_relay(), } } } diff --git a/proto/client-api/src/lib.rs b/proto/client-api/src/lib.rs index f3d931160..65981e24e 100644 --- a/proto/client-api/src/lib.rs +++ b/proto/client-api/src/lib.rs @@ -186,7 +186,7 @@ pub enum Event { sdp_offer: Option, tracks: Vec, ice_servers: Vec, - is_relay: bool, + is_force_relay: bool, }, /// Media Server notifies Web Client about necessity to apply specified SDP /// Answer to Web Client's RTCPeerConnection. diff --git a/proto/control-api/src/grpc/api.proto b/proto/control-api/src/grpc/api.proto index 6180b9972..cecfe4e78 100644 --- a/proto/control-api/src/grpc/api.proto +++ b/proto/control-api/src/grpc/api.proto @@ -164,7 +164,7 @@ message WebRtcPublishEndpoint { // Callback which fires when a client stops publishing media data. string on_stop = 4; // If 'true' then all media will be relayed through TURN server. - bool is_relay = 5; + bool is_force_relay = 5; // P2P mode of WebRTC interaction. enum P2P { @@ -190,4 +190,6 @@ message WebRtcPlayEndpoint { // Callback which fires when a client stops playing media data // from the source. string on_stop = 4; + // If 'true' then all media will be relayed through TURN server. + bool is_force_relay = 5; } diff --git a/proto/control-api/src/grpc/api.rs b/proto/control-api/src/grpc/api.rs index a12f4abd4..6a9820f3d 100644 --- a/proto/control-api/src/grpc/api.rs +++ b/proto/control-api/src/grpc/api.rs @@ -1,7 +1,7 @@ -// This file is generated by rust-protobuf 2.8.1. Do not edit +// This file is generated by rust-protobuf 2.10.1. Do not edit // @generated -// https://github.com/Manishearth/rust-clippy/issues/702 +// https://github.com/rust-lang/rust-clippy/issues/702 #![allow(unknown_lints)] #![allow(clippy::all)] @@ -24,7 +24,7 @@ use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_1; +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_10_1; #[derive(PartialEq,Clone,Default)] pub struct CreateRequest { @@ -3244,7 +3244,7 @@ pub struct WebRtcPublishEndpoint { pub p2p: WebRtcPublishEndpoint_P2P, pub on_start: ::std::string::String, pub on_stop: ::std::string::String, - pub is_relay: bool, + pub is_force_relay: bool, // special fields pub unknown_fields: ::protobuf::UnknownFields, pub cached_size: ::protobuf::CachedSize, @@ -3354,19 +3354,19 @@ impl WebRtcPublishEndpoint { ::std::mem::replace(&mut self.on_stop, ::std::string::String::new()) } - // bool is_relay = 5; + // bool is_force_relay = 5; - pub fn get_is_relay(&self) -> bool { - self.is_relay + pub fn get_is_force_relay(&self) -> bool { + self.is_force_relay } - pub fn clear_is_relay(&mut self) { - self.is_relay = false; + pub fn clear_is_force_relay(&mut self) { + self.is_force_relay = false; } // Param is passed by value, moved - pub fn set_is_relay(&mut self, v: bool) { - self.is_relay = v; + pub fn set_is_force_relay(&mut self, v: bool) { + self.is_force_relay = v; } } @@ -3396,7 +3396,7 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); } let tmp = is.read_bool()?; - self.is_relay = tmp; + self.is_force_relay = tmp; }, _ => { ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; @@ -3422,7 +3422,7 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { if !self.on_stop.is_empty() { my_size += ::protobuf::rt::string_size(4, &self.on_stop); } - if self.is_relay != false { + if self.is_force_relay != false { my_size += 2; } my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -3443,8 +3443,8 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { if !self.on_stop.is_empty() { os.write_string(4, &self.on_stop)?; } - if self.is_relay != false { - os.write_bool(5, self.is_relay)?; + if self.is_force_relay != false { + os.write_bool(5, self.is_force_relay)?; } os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) @@ -3509,9 +3509,9 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { |m: &mut WebRtcPublishEndpoint| { &mut m.on_stop }, )); fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "is_relay", - |m: &WebRtcPublishEndpoint| { &m.is_relay }, - |m: &mut WebRtcPublishEndpoint| { &mut m.is_relay }, + "is_force_relay", + |m: &WebRtcPublishEndpoint| { &m.is_force_relay }, + |m: &mut WebRtcPublishEndpoint| { &mut m.is_force_relay }, )); ::protobuf::reflect::MessageDescriptor::new::( "WebRtcPublishEndpoint", @@ -3539,7 +3539,7 @@ impl ::protobuf::Clear for WebRtcPublishEndpoint { self.p2p = WebRtcPublishEndpoint_P2P::NEVER; self.on_start.clear(); self.on_stop.clear(); - self.is_relay = false; + self.is_force_relay = false; self.unknown_fields.clear(); } } @@ -3621,6 +3621,7 @@ pub struct WebRtcPlayEndpoint { pub src: ::std::string::String, pub on_start: ::std::string::String, pub on_stop: ::std::string::String, + pub is_force_relay: bool, // special fields pub unknown_fields: ::protobuf::UnknownFields, pub cached_size: ::protobuf::CachedSize, @@ -3740,6 +3741,21 @@ impl WebRtcPlayEndpoint { pub fn take_on_stop(&mut self) -> ::std::string::String { ::std::mem::replace(&mut self.on_stop, ::std::string::String::new()) } + + // bool is_force_relay = 5; + + + pub fn get_is_force_relay(&self) -> bool { + self.is_force_relay + } + pub fn clear_is_force_relay(&mut self) { + self.is_force_relay = false; + } + + // Param is passed by value, moved + pub fn set_is_force_relay(&mut self, v: bool) { + self.is_force_relay = v; + } } impl ::protobuf::Message for WebRtcPlayEndpoint { @@ -3763,6 +3779,13 @@ impl ::protobuf::Message for WebRtcPlayEndpoint { 4 => { ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.on_stop)?; }, + 5 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.is_force_relay = tmp; + }, _ => { ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, @@ -3787,6 +3810,9 @@ impl ::protobuf::Message for WebRtcPlayEndpoint { if !self.on_stop.is_empty() { my_size += ::protobuf::rt::string_size(4, &self.on_stop); } + if self.is_force_relay != false { + my_size += 2; + } my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); my_size @@ -3805,6 +3831,9 @@ impl ::protobuf::Message for WebRtcPlayEndpoint { if !self.on_stop.is_empty() { os.write_string(4, &self.on_stop)?; } + if self.is_force_relay != false { + os.write_bool(5, self.is_force_relay)?; + } os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3867,6 +3896,11 @@ impl ::protobuf::Message for WebRtcPlayEndpoint { |m: &WebRtcPlayEndpoint| { &m.on_stop }, |m: &mut WebRtcPlayEndpoint| { &mut m.on_stop }, )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "is_force_relay", + |m: &WebRtcPlayEndpoint| { &m.is_force_relay }, + |m: &mut WebRtcPlayEndpoint| { &mut m.is_force_relay }, + )); ::protobuf::reflect::MessageDescriptor::new::( "WebRtcPlayEndpoint", fields, @@ -3893,6 +3927,7 @@ impl ::protobuf::Clear for WebRtcPlayEndpoint { self.src.clear(); self.on_start.clear(); self.on_stop.clear(); + self.is_force_relay = false; self.unknown_fields.clear(); } } @@ -3951,19 +3986,21 @@ static file_descriptor_proto_data: &'static [u8] = b"\ \x20\x01(\x0b2\x15.medea.Member.ElementR\x05value:\x028\x01\x1a\x8c\x01\ \n\x07Element\x12<\n\x0bwebrtc_play\x18\x01\x20\x01(\x0b2\x19.medea.WebR\ tcPlayEndpointH\0R\nwebrtcPlay\x12=\n\nwebrtc_pub\x18\x02\x20\x01(\x0b2\ - \x1c.medea.WebRtcPublishEndpointH\0R\twebrtcPubB\x04\n\x02el\"\xd9\x01\n\ + \x1c.medea.WebRtcPublishEndpointH\0R\twebrtcPubB\x04\n\x02el\"\xe4\x01\n\ \x15WebRtcPublishEndpoint\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x122\ \n\x03p2p\x18\x02\x20\x01(\x0e2\x20.medea.WebRtcPublishEndpoint.P2PR\x03\ p2p\x12\x19\n\x08on_start\x18\x03\x20\x01(\tR\x07onStart\x12\x17\n\x07on\ - _stop\x18\x04\x20\x01(\tR\x06onStop\x12\x19\n\x08is_relay\x18\x05\x20\ - \x01(\x08R\x07isRelay\"-\n\x03P2P\x12\t\n\x05NEVER\x10\0\x12\x0f\n\x0bIF\ - _POSSIBLE\x10\x01\x12\n\n\x06ALWAYS\x10\x02\"j\n\x12WebRtcPlayEndpoint\ - \x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x10\n\x03src\x18\x02\x20\ - \x01(\tR\x03src\x12\x19\n\x08on_start\x18\x03\x20\x01(\tR\x07onStart\x12\ - \x17\n\x07on_stop\x18\x04\x20\x01(\tR\x06onStop2\x9d\x01\n\nControlApi\ - \x125\n\x06Create\x12\x14.medea.CreateRequest\x1a\x15.medea.CreateRespon\ - se\x12+\n\x06Delete\x12\x10.medea.IdRequest\x1a\x0f.medea.Response\x12+\ - \n\x03Get\x12\x10.medea.IdRequest\x1a\x12.medea.GetResponseb\x06proto3\ + _stop\x18\x04\x20\x01(\tR\x06onStop\x12$\n\x0eis_force_relay\x18\x05\x20\ + \x01(\x08R\x0cisForceRelay\"-\n\x03P2P\x12\t\n\x05NEVER\x10\0\x12\x0f\n\ + \x0bIF_POSSIBLE\x10\x01\x12\n\n\x06ALWAYS\x10\x02\"\x90\x01\n\x12WebRtcP\ + layEndpoint\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x10\n\x03src\ + \x18\x02\x20\x01(\tR\x03src\x12\x19\n\x08on_start\x18\x03\x20\x01(\tR\ + \x07onStart\x12\x17\n\x07on_stop\x18\x04\x20\x01(\tR\x06onStop\x12$\n\ + \x0eis_force_relay\x18\x05\x20\x01(\x08R\x0cisForceRelay2\x9d\x01\n\nCon\ + trolApi\x125\n\x06Create\x12\x14.medea.CreateRequest\x1a\x15.medea.Creat\ + eResponse\x12+\n\x06Delete\x12\x10.medea.IdRequest\x1a\x0f.medea.Respons\ + e\x12+\n\x03Get\x12\x10.medea.IdRequest\x1a\x12.medea.GetResponseb\x06pr\ + oto3\ "; static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { diff --git a/proto/control-api/src/grpc/callback.rs b/proto/control-api/src/grpc/callback.rs index c46195a22..764fcf226 100644 --- a/proto/control-api/src/grpc/callback.rs +++ b/proto/control-api/src/grpc/callback.rs @@ -1,7 +1,7 @@ -// This file is generated by rust-protobuf 2.8.1. Do not edit +// This file is generated by rust-protobuf 2.10.1. Do not edit // @generated -// https://github.com/Manishearth/rust-clippy/issues/702 +// https://github.com/rust-lang/rust-clippy/issues/702 #![allow(unknown_lints)] #![allow(clippy::all)] @@ -24,7 +24,7 @@ use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_8_1; +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_10_1; #[derive(PartialEq,Clone,Default)] pub struct Request { diff --git a/src/api/control/endpoints/webrtc_play_endpoint.rs b/src/api/control/endpoints/webrtc_play_endpoint.rs index 23f87c119..7126f5e9c 100644 --- a/src/api/control/endpoints/webrtc_play_endpoint.rs +++ b/src/api/control/endpoints/webrtc_play_endpoint.rs @@ -22,6 +22,9 @@ pub struct WebRtcPlayId(String); pub struct WebRtcPlayEndpoint { /// Source URI in format `local://{room_id}/{member_id}/{endpoint_id}`. pub src: SrcUri, + + #[serde(default)] + pub is_force_relay: bool, } impl TryFrom<&WebRtcPlayEndpointProto> for WebRtcPlayEndpoint { @@ -30,6 +33,7 @@ impl TryFrom<&WebRtcPlayEndpointProto> for WebRtcPlayEndpoint { fn try_from(value: &WebRtcPlayEndpointProto) -> Result { Ok(Self { src: SrcUri::try_from(value.get_src().to_owned())?, + is_force_relay: value.get_is_force_relay(), }) } } diff --git a/src/api/control/endpoints/webrtc_publish_endpoint.rs b/src/api/control/endpoints/webrtc_publish_endpoint.rs index 4a85c453e..d5556515b 100644 --- a/src/api/control/endpoints/webrtc_publish_endpoint.rs +++ b/src/api/control/endpoints/webrtc_publish_endpoint.rs @@ -58,14 +58,14 @@ pub struct WebRtcPublishEndpoint { /// If 'true' then all media will be relayed through TURN server. #[serde(default)] - pub is_relay: bool, + pub is_force_relay: bool, } impl From<&WebRtcPublishEndpointProto> for WebRtcPublishEndpoint { fn from(value: &WebRtcPublishEndpointProto) -> Self { Self { p2p: P2pMode::from(value.get_p2p()), - is_relay: value.get_is_relay(), + is_force_relay: value.get_is_force_relay(), } } } diff --git a/src/media/peer.rs b/src/media/peer.rs index f5d0dbe1f..ce4481f7f 100644 --- a/src/media/peer.rs +++ b/src/media/peer.rs @@ -70,7 +70,7 @@ impl PeerError { #[enum_delegate(pub fn member_id(&self) -> MemberId)] #[enum_delegate(pub fn partner_peer_id(&self) -> Id)] #[enum_delegate(pub fn partner_member_id(&self) -> MemberId)] -#[enum_delegate(pub fn is_relay(&self) -> bool)] +#[enum_delegate(pub fn is_force_relay(&self) -> bool)] #[derive(Debug)] pub enum PeerStateMachine { New(Peer), @@ -152,7 +152,7 @@ pub struct Context { sdp_answer: Option, receivers: HashMap>, senders: HashMap>, - is_relay: bool, + is_force_relay: bool, } /// [RTCPeerConnection] representation. @@ -228,8 +228,8 @@ impl Peer { /// If 'true' is returned then all media should be relayed through TURN /// server. - pub fn is_relay(&self) -> bool { - self.context.is_relay + pub fn is_force_relay(&self) -> bool { + self.context.is_force_relay } } @@ -253,7 +253,7 @@ impl Peer { sdp_answer: None, receivers: HashMap::new(), senders: HashMap::new(), - is_relay, + is_force_relay: is_relay, }; Self { context, diff --git a/src/signalling/elements/endpoints/webrtc/play_endpoint.rs b/src/signalling/elements/endpoints/webrtc/play_endpoint.rs index ad61a0bc7..0b64cbdeb 100644 --- a/src/signalling/elements/endpoints/webrtc/play_endpoint.rs +++ b/src/signalling/elements/endpoints/webrtc/play_endpoint.rs @@ -47,6 +47,8 @@ struct WebRtcPlayEndpointInner { /// In future this may be used for removing [`WebRtcPlayEndpoint`] /// and related peer. peer_id: Option, + + is_force_relay: bool, } impl WebRtcPlayEndpointInner { @@ -100,6 +102,7 @@ impl WebRtcPlayEndpoint { src_uri: SrcUri, publisher: WeakWebRtcPublishEndpoint, owner: WeakMember, + is_force_relay: bool, ) -> Self { Self(Rc::new(RefCell::new(WebRtcPlayEndpointInner { id, @@ -107,6 +110,7 @@ impl WebRtcPlayEndpoint { src: publisher, owner, peer_id: None, + is_force_relay, }))) } @@ -159,6 +163,10 @@ impl WebRtcPlayEndpoint { self.0.borrow().id.clone() } + pub fn is_force_relay(&self) -> bool { + self.0.borrow().is_force_relay + } + /// Downgrades [`WebRtcPlayEndpoint`] to [`WeakWebRtcPlayEndpoint`] weak /// pointer. pub fn downgrade(&self) -> WeakWebRtcPlayEndpoint { @@ -201,6 +209,7 @@ impl Into for WebRtcPlayEndpoint { let mut play = WebRtcPlayEndpointProto::new(); play.set_src(self.src_uri().to_string()); play.set_id(self.id().to_string()); + play.set_is_force_relay(self.is_force_relay()); element.set_webrtc_play(play); element diff --git a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs index 923b7add7..4ddb82b52 100644 --- a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs +++ b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs @@ -33,7 +33,7 @@ struct WebRtcPublishEndpointInner { p2p: P2pMode, /// If 'true' then all media will be relayed through TURN server. - is_relay: bool, + is_force_relay: bool, /// All sinks of this [`WebRtcPublishEndpoint`]. sinks: Vec, @@ -116,12 +116,12 @@ impl WebRtcPublishEndpoint { id: Id, p2p: P2pMode, owner: WeakMember, - is_relay: bool, + is_force_relay: bool, ) -> Self { Self(Rc::new(RefCell::new(WebRtcPublishEndpointInner { id, p2p, - is_relay, + is_force_relay, sinks: Vec::new(), owner, peer_ids: HashSet::new(), @@ -201,8 +201,8 @@ impl WebRtcPublishEndpoint { /// If 'true' is returned then all media should be relayed through TURN /// server. - pub fn is_relay(&self) -> bool { - self.0.borrow().is_relay + pub fn is_force_relay(&self) -> bool { + self.0.borrow().is_force_relay } /// Downgrades [`WebRtcPublishEndpoint`] to weak pointer @@ -247,7 +247,7 @@ impl Into for WebRtcPublishEndpoint { let mut publish = WebRtcPublishEndpointProto::new(); publish.set_p2p(self.p2p().into()); publish.set_id(self.id().to_string()); - publish.set_is_relay(self.is_relay()); + publish.set_is_force_relay(self.is_force_relay()); element.set_webrtc_pub(publish); element diff --git a/src/signalling/elements/member.rs b/src/signalling/elements/member.rs index 715a56649..a23cfb3b2 100644 --- a/src/signalling/elements/member.rs +++ b/src/signalling/elements/member.rs @@ -192,6 +192,7 @@ impl Member { spec_play_endpoint.src.clone(), publisher.downgrade(), this_member.downgrade(), + spec_play_endpoint.is_force_relay, ); self.insert_sink(new_play_endpoint.clone()); @@ -203,7 +204,7 @@ impl Member { new_publish_id, publisher_endpoint.p2p, publisher_member.downgrade(), - publisher_endpoint.is_relay, + publisher_endpoint.is_force_relay, ); let new_self_play = WebRtcPlayEndpoint::new( @@ -211,6 +212,7 @@ impl Member { spec_play_endpoint.src.clone(), new_publish.downgrade(), this_member.downgrade(), + spec_play_endpoint.is_force_relay, ); new_publish.add_sink(new_self_play.downgrade()); @@ -231,7 +233,7 @@ impl Member { endpoint_id, e.p2p, this_member.downgrade(), - e.is_relay, + e.is_force_relay, )); }); @@ -378,6 +380,7 @@ impl Member { spec.src, src.downgrade(), member.downgrade(), + spec.is_force_relay, ); src.add_sink(sink.downgrade()); diff --git a/src/signalling/peers.rs b/src/signalling/peers.rs index a8417fdef..169c5deb8 100644 --- a/src/signalling/peers.rs +++ b/src/signalling/peers.rs @@ -16,9 +16,8 @@ use crate::{ log::prelude::*, media::{New, Peer, PeerStateMachine}, signalling::{ - elements::{ - endpoints::webrtc::{WebRtcPlayEndpoint, WebRtcPublishEndpoint}, - Member, + elements::endpoints::webrtc::{ + WebRtcPlayEndpoint, WebRtcPublishEndpoint, }, room::RoomError, }, @@ -81,33 +80,32 @@ impl PeerRepository { /// Creates interconnected [`Peer`]s for provided [`Member`]s. pub fn create_peers( &mut self, - first_member: &Member, - second_member: &Member, - is_relay: bool, + src: &WebRtcPublishEndpoint, + sink: &WebRtcPlayEndpoint, ) -> (Peer, Peer) { - let first_member_id = first_member.id(); - let second_member_id = second_member.id(); + let src_member_id = src.owner().id(); + let sink_member_id = sink.owner().id(); debug!( "Created peer between {} and {}.", - first_member_id, second_member_id + src_member_id, sink_member_id ); - let first_peer_id = self.peers_count.next_id(); - let second_peer_id = self.peers_count.next_id(); + let src_peer_id = self.peers_count.next_id(); + let sink_peer_id = self.peers_count.next_id(); let first_peer = Peer::new( - first_peer_id, - first_member_id.clone(), - second_peer_id, - second_member_id.clone(), - is_relay, + src_peer_id, + src_member_id.clone(), + sink_peer_id, + sink_member_id.clone(), + src.is_force_relay(), ); let second_peer = Peer::new( - second_peer_id, - second_member_id, - first_peer_id, - first_member_id, - is_relay, + sink_peer_id, + sink_member_id, + src_peer_id, + src_member_id, + sink.is_force_relay(), ); (first_peer, second_peer) @@ -313,8 +311,7 @@ impl PeerRepository { self.add_peer(src_peer); self.add_peer(sink_peer); } else { - let (mut src_peer, mut sink_peer) = - self.create_peers(&src_owner, &sink_owner, src.is_relay()); + let (mut src_peer, mut sink_peer) = self.create_peers(&src, &sink); src_peer.add_publisher(&mut sink_peer, self.get_tracks_counter()); diff --git a/src/signalling/room.rs b/src/signalling/room.rs index 1c9ee2490..19927eb95 100644 --- a/src/signalling/room.rs +++ b/src/signalling/room.rs @@ -248,7 +248,7 @@ impl Room { sdp_offer: None, tracks: sender.tracks(), ice_servers, - is_relay: sender.is_relay(), + is_force_relay: sender.is_force_relay(), }; self.peers.add_peer(sender); Ok(Box::new(wrap_future( @@ -574,7 +574,7 @@ impl Room { String::from(play_id).into(), spec.p2p, member.downgrade(), - spec.is_relay, + spec.is_force_relay, ); debug!( @@ -634,6 +634,7 @@ impl Room { spec.src, src.downgrade(), member.downgrade(), + spec.is_force_relay, ); src.add_sink(sink.downgrade()); @@ -685,7 +686,7 @@ impl Room { id.clone(), publish.p2p, signalling_member.downgrade(), - publish.is_relay, + publish.is_force_relay, ); signalling_member.insert_src(signalling_publish); } @@ -708,6 +709,7 @@ impl Room { play.src.clone(), src.downgrade(), signalling_member.downgrade(), + play.is_force_relay, ); signalling_member.insert_sink(sink); @@ -819,7 +821,7 @@ impl CommandHandler for Room { sdp_offer: Some(sdp_offer), tracks: to_peer.tracks(), ice_servers, - is_relay: to_peer.is_relay(), + is_force_relay: to_peer.is_force_relay(), }; self.peers.add_peer(from_peer); diff --git a/tests/e2e/signalling/pub_sub_signallng.rs b/tests/e2e/signalling/pub_sub_signallng.rs index 60265fcf4..e7f8b4971 100644 --- a/tests/e2e/signalling/pub_sub_signallng.rs +++ b/tests/e2e/signalling/pub_sub_signallng.rs @@ -30,7 +30,7 @@ fn pub_sub_video_call() { sdp_offer, tracks, ice_servers, - is_relay, + is_force_relay, } = &events[0] { assert_eq!(ice_servers.len(), 2); @@ -46,7 +46,7 @@ fn pub_sub_video_call() { ice_servers[1].urls[1], "turn:localhost:3478?transport=tcp".to_string() ); - assert_eq!(is_relay, &true); + assert_eq!(is_force_relay, &true); if sdp_offer.is_some() { is_caller = false; diff --git a/tests/specs/pub-sub-video-call.yml b/tests/specs/pub-sub-video-call.yml index 8255280f7..e4e7d6c62 100644 --- a/tests/specs/pub-sub-video-call.yml +++ b/tests/specs/pub-sub-video-call.yml @@ -11,7 +11,7 @@ spec: kind: WebRtcPublishEndpoint spec: p2p: Always - is_relay: true + is_force_relay: true responder: kind: Member credentials: test @@ -21,3 +21,4 @@ spec: kind: WebRtcPlayEndpoint spec: src: "local://pub-sub-video-call/caller/publish" + is_force_relay: true From c63ec7d61eba46c691eb3890f443858b184e3d5e Mon Sep 17 00:00:00 2001 From: Semen Evdokimov Date: Thu, 16 Jan 2020 16:58:52 +0300 Subject: [PATCH 13/15] Fix CHANGELOG --- proto/client-api/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/proto/client-api/CHANGELOG.md b/proto/client-api/CHANGELOG.md index b3f4e3723..6cf1dc1bd 100644 --- a/proto/client-api/CHANGELOG.md +++ b/proto/client-api/CHANGELOG.md @@ -25,7 +25,6 @@ All user visible changes to this project will be documented in this file. This p - `AddPeerConnectionMetrics` client command with `IceConnectionState` metric ([#71](/../../pull/71)); - `RpcSettings` server message ([#75](/../../pull/75)); - `is_relay` into `Event::PeerCreated` ([#79](/../../pull/79)). ->>>>>>> master [#28]: /../../pull/28 From a36d5e892c3920c0046822b83405981f25ea05e1 Mon Sep 17 00:00:00 2001 From: alexlapa Date: Fri, 17 Jan 2020 10:34:52 +0200 Subject: [PATCH 14/15] some fixes [run ci] --- Cargo.lock | 66 +++++++++---------- docs/rfc/0001-control-api.md | 4 +- docs/rfc/0002-webrc-client-api.md | 10 +-- jason/demo/index.html | 2 +- jason/src/api/room.rs | 4 +- jason/src/peer/conn.rs | 4 +- jason/src/peer/mod.rs | 4 +- jason/src/peer/repo.rs | 6 +- proto/client-api/CHANGELOG.md | 2 +- proto/control-api/CHANGELOG.md | 2 +- src/media/peer.rs | 4 +- .../endpoints/webrtc/play_endpoint.rs | 1 + 12 files changed, 55 insertions(+), 54 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c6a738f1..9452be76f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -192,7 +192,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -244,7 +244,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -316,7 +316,7 @@ name = "actix-web-codegen" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -617,7 +617,7 @@ dependencies = [ "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde-hjson 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -774,7 +774,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "ident_case 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -797,7 +797,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "derive_builder_core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -808,7 +808,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "darling 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -842,7 +842,7 @@ name = "derive_more" version = "0.99.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -946,7 +946,7 @@ name = "failure_derive" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1055,7 +1055,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1434,7 +1434,7 @@ dependencies = [ "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-signal 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1510,7 +1510,7 @@ version = "0.2.0-dev" dependencies = [ "Inflector 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", "medea-jason 0.2.0-dev", - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1629,7 +1629,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1640,7 +1640,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1711,7 +1711,7 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1823,7 +1823,7 @@ name = "proc-macro-hack" version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1843,7 +1843,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1901,7 +1901,7 @@ name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2238,7 +2238,7 @@ name = "serde_derive" version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2489,7 +2489,7 @@ name = "syn" version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2499,7 +2499,7 @@ name = "synstructure" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2569,7 +2569,7 @@ name = "threadpool" version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2590,7 +2590,7 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2663,7 +2663,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2720,7 +2720,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2769,7 +2769,7 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2933,7 +2933,7 @@ dependencies = [ "bumpalo 3.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-shared 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2964,7 +2964,7 @@ name = "wasm-bindgen-macro-support" version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2994,7 +2994,7 @@ name = "wasm-bindgen-test-macro" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3006,7 +3006,7 @@ dependencies = [ "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-backend 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3286,7 +3286,7 @@ dependencies = [ "checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" "checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" -"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" +"checksum num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" "checksum parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa7767817701cce701d5585b9c4db3cdd02086398322c1d7e8bf5094a96a2ce7" "checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" "checksum parking_lot_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cb88cb1cb3790baa6776844f968fea3be44956cf184fa1be5a03341f5491278c" @@ -3302,7 +3302,7 @@ dependencies = [ "checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" "checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -"checksum proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc" +"checksum proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3acb317c6ff86a4e579dfa00fc5e6cca91ecbb4e7eb2df0468805b674eb88548" "checksum protobuf 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6686ddd96a8dbe2687b5f2a687b2cfb520854010ec480f2d74c32e7c9873d3c5" "checksum protobuf-codegen 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6456421eecf7fc72905868cd760c3e35848ded3552e480cfe67726ed4dbd8d23" "checksum protoc 2.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd83d2547a9e2c8bc6016607281b3ec7ef4871c55be6930915481d80350ab88" @@ -3402,7 +3402,7 @@ dependencies = [ "checksum tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "1739638e364e558128461fc1ad84d997702c8e31c2e6b18fb99842268199e827" "checksum tokio-udp 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f02298505547f73e60f568359ef0d016d5acd6e830ab9bc7c4a5b3403440121b" "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" -"checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" +"checksum toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" "checksum tracerr 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "64ee75bed80b548ecaede0ed297636fa16e05d7407aefdc64cb214ad3b8ebd53" "checksum treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" "checksum trust-dns-proto 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5559ebdf6c2368ddd11e20b11d6bbaf9e46deb803acd7815e93f5a7b4a6d2901" diff --git a/docs/rfc/0001-control-api.md b/docs/rfc/0001-control-api.md index dfc1b93a7..e887d3ea3 100644 --- a/docs/rfc/0001-control-api.md +++ b/docs/rfc/0001-control-api.md @@ -71,7 +71,7 @@ spec: # Fires when "caller" client stops publishing media data. on_stop: "http://127.0.0.1:8080/publish/stopped" # All media will be relayed through TURN server. - is_relay: false + is_force_relay: false # Media element which is able to play media data for client via WebRTC. play: kind: WebRtcPlayEndpoint @@ -798,7 +798,7 @@ message WebRtcPublishEndpoint { optional string dst = 2; optional string on_start = 3; optional string on_stop = 4; - optional bool is_relay = 5; + optional bool is_force_relay = 5; enum P2P { NEVER = 0; diff --git a/docs/rfc/0002-webrc-client-api.md b/docs/rfc/0002-webrc-client-api.md index 048289d47..43b043409 100644 --- a/docs/rfc/0002-webrc-client-api.md +++ b/docs/rfc/0002-webrc-client-api.md @@ -217,7 +217,7 @@ struct PeerCreated { sdp_offer: Option, tracks: Vec, ice_servers: Vec, - is_relay: bool, + is_force_relay: bool, } ``` @@ -237,7 +237,7 @@ Params: 2. `sdp_offer`: if `None`, client should create [SDP Offer] and pass it to the server; if `Some`, client should set it as remote description, then create [SDP Answer], set it as local description, and pass it to the server. 3. `tracks`: tracks of this `Peer`. 4. `ice_servers`: list of [ICE server]s that should be used to construct [RTCPeerConnection]. -5. `is_relay`: if `true` then all media will be relayed through [TURN] server. +5. `is_force_relay`: if `true` then all media will be relayed through [TURN] server. The most important part of `Peer` object is a list of `Track`s. - All `TrackDirection::Send` `Track`s must be created according to their settings and added to the `Peer`. @@ -316,7 +316,7 @@ The most important part of `Peer` object is a list of `Track`s. "credential": "turn_credential" } ], - "is_relay": false + "is_force_relay": false } ``` @@ -363,7 +363,7 @@ After negotiation is done and media starts flowing, `Web Client` might receive n "credential": "turn_credential" } ], - "is_relay": false + "is_force_relay": false } ``` @@ -1173,7 +1173,7 @@ Metrics list will be extended as needed. "credential": "turn_credential" } ], - "is_relay": false + "is_force_relay": false } } ``` diff --git a/jason/demo/index.html b/jason/demo/index.html index 43967e22d..3b398d7e5 100644 --- a/jason/demo/index.html +++ b/jason/demo/index.html @@ -40,7 +40,7 @@ publish: { kind: 'WebRtcPublishEndpoint', p2p: 'Always', - is_relay: false, + is_force_relay: false, }, }; diff --git a/jason/src/api/room.rs b/jason/src/api/room.rs index 0192f1dec..3ed400cfe 100644 --- a/jason/src/api/room.rs +++ b/jason/src/api/room.rs @@ -589,7 +589,7 @@ impl EventHandler for InnerRoom { sdp_offer: Option, tracks: Vec, ice_servers: Vec, - is_relay: bool, + is_force_relay: bool, ) { let peer = match self .peers @@ -599,7 +599,7 @@ impl EventHandler for InnerRoom { self.peer_event_sender.clone(), self.enabled_audio, self.enabled_video, - is_relay, + is_force_relay, ) .map_err(tracerr::map_from_and_wrap!(=> RoomError)) { diff --git a/jason/src/peer/conn.rs b/jason/src/peer/conn.rs index 694a116ed..12037c3ab 100644 --- a/jason/src/peer/conn.rs +++ b/jason/src/peer/conn.rs @@ -211,13 +211,13 @@ pub struct RtcPeerConnection { impl RtcPeerConnection { /// Instantiates new [`RtcPeerConnection`]. - pub fn new(ice_servers: I, is_relay: bool) -> Result + pub fn new(ice_servers: I, is_force_relay: bool) -> Result where I: IntoIterator, { // TODO: RTCBundlePolicy = "max-bundle"? let mut peer_conf = RtcConfiguration::new(); - let ice_transport_policy = if is_relay { + let ice_transport_policy = if is_force_relay { RtcIceTransportPolicy::Relay } else { RtcIceTransportPolicy::All diff --git a/jason/src/peer/mod.rs b/jason/src/peer/mod.rs index 158d648c9..10cfed35b 100644 --- a/jason/src/peer/mod.rs +++ b/jason/src/peer/mod.rs @@ -182,10 +182,10 @@ impl PeerConnection { media_manager: Rc, enabled_audio: EnabledAudio, enabled_video: EnabledVideo, - is_relay: bool, + is_force_relay: bool, ) -> Result { let peer = Rc::new( - RtcPeerConnection::new(ice_servers, is_relay) + RtcPeerConnection::new(ice_servers, is_force_relay) .map_err(tracerr::map_from_and_wrap!())?, ); let media_connections = Rc::new(MediaConnections::new( diff --git a/jason/src/peer/repo.rs b/jason/src/peer/repo.rs index 7dbc8ba64..76ea5b67f 100644 --- a/jason/src/peer/repo.rs +++ b/jason/src/peer/repo.rs @@ -25,7 +25,7 @@ pub trait PeerRepository { events_sender: mpsc::UnboundedSender, enabled_audio: EnabledAudio, enabled_video: EnabledVideo, - is_relay: bool, + is_force_relay: bool, ) -> Result, Traced>; /// Returns [`PeerConnection`] stored in repository by its ID. @@ -68,7 +68,7 @@ impl PeerRepository for Repository { peer_events_sender: mpsc::UnboundedSender, enabled_audio: EnabledAudio, enabled_video: EnabledVideo, - is_relay: bool, + is_force_relay: bool, ) -> Result, Traced> { let peer = Rc::new( PeerConnection::new( @@ -78,7 +78,7 @@ impl PeerRepository for Repository { Rc::clone(&self.media_manager), enabled_audio, enabled_video, - is_relay, + is_force_relay, ) .map_err(tracerr::map_from_and_wrap!())?, ); diff --git a/proto/client-api/CHANGELOG.md b/proto/client-api/CHANGELOG.md index 6cf1dc1bd..87ddf3881 100644 --- a/proto/client-api/CHANGELOG.md +++ b/proto/client-api/CHANGELOG.md @@ -24,7 +24,7 @@ All user visible changes to this project will be documented in this file. This p - `CloseReason` and `CloseDescription` types ([#58](/../../pull/58)); - `AddPeerConnectionMetrics` client command with `IceConnectionState` metric ([#71](/../../pull/71)); - `RpcSettings` server message ([#75](/../../pull/75)); -- `is_relay` into `Event::PeerCreated` ([#79](/../../pull/79)). +- `is_force_relay` field to `PeerCreated` event ([#79](/../../pull/79)). [#28]: /../../pull/28 diff --git a/proto/control-api/CHANGELOG.md b/proto/control-api/CHANGELOG.md index 780c07665..9c5d95f79 100644 --- a/proto/control-api/CHANGELOG.md +++ b/proto/control-api/CHANGELOG.md @@ -27,7 +27,7 @@ All user visible changes to this project will be documented in this file. This p - `Member`; - `WebRtcPlayEndpoint`; - `WebRtcPublishEndpoint`. - - `is_relay` field into `WebRtcPublishEndpoint` ([#79](/../../pull/79)). + - `is_force_relay` field into `WebRtcPublishEndpoint` and `WebRtcPlayEndpoint` ([#79](/../../pull/79)). - `Callback` service: - Callbacks ([#63]): - `OnJoin`; diff --git a/src/media/peer.rs b/src/media/peer.rs index ce4481f7f..7b1fa10ca 100644 --- a/src/media/peer.rs +++ b/src/media/peer.rs @@ -242,7 +242,7 @@ impl Peer { member_id: MemberId, partner_peer: Id, partner_member: MemberId, - is_relay: bool, + is_force_relay: bool, ) -> Self { let context = Context { id, @@ -253,7 +253,7 @@ impl Peer { sdp_answer: None, receivers: HashMap::new(), senders: HashMap::new(), - is_force_relay: is_relay, + is_force_relay, }; Self { context, diff --git a/src/signalling/elements/endpoints/webrtc/play_endpoint.rs b/src/signalling/elements/endpoints/webrtc/play_endpoint.rs index 0b64cbdeb..f5bf1e13a 100644 --- a/src/signalling/elements/endpoints/webrtc/play_endpoint.rs +++ b/src/signalling/elements/endpoints/webrtc/play_endpoint.rs @@ -48,6 +48,7 @@ struct WebRtcPlayEndpointInner { /// and related peer. peer_id: Option, + /// Is ice candidates discovering limited to relay candidates. is_force_relay: bool, } From dfd088de66c90e29dd0c48542a20a84bfa8410c8 Mon Sep 17 00:00:00 2001 From: tyranron Date: Tue, 21 Jan 2020 15:15:17 +0100 Subject: [PATCH 15/15] Corrections and renaming --- CHANGELOG.md | 2 +- _dev/specs/relay-pub-pub-video-call.yml | 9 +- docs/rfc/0001-control-api.md | 4 +- docs/rfc/0002-webrc-client-api.md | 256 ++++++++---------- jason/demo/index.html | 2 +- jason/e2e-demo/js/index.js | 12 +- jason/e2e-demo/video-call.html | 4 +- jason/src/api/room.rs | 4 +- jason/src/peer/conn.rs | 6 +- jason/src/peer/mod.rs | 4 +- jason/src/peer/repo.rs | 6 +- jason/tests/api/room.rs | 8 +- mock/control-api/src/api/endpoint.rs | 15 +- proto/client-api/CHANGELOG.md | 2 +- proto/client-api/src/lib.rs | 2 +- proto/control-api/CHANGELOG.md | 3 +- proto/control-api/src/grpc/api.proto | 8 +- proto/control-api/src/grpc/api.rs | 87 +++--- .../control/endpoints/webrtc_play_endpoint.rs | 5 +- .../endpoints/webrtc_publish_endpoint.rs | 8 +- src/media/peer.rs | 15 +- .../endpoints/webrtc/play_endpoint.rs | 17 +- .../endpoints/webrtc/publish_endpoint.rs | 19 +- src/signalling/elements/member.rs | 10 +- src/signalling/peers.rs | 4 +- src/signalling/room.rs | 12 +- tests/e2e/signalling/pub_sub_signallng.rs | 4 +- tests/specs/pub-sub-video-call.yml | 4 +- 28 files changed, 252 insertions(+), 280 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ba957a03..4cb17f66b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,7 +35,7 @@ All user visible changes to this project will be documented in this file. This p - Filter `SetIceCandidate` messages without `candidate` ([#50](/../../pull/50)); - Send reason of closing WebSocket connection as [Close](https://tools.ietf.org/html/rfc4566#section-5.14) frame's description ([#58](/../../pull/58)); - Send `Event::RpcSettingsUpdated` when `Member` connects ([#75]); - - Send relay mode in `Event::PeerCreated` which will be used in client side's `RtcIceTransportPolicy` ([#79](/../../pull/79)). + - Send relay mode in `Event::PeerCreated` which is used for configuring client's `RtcIceTransportPolicy` ([#79](/../../pull/79)). - Configuration: - `[server.control.grpc]` section to configure Control API gRPC server ([#33]); - `server.client.http.public_url` option to configure public URL of Client API HTTP server ([#33]); diff --git a/_dev/specs/relay-pub-pub-video-call.yml b/_dev/specs/relay-pub-pub-video-call.yml index 7cda9d719..b4d8b33ee 100644 --- a/_dev/specs/relay-pub-pub-video-call.yml +++ b/_dev/specs/relay-pub-pub-video-call.yml @@ -13,12 +13,12 @@ spec: kind: WebRtcPublishEndpoint spec: p2p: Always - is_force_relay: true + force_relay: true play-responder: kind: WebRtcPlayEndpoint spec: src: "local://relay-pub-pub-video-call/responder/publish" - is_force_relay: true + force_relay: true responder: kind: Member credentials: test @@ -30,10 +30,9 @@ spec: kind: WebRtcPublishEndpoint spec: p2p: Always - is_force_relay: true + force_relay: true play-caller: kind: WebRtcPlayEndpoint spec: src: "local://relay-pub-pub-video-call/caller/publish" - is_force_relay: true - + force_relay: true diff --git a/docs/rfc/0001-control-api.md b/docs/rfc/0001-control-api.md index e887d3ea3..86d69c47d 100644 --- a/docs/rfc/0001-control-api.md +++ b/docs/rfc/0001-control-api.md @@ -71,7 +71,7 @@ spec: # Fires when "caller" client stops publishing media data. on_stop: "http://127.0.0.1:8080/publish/stopped" # All media will be relayed through TURN server. - is_force_relay: false + force_relay: false # Media element which is able to play media data for client via WebRTC. play: kind: WebRtcPlayEndpoint @@ -798,7 +798,7 @@ message WebRtcPublishEndpoint { optional string dst = 2; optional string on_start = 3; optional string on_stop = 4; - optional bool is_force_relay = 5; + optional bool force_relay = 5; enum P2P { NEVER = 0; diff --git a/docs/rfc/0002-webrc-client-api.md b/docs/rfc/0002-webrc-client-api.md index 43b043409..7d4e51b4a 100644 --- a/docs/rfc/0002-webrc-client-api.md +++ b/docs/rfc/0002-webrc-client-api.md @@ -217,7 +217,7 @@ struct PeerCreated { sdp_offer: Option, tracks: Vec, ice_servers: Vec, - is_force_relay: bool, + force_relay: bool, } ``` @@ -237,7 +237,7 @@ Params: 2. `sdp_offer`: if `None`, client should create [SDP Offer] and pass it to the server; if `Some`, client should set it as remote description, then create [SDP Answer], set it as local description, and pass it to the server. 3. `tracks`: tracks of this `Peer`. 4. `ice_servers`: list of [ICE server]s that should be used to construct [RTCPeerConnection]. -5. `is_force_relay`: if `true` then all media will be relayed through [TURN] server. +5. `force_relay`: if `true` then all media will be relayed through [TURN] server. The most important part of `Peer` object is a list of `Track`s. - All `TrackDirection::Send` `Track`s must be created according to their settings and added to the `Peer`. @@ -251,72 +251,61 @@ The most important part of `Peer` object is a list of `Track`s. ```json { "peer_id": 1, - "tracks": [ - { - "id": 1, - "media_type": { - "Audio": {} - }, - "direction": { - "Send": { - "receivers": [ - 2 - ], - "mid": null - } + "tracks": [{ + "id": 1, + "media_type": { + "Audio": {} + }, + "direction": { + "Send": { + "receivers": [2], + "mid": null } + } + }, { + "id": 2, + "media_type": { + "Video": {} }, - { - "id": 2, - "media_type": { - "Video": {} - }, - "direction": { - "Send": { - "receivers": [ - 2 - ], - "mid": null - } + "direction": { + "Send": { + "receivers": [2], + "mid": null } + } + }, { + "id": 3, + "media_type": { + "Audio": {} }, - { - "id": 3, - "media_type": { - "Audio": {} - }, - "direction": { - "Recv": { - "sender": 2, - "mid": null - } + "direction": { + "Recv": { + "sender": 2, + "mid": null } + } + }, { + "id": 4, + "media_type": { + "Video": {} }, - { - "id": 4, - "media_type": { - "Video": {} - }, - "direction": { - "Recv": { - "sender": 2, - "mid": null - } + "direction": { + "Recv": { + "sender": 2, + "mid": null } } - ], + }], "sdp_offer": null, - "ice_servers": [ - { - "urls": [ - "turn:turnserver.com:3478", - "turn:turnserver.com:3478?transport=tcp" - ], - "username": "turn_user", - "credential": "turn_credential" - } - ], - "is_force_relay": false + "ice_servers": [{ + "urls": [ + "turn:turnserver.com:3478", + "turn:turnserver.com:3478?transport=tcp" + ], + "username": "turn_user", + "credential": "turn_credential" + }], + "force_relay": false } ``` @@ -338,32 +327,28 @@ After negotiation is done and media starts flowing, `Web Client` might receive n ```json { "peer_id": 1, - "tracks": [ - { - "id": 1, - "media_type":{ - "Audio":{} - }, - "direction": { - "Send": { - "receivers": [], - "mid": null - } + "tracks": [{ + "id": 1, + "media_type":{ + "Audio":{} + }, + "direction": { + "Send": { + "receivers": [], + "mid": null } } - ], + }], "sdp_offer": "server_user1_recvonly_offer", - "ice_servers": [ - { - "urls": [ - "turn:turnserver.com:3478", - "turn:turnserver.com:3478?transport=tcp" - ], - "username": "turn_user", - "credential": "turn_credential" - } - ], - "is_force_relay": false + "ice_servers": [{ + "urls": [ + "turn:turnserver.com:3478", + "turn:turnserver.com:3478?transport=tcp" + ], + "username": "turn_user", + "credential": "turn_credential" + }], + "force_relay": false } ``` @@ -1104,76 +1089,61 @@ Metrics list will be extended as needed. "event": "PeerCreated", "data": { "peer_id": 1, - "tracks": [ - { - "id": 1, - "media_type": { - "Audio": {} - }, - "direction": { - "Send": { - "receivers": [ - 2 - ], - "mid": null - } + "tracks": [{ + "id": 1, + "media_type": { + "Audio": {} + }, + "direction": { + "Send": { + "receivers": [2], + "mid": null } + } + }, { + "id": 2, + "media_type": { + "Video": {} }, - { - "id": 2, - "media_type": { - "Video": { - - } - }, - "direction": { - "Send": { - "receivers": [ - 2 - ], - "mid": null - } + "direction": { + "Send": { + "receivers": [2], + "mid": null } + } + }, { + "id": 3, + "media_type": { + "Audio": {} }, - { - "id": 3, - "media_type": { - "Audio": { - - } - }, - "direction": { - "Recv": { - "sender": 2, - "mid": null - } + "direction": { + "Recv": { + "sender": 2, + "mid": null } + } + }, { + "id": 4, + "media_type": { + "Video": {} }, - { - "id": 4, - "media_type": { - "Video": {} - }, - "direction": { - "Recv": { - "sender": 2, - "mid": null - } + "direction": { + "Recv": { + "sender": 2, + "mid": null } } - ], + }], "sdp_offer": null, - "ice_servers": [ - { - "urls": [ - "turn:turnserver.com:3478", - "turn:turnserver.com:3478?transport=tcp" - ], - "username": "turn_user", - "credential": "turn_credential" - } - ], - "is_force_relay": false + "ice_servers": [{ + "urls": [ + "turn:turnserver.com:3478", + "turn:turnserver.com:3478?transport=tcp" + ], + "username": "turn_user", + "credential": "turn_credential" + }], + "force_relay": false } } ``` diff --git a/jason/demo/index.html b/jason/demo/index.html index 3b398d7e5..b73503ae1 100644 --- a/jason/demo/index.html +++ b/jason/demo/index.html @@ -40,7 +40,7 @@ publish: { kind: 'WebRtcPublishEndpoint', p2p: 'Always', - is_force_relay: false, + force_relay: false, }, }; diff --git a/jason/e2e-demo/js/index.js b/jason/e2e-demo/js/index.js index 72751ccc8..3e2a5b09f 100644 --- a/jason/e2e-demo/js/index.js +++ b/jason/e2e-demo/js/index.js @@ -18,7 +18,7 @@ async function createRoom(roomId, memberId) { publish: { kind: 'WebRtcPublishEndpoint', p2p: 'Always', - is_force_relay: false + force_relay: false }, }, on_join: "grpc://127.0.0.1:9099", @@ -38,7 +38,7 @@ async function createMember(roomId, memberId) { publish: { kind: 'WebRtcPublishEndpoint', p2p: 'Always', - is_force_relay: false + force_relay: false } }; @@ -138,19 +138,19 @@ const controlDebugWindows = { let endpointType = container.getElementsByClassName('control-debug__endpoint-type')[0].value; if (endpointType === 'WebRtcPublishEndpoint') { let p2pMode = container.getElementsByClassName('webrtc-publish-endpoint-spec__p2p')[0].value; - let isForceRelay = container.getElementsByClassName('webrtc-publish-endpoint-spec__is-force-relay')[0].value === 'true'; + let isForceRelay = container.getElementsByClassName('webrtc-publish-endpoint-spec__force-relay')[0].value === 'true'; await controlApi.createEndpoint(roomId, memberId, endpointId, { kind: endpointType, p2p: p2pMode, - is_force_relay: isForceRelay, + force_relay: isForceRelay, }); } else if (endpointType === 'WebRtcPlayEndpoint') { let source = container.getElementsByClassName('webrtc-play-endpoint-spec__src')[0].value; - let isForceRelay = container.getElementsByClassName('webrtc-play-endpoint-spec__is-force-relay')[0].value === 'true'; + let isForceRelay = container.getElementsByClassName('webrtc-play-endpoint-spec__force-relay')[0].value === 'true'; await controlApi.createEndpoint(roomId, memberId, endpointId, { kind: endpointType, src: source, - is_force_relay: isForceRelay, + force_relay: isForceRelay, }); } }) diff --git a/jason/e2e-demo/video-call.html b/jason/e2e-demo/video-call.html index 332019125..74d36ff2c 100644 --- a/jason/e2e-demo/video-call.html +++ b/jason/e2e-demo/video-call.html @@ -283,7 +283,7 @@
Is relay: - @@ -297,7 +297,7 @@ Is relay: - diff --git a/jason/src/api/room.rs b/jason/src/api/room.rs index 3ed400cfe..2574f6841 100644 --- a/jason/src/api/room.rs +++ b/jason/src/api/room.rs @@ -589,7 +589,7 @@ impl EventHandler for InnerRoom { sdp_offer: Option, tracks: Vec, ice_servers: Vec, - is_force_relay: bool, + is_force_relayed: bool, ) { let peer = match self .peers @@ -599,7 +599,7 @@ impl EventHandler for InnerRoom { self.peer_event_sender.clone(), self.enabled_audio, self.enabled_video, - is_force_relay, + is_force_relayed, ) .map_err(tracerr::map_from_and_wrap!(=> RoomError)) { diff --git a/jason/src/peer/conn.rs b/jason/src/peer/conn.rs index 12037c3ab..ce168e393 100644 --- a/jason/src/peer/conn.rs +++ b/jason/src/peer/conn.rs @@ -211,18 +211,18 @@ pub struct RtcPeerConnection { impl RtcPeerConnection { /// Instantiates new [`RtcPeerConnection`]. - pub fn new(ice_servers: I, is_force_relay: bool) -> Result + pub fn new(ice_servers: I, is_force_relayed: bool) -> Result where I: IntoIterator, { // TODO: RTCBundlePolicy = "max-bundle"? let mut peer_conf = RtcConfiguration::new(); - let ice_transport_policy = if is_force_relay { + let policy = if is_force_relayed { RtcIceTransportPolicy::Relay } else { RtcIceTransportPolicy::All }; - peer_conf.ice_transport_policy(ice_transport_policy); + peer_conf.ice_transport_policy(policy); peer_conf.ice_servers(&RtcIceServers::from(ice_servers)); let peer = SysRtcPeerConnection::new_with_configuration(&peer_conf) .map_err(Into::into) diff --git a/jason/src/peer/mod.rs b/jason/src/peer/mod.rs index 10cfed35b..70efa96ac 100644 --- a/jason/src/peer/mod.rs +++ b/jason/src/peer/mod.rs @@ -182,10 +182,10 @@ impl PeerConnection { media_manager: Rc, enabled_audio: EnabledAudio, enabled_video: EnabledVideo, - is_force_relay: bool, + is_force_relayed: bool, ) -> Result { let peer = Rc::new( - RtcPeerConnection::new(ice_servers, is_force_relay) + RtcPeerConnection::new(ice_servers, is_force_relayed) .map_err(tracerr::map_from_and_wrap!())?, ); let media_connections = Rc::new(MediaConnections::new( diff --git a/jason/src/peer/repo.rs b/jason/src/peer/repo.rs index 76ea5b67f..8b7b52cb3 100644 --- a/jason/src/peer/repo.rs +++ b/jason/src/peer/repo.rs @@ -25,7 +25,7 @@ pub trait PeerRepository { events_sender: mpsc::UnboundedSender, enabled_audio: EnabledAudio, enabled_video: EnabledVideo, - is_force_relay: bool, + is_force_relayed: bool, ) -> Result, Traced>; /// Returns [`PeerConnection`] stored in repository by its ID. @@ -68,7 +68,7 @@ impl PeerRepository for Repository { peer_events_sender: mpsc::UnboundedSender, enabled_audio: EnabledAudio, enabled_video: EnabledVideo, - is_force_relay: bool, + is_force_relayed: bool, ) -> Result, Traced> { let peer = Rc::new( PeerConnection::new( @@ -78,7 +78,7 @@ impl PeerRepository for Repository { Rc::clone(&self.media_manager), enabled_audio, enabled_video, - is_force_relay, + is_force_relayed, ) .map_err(tracerr::map_from_and_wrap!())?, ); diff --git a/jason/tests/api/room.rs b/jason/tests/api/room.rs index f2d122798..297115687 100644 --- a/jason/tests/api/room.rs +++ b/jason/tests/api/room.rs @@ -147,7 +147,7 @@ async fn mute_audio_room_before_init_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - is_force_relay: false, + force_relay: false, }) .unwrap(); @@ -171,7 +171,7 @@ async fn mute_video_room_before_init_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - is_force_relay: false, + force_relay: false, }) .unwrap(); @@ -224,7 +224,7 @@ async fn error_inject_invalid_local_stream_into_new_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - is_force_relay: false, + force_relay: false, }) .unwrap(); @@ -298,7 +298,7 @@ async fn error_get_local_stream_on_new_peer() { sdp_offer: None, tracks: vec![audio_track, video_track], ice_servers: vec![], - is_force_relay: false, + force_relay: false, }) .unwrap(); diff --git a/mock/control-api/src/api/endpoint.rs b/mock/control-api/src/api/endpoint.rs index 47b0168d5..ee4a8329f 100644 --- a/mock/control-api/src/api/endpoint.rs +++ b/mock/control-api/src/api/endpoint.rs @@ -49,8 +49,8 @@ pub struct WebRtcPublishEndpoint { /// Mode of connection for this [`WebRtcPublishEndpoint`]. p2p: P2pMode, - /// If 'true' then all media will be relayed through TURN server. - is_force_relay: bool, + /// Option to relay all media through a TURN server forcibly. + force_relay: bool, } impl WebRtcPublishEndpoint { @@ -61,7 +61,7 @@ impl WebRtcPublishEndpoint { let mut proto = WebRtcPublishEndpointProto::new(); proto.set_id(id); proto.set_p2p(self.p2p.into()); - proto.set_is_force_relay(self.is_force_relay); + proto.set_force_relay(self.force_relay); proto } } @@ -71,7 +71,7 @@ impl From for WebRtcPublishEndpoint { Self { id: proto.take_id(), p2p: proto.get_p2p().into(), - is_force_relay: proto.get_is_force_relay(), + force_relay: proto.get_force_relay(), } } } @@ -89,8 +89,8 @@ pub struct WebRtcPlayEndpoint { /// [`WebRtcPublishEndpoint`] which this [`WebRtcPlayEndpoint`] plays. src: String, - /// If 'true' then all media will be relayed through TURN server. - is_force_relay: bool, + /// Option to relay all media through a TURN server forcibly. + force_relay: bool, } impl WebRtcPlayEndpoint { @@ -101,6 +101,7 @@ impl WebRtcPlayEndpoint { let mut proto = WebRtcPlayEndpointProto::new(); proto.set_id(id); proto.set_src(self.src); + proto.set_force_relay(self.force_relay); proto } } @@ -110,7 +111,7 @@ impl From for WebRtcPlayEndpoint { Self { id: proto.take_id(), src: proto.take_src(), - is_force_relay: proto.get_is_force_relay(), + force_relay: proto.get_force_relay(), } } } diff --git a/proto/client-api/CHANGELOG.md b/proto/client-api/CHANGELOG.md index 87ddf3881..bec0da155 100644 --- a/proto/client-api/CHANGELOG.md +++ b/proto/client-api/CHANGELOG.md @@ -24,7 +24,7 @@ All user visible changes to this project will be documented in this file. This p - `CloseReason` and `CloseDescription` types ([#58](/../../pull/58)); - `AddPeerConnectionMetrics` client command with `IceConnectionState` metric ([#71](/../../pull/71)); - `RpcSettings` server message ([#75](/../../pull/75)); -- `is_force_relay` field to `PeerCreated` event ([#79](/../../pull/79)). +- `force_relay` field to `PeerCreated` event ([#79](/../../pull/79)). [#28]: /../../pull/28 diff --git a/proto/client-api/src/lib.rs b/proto/client-api/src/lib.rs index 04a28ed2b..85f5e865f 100644 --- a/proto/client-api/src/lib.rs +++ b/proto/client-api/src/lib.rs @@ -208,7 +208,7 @@ pub enum Event { sdp_offer: Option, tracks: Vec, ice_servers: Vec, - is_force_relay: bool, + force_relay: bool, }, /// Media Server notifies Web Client about necessity to apply specified SDP diff --git a/proto/control-api/CHANGELOG.md b/proto/control-api/CHANGELOG.md index 9c5d95f79..00d45e55e 100644 --- a/proto/control-api/CHANGELOG.md +++ b/proto/control-api/CHANGELOG.md @@ -22,12 +22,11 @@ All user visible changes to this project will be documented in this file. This p - `Create`; - `Get`; - `Delete`. - - Elements ([#57]): + - Elements ([#57], [#79](/../../pull/79)): - `Room`; - `Member`; - `WebRtcPlayEndpoint`; - `WebRtcPublishEndpoint`. - - `is_force_relay` field into `WebRtcPublishEndpoint` and `WebRtcPlayEndpoint` ([#79](/../../pull/79)). - `Callback` service: - Callbacks ([#63]): - `OnJoin`; diff --git a/proto/control-api/src/grpc/api.proto b/proto/control-api/src/grpc/api.proto index cecfe4e78..b14828a15 100644 --- a/proto/control-api/src/grpc/api.proto +++ b/proto/control-api/src/grpc/api.proto @@ -163,8 +163,8 @@ message WebRtcPublishEndpoint { string on_start = 3; // Callback which fires when a client stops publishing media data. string on_stop = 4; - // If 'true' then all media will be relayed through TURN server. - bool is_force_relay = 5; + // Option to relay all media through a TURN server forcibly. + bool force_relay = 5; // P2P mode of WebRTC interaction. enum P2P { @@ -190,6 +190,6 @@ message WebRtcPlayEndpoint { // Callback which fires when a client stops playing media data // from the source. string on_stop = 4; - // If 'true' then all media will be relayed through TURN server. - bool is_force_relay = 5; + // Option to relay all media through a TURN server forcibly. + bool force_relay = 5; } diff --git a/proto/control-api/src/grpc/api.rs b/proto/control-api/src/grpc/api.rs index 6a9820f3d..65d84ceb8 100644 --- a/proto/control-api/src/grpc/api.rs +++ b/proto/control-api/src/grpc/api.rs @@ -3244,7 +3244,7 @@ pub struct WebRtcPublishEndpoint { pub p2p: WebRtcPublishEndpoint_P2P, pub on_start: ::std::string::String, pub on_stop: ::std::string::String, - pub is_force_relay: bool, + pub force_relay: bool, // special fields pub unknown_fields: ::protobuf::UnknownFields, pub cached_size: ::protobuf::CachedSize, @@ -3354,19 +3354,19 @@ impl WebRtcPublishEndpoint { ::std::mem::replace(&mut self.on_stop, ::std::string::String::new()) } - // bool is_force_relay = 5; + // bool force_relay = 5; - pub fn get_is_force_relay(&self) -> bool { - self.is_force_relay + pub fn get_force_relay(&self) -> bool { + self.force_relay } - pub fn clear_is_force_relay(&mut self) { - self.is_force_relay = false; + pub fn clear_force_relay(&mut self) { + self.force_relay = false; } // Param is passed by value, moved - pub fn set_is_force_relay(&mut self, v: bool) { - self.is_force_relay = v; + pub fn set_force_relay(&mut self, v: bool) { + self.force_relay = v; } } @@ -3396,7 +3396,7 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); } let tmp = is.read_bool()?; - self.is_force_relay = tmp; + self.force_relay = tmp; }, _ => { ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; @@ -3422,7 +3422,7 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { if !self.on_stop.is_empty() { my_size += ::protobuf::rt::string_size(4, &self.on_stop); } - if self.is_force_relay != false { + if self.force_relay != false { my_size += 2; } my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -3443,8 +3443,8 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { if !self.on_stop.is_empty() { os.write_string(4, &self.on_stop)?; } - if self.is_force_relay != false { - os.write_bool(5, self.is_force_relay)?; + if self.force_relay != false { + os.write_bool(5, self.force_relay)?; } os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) @@ -3509,9 +3509,9 @@ impl ::protobuf::Message for WebRtcPublishEndpoint { |m: &mut WebRtcPublishEndpoint| { &mut m.on_stop }, )); fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "is_force_relay", - |m: &WebRtcPublishEndpoint| { &m.is_force_relay }, - |m: &mut WebRtcPublishEndpoint| { &mut m.is_force_relay }, + "force_relay", + |m: &WebRtcPublishEndpoint| { &m.force_relay }, + |m: &mut WebRtcPublishEndpoint| { &mut m.force_relay }, )); ::protobuf::reflect::MessageDescriptor::new::( "WebRtcPublishEndpoint", @@ -3539,7 +3539,7 @@ impl ::protobuf::Clear for WebRtcPublishEndpoint { self.p2p = WebRtcPublishEndpoint_P2P::NEVER; self.on_start.clear(); self.on_stop.clear(); - self.is_force_relay = false; + self.force_relay = false; self.unknown_fields.clear(); } } @@ -3621,7 +3621,7 @@ pub struct WebRtcPlayEndpoint { pub src: ::std::string::String, pub on_start: ::std::string::String, pub on_stop: ::std::string::String, - pub is_force_relay: bool, + pub force_relay: bool, // special fields pub unknown_fields: ::protobuf::UnknownFields, pub cached_size: ::protobuf::CachedSize, @@ -3742,19 +3742,19 @@ impl WebRtcPlayEndpoint { ::std::mem::replace(&mut self.on_stop, ::std::string::String::new()) } - // bool is_force_relay = 5; + // bool force_relay = 5; - pub fn get_is_force_relay(&self) -> bool { - self.is_force_relay + pub fn get_force_relay(&self) -> bool { + self.force_relay } - pub fn clear_is_force_relay(&mut self) { - self.is_force_relay = false; + pub fn clear_force_relay(&mut self) { + self.force_relay = false; } // Param is passed by value, moved - pub fn set_is_force_relay(&mut self, v: bool) { - self.is_force_relay = v; + pub fn set_force_relay(&mut self, v: bool) { + self.force_relay = v; } } @@ -3784,7 +3784,7 @@ impl ::protobuf::Message for WebRtcPlayEndpoint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); } let tmp = is.read_bool()?; - self.is_force_relay = tmp; + self.force_relay = tmp; }, _ => { ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; @@ -3810,7 +3810,7 @@ impl ::protobuf::Message for WebRtcPlayEndpoint { if !self.on_stop.is_empty() { my_size += ::protobuf::rt::string_size(4, &self.on_stop); } - if self.is_force_relay != false { + if self.force_relay != false { my_size += 2; } my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -3831,8 +3831,8 @@ impl ::protobuf::Message for WebRtcPlayEndpoint { if !self.on_stop.is_empty() { os.write_string(4, &self.on_stop)?; } - if self.is_force_relay != false { - os.write_bool(5, self.is_force_relay)?; + if self.force_relay != false { + os.write_bool(5, self.force_relay)?; } os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) @@ -3897,9 +3897,9 @@ impl ::protobuf::Message for WebRtcPlayEndpoint { |m: &mut WebRtcPlayEndpoint| { &mut m.on_stop }, )); fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( - "is_force_relay", - |m: &WebRtcPlayEndpoint| { &m.is_force_relay }, - |m: &mut WebRtcPlayEndpoint| { &mut m.is_force_relay }, + "force_relay", + |m: &WebRtcPlayEndpoint| { &m.force_relay }, + |m: &mut WebRtcPlayEndpoint| { &mut m.force_relay }, )); ::protobuf::reflect::MessageDescriptor::new::( "WebRtcPlayEndpoint", @@ -3927,7 +3927,7 @@ impl ::protobuf::Clear for WebRtcPlayEndpoint { self.src.clear(); self.on_start.clear(); self.on_stop.clear(); - self.is_force_relay = false; + self.force_relay = false; self.unknown_fields.clear(); } } @@ -3986,21 +3986,20 @@ static file_descriptor_proto_data: &'static [u8] = b"\ \x20\x01(\x0b2\x15.medea.Member.ElementR\x05value:\x028\x01\x1a\x8c\x01\ \n\x07Element\x12<\n\x0bwebrtc_play\x18\x01\x20\x01(\x0b2\x19.medea.WebR\ tcPlayEndpointH\0R\nwebrtcPlay\x12=\n\nwebrtc_pub\x18\x02\x20\x01(\x0b2\ - \x1c.medea.WebRtcPublishEndpointH\0R\twebrtcPubB\x04\n\x02el\"\xe4\x01\n\ + \x1c.medea.WebRtcPublishEndpointH\0R\twebrtcPubB\x04\n\x02el\"\xdf\x01\n\ \x15WebRtcPublishEndpoint\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x122\ \n\x03p2p\x18\x02\x20\x01(\x0e2\x20.medea.WebRtcPublishEndpoint.P2PR\x03\ p2p\x12\x19\n\x08on_start\x18\x03\x20\x01(\tR\x07onStart\x12\x17\n\x07on\ - _stop\x18\x04\x20\x01(\tR\x06onStop\x12$\n\x0eis_force_relay\x18\x05\x20\ - \x01(\x08R\x0cisForceRelay\"-\n\x03P2P\x12\t\n\x05NEVER\x10\0\x12\x0f\n\ - \x0bIF_POSSIBLE\x10\x01\x12\n\n\x06ALWAYS\x10\x02\"\x90\x01\n\x12WebRtcP\ - layEndpoint\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x10\n\x03src\ - \x18\x02\x20\x01(\tR\x03src\x12\x19\n\x08on_start\x18\x03\x20\x01(\tR\ - \x07onStart\x12\x17\n\x07on_stop\x18\x04\x20\x01(\tR\x06onStop\x12$\n\ - \x0eis_force_relay\x18\x05\x20\x01(\x08R\x0cisForceRelay2\x9d\x01\n\nCon\ - trolApi\x125\n\x06Create\x12\x14.medea.CreateRequest\x1a\x15.medea.Creat\ - eResponse\x12+\n\x06Delete\x12\x10.medea.IdRequest\x1a\x0f.medea.Respons\ - e\x12+\n\x03Get\x12\x10.medea.IdRequest\x1a\x12.medea.GetResponseb\x06pr\ - oto3\ + _stop\x18\x04\x20\x01(\tR\x06onStop\x12\x1f\n\x0bforce_relay\x18\x05\x20\ + \x01(\x08R\nforceRelay\"-\n\x03P2P\x12\t\n\x05NEVER\x10\0\x12\x0f\n\x0bI\ + F_POSSIBLE\x10\x01\x12\n\n\x06ALWAYS\x10\x02\"\x8b\x01\n\x12WebRtcPlayEn\ + dpoint\x12\x0e\n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x10\n\x03src\x18\ + \x02\x20\x01(\tR\x03src\x12\x19\n\x08on_start\x18\x03\x20\x01(\tR\x07onS\ + tart\x12\x17\n\x07on_stop\x18\x04\x20\x01(\tR\x06onStop\x12\x1f\n\x0bfor\ + ce_relay\x18\x05\x20\x01(\x08R\nforceRelay2\x9d\x01\n\nControlApi\x125\n\ + \x06Create\x12\x14.medea.CreateRequest\x1a\x15.medea.CreateResponse\x12+\ + \n\x06Delete\x12\x10.medea.IdRequest\x1a\x0f.medea.Response\x12+\n\x03Ge\ + t\x12\x10.medea.IdRequest\x1a\x12.medea.GetResponseb\x06proto3\ "; static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy { diff --git a/src/api/control/endpoints/webrtc_play_endpoint.rs b/src/api/control/endpoints/webrtc_play_endpoint.rs index 7126f5e9c..ef29f4a83 100644 --- a/src/api/control/endpoints/webrtc_play_endpoint.rs +++ b/src/api/control/endpoints/webrtc_play_endpoint.rs @@ -23,8 +23,9 @@ pub struct WebRtcPlayEndpoint { /// Source URI in format `local://{room_id}/{member_id}/{endpoint_id}`. pub src: SrcUri, + /// Option to relay all media through a TURN server forcibly. #[serde(default)] - pub is_force_relay: bool, + pub force_relay: bool, } impl TryFrom<&WebRtcPlayEndpointProto> for WebRtcPlayEndpoint { @@ -33,7 +34,7 @@ impl TryFrom<&WebRtcPlayEndpointProto> for WebRtcPlayEndpoint { fn try_from(value: &WebRtcPlayEndpointProto) -> Result { Ok(Self { src: SrcUri::try_from(value.get_src().to_owned())?, - is_force_relay: value.get_is_force_relay(), + force_relay: value.get_force_relay(), }) } } diff --git a/src/api/control/endpoints/webrtc_publish_endpoint.rs b/src/api/control/endpoints/webrtc_publish_endpoint.rs index d5556515b..f1eb7b64c 100644 --- a/src/api/control/endpoints/webrtc_publish_endpoint.rs +++ b/src/api/control/endpoints/webrtc_publish_endpoint.rs @@ -17,7 +17,7 @@ use medea_control_api_proto::grpc::api::{ pub struct WebRtcPublishId(String); /// Peer-to-peer mode of [`WebRtcPublishEndpoint`]. -#[derive(Copy, Clone, Deserialize, Debug)] +#[derive(Clone, Copy, Deserialize, Debug)] pub enum P2pMode { /// Always connect peer-to-peer. Always, @@ -56,16 +56,16 @@ pub struct WebRtcPublishEndpoint { /// Peer-to-peer mode of this [`WebRtcPublishEndpoint`]. pub p2p: P2pMode, - /// If 'true' then all media will be relayed through TURN server. + /// Option to relay all media through a TURN server forcibly. #[serde(default)] - pub is_force_relay: bool, + pub force_relay: bool, } impl From<&WebRtcPublishEndpointProto> for WebRtcPublishEndpoint { fn from(value: &WebRtcPublishEndpointProto) -> Self { Self { p2p: P2pMode::from(value.get_p2p()), - is_force_relay: value.get_is_force_relay(), + force_relay: value.get_force_relay(), } } } diff --git a/src/media/peer.rs b/src/media/peer.rs index 7b1fa10ca..023e32629 100644 --- a/src/media/peer.rs +++ b/src/media/peer.rs @@ -70,7 +70,7 @@ impl PeerError { #[enum_delegate(pub fn member_id(&self) -> MemberId)] #[enum_delegate(pub fn partner_peer_id(&self) -> Id)] #[enum_delegate(pub fn partner_member_id(&self) -> MemberId)] -#[enum_delegate(pub fn is_force_relay(&self) -> bool)] +#[enum_delegate(pub fn is_force_relayed(&self) -> bool)] #[derive(Debug)] pub enum PeerStateMachine { New(Peer), @@ -152,7 +152,7 @@ pub struct Context { sdp_answer: Option, receivers: HashMap>, senders: HashMap>, - is_force_relay: bool, + is_force_relayed: bool, } /// [RTCPeerConnection] representation. @@ -226,10 +226,9 @@ impl Peer { !self.context.senders.is_empty() } - /// If 'true' is returned then all media should be relayed through TURN - /// server. - pub fn is_force_relay(&self) -> bool { - self.context.is_force_relay + /// Indicates whether all media is forcibly relayed through a TURN server. + pub fn is_force_relayed(&self) -> bool { + self.context.is_force_relayed } } @@ -242,7 +241,7 @@ impl Peer { member_id: MemberId, partner_peer: Id, partner_member: MemberId, - is_force_relay: bool, + is_force_relayed: bool, ) -> Self { let context = Context { id, @@ -253,7 +252,7 @@ impl Peer { sdp_answer: None, receivers: HashMap::new(), senders: HashMap::new(), - is_force_relay, + is_force_relayed, }; Self { context, diff --git a/src/signalling/elements/endpoints/webrtc/play_endpoint.rs b/src/signalling/elements/endpoints/webrtc/play_endpoint.rs index f5bf1e13a..5ef907ab2 100644 --- a/src/signalling/elements/endpoints/webrtc/play_endpoint.rs +++ b/src/signalling/elements/endpoints/webrtc/play_endpoint.rs @@ -48,8 +48,9 @@ struct WebRtcPlayEndpointInner { /// and related peer. peer_id: Option, - /// Is ice candidates discovering limited to relay candidates. - is_force_relay: bool, + /// Indicator whether only `relay` ICE candidates are allowed for this + /// [`WebRtcPlayEndpoint`]. + is_force_relayed: bool, } impl WebRtcPlayEndpointInner { @@ -103,7 +104,7 @@ impl WebRtcPlayEndpoint { src_uri: SrcUri, publisher: WeakWebRtcPublishEndpoint, owner: WeakMember, - is_force_relay: bool, + is_force_relayed: bool, ) -> Self { Self(Rc::new(RefCell::new(WebRtcPlayEndpointInner { id, @@ -111,7 +112,7 @@ impl WebRtcPlayEndpoint { src: publisher, owner, peer_id: None, - is_force_relay, + is_force_relayed, }))) } @@ -164,8 +165,10 @@ impl WebRtcPlayEndpoint { self.0.borrow().id.clone() } - pub fn is_force_relay(&self) -> bool { - self.0.borrow().is_force_relay + /// Indicates whether only `relay` ICE candidates are allowed for this + /// [`WebRtcPlayEndpoint`]. + pub fn is_force_relayed(&self) -> bool { + self.0.borrow().is_force_relayed } /// Downgrades [`WebRtcPlayEndpoint`] to [`WeakWebRtcPlayEndpoint`] weak @@ -210,7 +213,7 @@ impl Into for WebRtcPlayEndpoint { let mut play = WebRtcPlayEndpointProto::new(); play.set_src(self.src_uri().to_string()); play.set_id(self.id().to_string()); - play.set_is_force_relay(self.is_force_relay()); + play.set_force_relay(self.is_force_relayed()); element.set_webrtc_play(play); element diff --git a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs index 4ddb82b52..627f5b6b8 100644 --- a/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs +++ b/src/signalling/elements/endpoints/webrtc/publish_endpoint.rs @@ -32,8 +32,9 @@ struct WebRtcPublishEndpointInner { /// P2P connection mode for this [`WebRtcPublishEndpoint`]. p2p: P2pMode, - /// If 'true' then all media will be relayed through TURN server. - is_force_relay: bool, + /// Indicator whether only `relay` ICE candidates are allowed for this + /// [`WebRtcPublishEndpoint`]. + is_force_relayed: bool, /// All sinks of this [`WebRtcPublishEndpoint`]. sinks: Vec, @@ -116,12 +117,12 @@ impl WebRtcPublishEndpoint { id: Id, p2p: P2pMode, owner: WeakMember, - is_force_relay: bool, + is_force_relayed: bool, ) -> Self { Self(Rc::new(RefCell::new(WebRtcPublishEndpointInner { id, p2p, - is_force_relay, + is_force_relayed, sinks: Vec::new(), owner, peer_ids: HashSet::new(), @@ -199,10 +200,10 @@ impl WebRtcPublishEndpoint { self.0.borrow().p2p } - /// If 'true' is returned then all media should be relayed through TURN - /// server. - pub fn is_force_relay(&self) -> bool { - self.0.borrow().is_force_relay + /// Indicates whether only `relay` ICE candidates are allowed for this + /// [`WebRtcPublishEndpoint`]. + pub fn is_force_relayed(&self) -> bool { + self.0.borrow().is_force_relayed } /// Downgrades [`WebRtcPublishEndpoint`] to weak pointer @@ -247,7 +248,7 @@ impl Into for WebRtcPublishEndpoint { let mut publish = WebRtcPublishEndpointProto::new(); publish.set_p2p(self.p2p().into()); publish.set_id(self.id().to_string()); - publish.set_is_force_relay(self.is_force_relay()); + publish.set_force_relay(self.is_force_relayed()); element.set_webrtc_pub(publish); element diff --git a/src/signalling/elements/member.rs b/src/signalling/elements/member.rs index a23cfb3b2..11a3e4300 100644 --- a/src/signalling/elements/member.rs +++ b/src/signalling/elements/member.rs @@ -192,7 +192,7 @@ impl Member { spec_play_endpoint.src.clone(), publisher.downgrade(), this_member.downgrade(), - spec_play_endpoint.is_force_relay, + spec_play_endpoint.force_relay, ); self.insert_sink(new_play_endpoint.clone()); @@ -204,7 +204,7 @@ impl Member { new_publish_id, publisher_endpoint.p2p, publisher_member.downgrade(), - publisher_endpoint.is_force_relay, + publisher_endpoint.force_relay, ); let new_self_play = WebRtcPlayEndpoint::new( @@ -212,7 +212,7 @@ impl Member { spec_play_endpoint.src.clone(), new_publish.downgrade(), this_member.downgrade(), - spec_play_endpoint.is_force_relay, + spec_play_endpoint.force_relay, ); new_publish.add_sink(new_self_play.downgrade()); @@ -233,7 +233,7 @@ impl Member { endpoint_id, e.p2p, this_member.downgrade(), - e.is_force_relay, + e.force_relay, )); }); @@ -380,7 +380,7 @@ impl Member { spec.src, src.downgrade(), member.downgrade(), - spec.is_force_relay, + spec.force_relay, ); src.add_sink(sink.downgrade()); diff --git a/src/signalling/peers.rs b/src/signalling/peers.rs index 169c5deb8..30795dd16 100644 --- a/src/signalling/peers.rs +++ b/src/signalling/peers.rs @@ -98,14 +98,14 @@ impl PeerRepository { src_member_id.clone(), sink_peer_id, sink_member_id.clone(), - src.is_force_relay(), + src.is_force_relayed(), ); let second_peer = Peer::new( sink_peer_id, sink_member_id, src_peer_id, src_member_id, - sink.is_force_relay(), + sink.is_force_relayed(), ); (first_peer, second_peer) diff --git a/src/signalling/room.rs b/src/signalling/room.rs index 19927eb95..b1058bb20 100644 --- a/src/signalling/room.rs +++ b/src/signalling/room.rs @@ -248,7 +248,7 @@ impl Room { sdp_offer: None, tracks: sender.tracks(), ice_servers, - is_force_relay: sender.is_force_relay(), + force_relay: sender.is_force_relayed(), }; self.peers.add_peer(sender); Ok(Box::new(wrap_future( @@ -574,7 +574,7 @@ impl Room { String::from(play_id).into(), spec.p2p, member.downgrade(), - spec.is_force_relay, + spec.force_relay, ); debug!( @@ -634,7 +634,7 @@ impl Room { spec.src, src.downgrade(), member.downgrade(), - spec.is_force_relay, + spec.force_relay, ); src.add_sink(sink.downgrade()); @@ -686,7 +686,7 @@ impl Room { id.clone(), publish.p2p, signalling_member.downgrade(), - publish.is_force_relay, + publish.force_relay, ); signalling_member.insert_src(signalling_publish); } @@ -709,7 +709,7 @@ impl Room { play.src.clone(), src.downgrade(), signalling_member.downgrade(), - play.is_force_relay, + play.force_relay, ); signalling_member.insert_sink(sink); @@ -821,7 +821,7 @@ impl CommandHandler for Room { sdp_offer: Some(sdp_offer), tracks: to_peer.tracks(), ice_servers, - is_force_relay: to_peer.is_force_relay(), + force_relay: to_peer.is_force_relayed(), }; self.peers.add_peer(from_peer); diff --git a/tests/e2e/signalling/pub_sub_signallng.rs b/tests/e2e/signalling/pub_sub_signallng.rs index e7f8b4971..4a875dd5b 100644 --- a/tests/e2e/signalling/pub_sub_signallng.rs +++ b/tests/e2e/signalling/pub_sub_signallng.rs @@ -30,7 +30,7 @@ fn pub_sub_video_call() { sdp_offer, tracks, ice_servers, - is_force_relay, + force_relay, } = &events[0] { assert_eq!(ice_servers.len(), 2); @@ -46,7 +46,7 @@ fn pub_sub_video_call() { ice_servers[1].urls[1], "turn:localhost:3478?transport=tcp".to_string() ); - assert_eq!(is_force_relay, &true); + assert_eq!(force_relay, &true); if sdp_offer.is_some() { is_caller = false; diff --git a/tests/specs/pub-sub-video-call.yml b/tests/specs/pub-sub-video-call.yml index e4e7d6c62..a4b01f869 100644 --- a/tests/specs/pub-sub-video-call.yml +++ b/tests/specs/pub-sub-video-call.yml @@ -11,7 +11,7 @@ spec: kind: WebRtcPublishEndpoint spec: p2p: Always - is_force_relay: true + force_relay: true responder: kind: Member credentials: test @@ -21,4 +21,4 @@ spec: kind: WebRtcPlayEndpoint spec: src: "local://pub-sub-video-call/caller/publish" - is_force_relay: true + force_relay: true