Skip to main content

gstreamer_webrtc/
web_rtc_ice_candidate_pair.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::{WebRTCICECandidate, WebRTCICECandidatePair};
4
5impl WebRTCICECandidatePair {
6    pub fn local(&self) -> Option<&WebRTCICECandidate> {
7        unsafe {
8            if (*self.as_ptr()).local.is_null() {
9                None
10            } else {
11                Some(WebRTCICECandidate::from_glib_ptr_borrow(
12                    &(*self.as_ptr()).local,
13                ))
14            }
15        }
16    }
17
18    pub fn remote(&self) -> Option<&WebRTCICECandidate> {
19        unsafe {
20            if (*self.as_ptr()).remote.is_null() {
21                None
22            } else {
23                Some(WebRTCICECandidate::from_glib_ptr_borrow(
24                    &(*self.as_ptr()).remote,
25                ))
26            }
27        }
28    }
29}