cancellable SignalClient & tracing
This commit is contained in:
@@ -18,7 +18,7 @@ pub struct DataChannel {
|
||||
|
||||
impl Debug for DataChannel {
|
||||
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
|
||||
write!(f, "DataChannel [{:?}]", self.label())
|
||||
write!(f, "DataChannel[{}]", self.label())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,8 +100,7 @@ impl DataChannel {
|
||||
}
|
||||
|
||||
pub type OnStateChangeHandler = Box<dyn FnMut() + Send + Sync>;
|
||||
pub type OnMessageHandler = Box<dyn FnMut(&[u8], bool) + Send + Sync>;
|
||||
// data, is_binary
|
||||
pub type OnMessageHandler = Box<dyn FnMut(&[u8], bool) + Send + Sync>; // data, is_binary
|
||||
pub type OnBufferedAmountChangeHandler = Box<dyn FnMut(u64) + Send + Sync>;
|
||||
|
||||
struct InternalDataChannelObserver {
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
use std::fmt::{Debug, Display, Formatter, write};
|
||||
use cxx::UniquePtr;
|
||||
use libwebrtc_sys::jsep as sys_jsep;
|
||||
|
||||
pub use sys_jsep::ffi::{SdpType, SdpParseError};
|
||||
|
||||
// TODO Maybe we can replace that by a serialized IceCandidateInit
|
||||
#[derive(Debug)]
|
||||
pub struct IceCandidate {
|
||||
cxx_handle: UniquePtr<sys_jsep::ffi::IceCandidate>,
|
||||
}
|
||||
|
||||
impl Debug for IceCandidate {
|
||||
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
|
||||
write!(f, "IceCandidate[{}]", self.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl IceCandidate {
|
||||
pub fn from(sdp_mid: &str, sdp_mline_index: i32, sdp: &str) -> Result<IceCandidate, SdpParseError> {
|
||||
let res = sys_jsep::ffi::create_ice_candidate(sdp_mid.to_string(), sdp_mline_index, sdp.to_string());
|
||||
@@ -46,11 +52,16 @@ impl ToString for IceCandidate {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SessionDescription {
|
||||
cxx_handle: UniquePtr<sys_jsep::ffi::SessionDescription>,
|
||||
}
|
||||
|
||||
impl Debug for SessionDescription {
|
||||
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
|
||||
write!(f, "SessionDescription[{}]", self.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl SessionDescription {
|
||||
pub fn from(sdp_type: SdpType, description: &str) -> Result<SessionDescription, SdpParseError> {
|
||||
let res = sys_jsep::ffi::create_session_description(sdp_type, description.to_string());
|
||||
|
||||
Reference in New Issue
Block a user