cancellable SignalClient & tracing
This commit is contained in:
@@ -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