mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-25 00:18:26 +00:00
4ebec84f5e
Allows us to set all the crates in the main workspace file, so changing their versions or branch is much simpler and reduce the amount of noise in the diff Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1450>
25 lines
855 B
Rust
25 lines
855 B
Rust
use crate::{ffi, RTSPAuthCredential, RTSPAuthMethod, RTSPAuthParam};
|
|
use glib::translate::*;
|
|
|
|
impl RTSPAuthCredential {
|
|
pub fn scheme(&self) -> RTSPAuthMethod {
|
|
let ptr: *mut ffi::GstRTSPAuthCredential = self.to_glib_none().0;
|
|
unsafe { from_glib((*ptr).scheme) }
|
|
}
|
|
|
|
pub fn authorization(&self) -> Option<&str> {
|
|
let ptr: *mut ffi::GstRTSPAuthCredential = self.to_glib_none().0;
|
|
unsafe {
|
|
if (*ptr).authorization.is_null() {
|
|
None
|
|
} else {
|
|
std::ffi::CStr::from_ptr((*ptr).authorization).to_str().ok()
|
|
}
|
|
}
|
|
}
|
|
|
|
pub fn params(&self) -> glib::collections::PtrSlice<RTSPAuthParam> {
|
|
let ptr: *mut ffi::GstRTSPAuthCredential = self.to_glib_none().0;
|
|
unsafe { FromGlibPtrContainer::from_glib_none((*ptr).params) }
|
|
}
|
|
}
|