Make RemoteTrackPublication a tuple struct again
This commit is contained in:
parent
356f9fc3b6
commit
e3c603f41b
1 changed files with 6 additions and 13 deletions
|
@ -723,29 +723,22 @@ impl Drop for LocalTrackPublication {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct RemoteTrackPublication {
|
pub struct RemoteTrackPublication(swift::RemoteTrackPublication);
|
||||||
native_publication: swift::RemoteTrackPublication,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl RemoteTrackPublication {
|
impl RemoteTrackPublication {
|
||||||
pub fn new(native_track_publication: swift::RemoteTrackPublication) -> Self {
|
pub fn new(native_track_publication: swift::RemoteTrackPublication) -> Self {
|
||||||
unsafe {
|
unsafe {
|
||||||
CFRetain(native_track_publication.0);
|
CFRetain(native_track_publication.0);
|
||||||
}
|
}
|
||||||
Self {
|
Self(native_track_publication)
|
||||||
native_publication: native_track_publication,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn sid(&self) -> String {
|
pub fn sid(&self) -> String {
|
||||||
unsafe {
|
unsafe { CFString::wrap_under_get_rule(LKRemoteTrackPublicationGetSid(self.0)).to_string() }
|
||||||
CFString::wrap_under_get_rule(LKRemoteTrackPublicationGetSid(self.native_publication))
|
|
||||||
.to_string()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_muted(&self) -> bool {
|
pub fn is_muted(&self) -> bool {
|
||||||
unsafe { LKRemoteTrackPublicationIsMuted(self.native_publication) }
|
unsafe { LKRemoteTrackPublicationIsMuted(self.0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_enabled(&self, enabled: bool) -> impl Future<Output = Result<()>> {
|
pub fn set_enabled(&self, enabled: bool) -> impl Future<Output = Result<()>> {
|
||||||
|
@ -763,7 +756,7 @@ impl RemoteTrackPublication {
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
LKRemoteTrackPublicationSetEnabled(
|
LKRemoteTrackPublicationSetEnabled(
|
||||||
self.native_publication,
|
self.0,
|
||||||
enabled,
|
enabled,
|
||||||
complete_callback,
|
complete_callback,
|
||||||
Box::into_raw(Box::new(tx)) as *mut c_void,
|
Box::into_raw(Box::new(tx)) as *mut c_void,
|
||||||
|
@ -776,7 +769,7 @@ impl RemoteTrackPublication {
|
||||||
|
|
||||||
impl Drop for RemoteTrackPublication {
|
impl Drop for RemoteTrackPublication {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe { CFRelease(self.native_publication.0) }
|
unsafe { CFRelease(self.0 .0) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue