2024-06-02 08:48:53 +00:00
|
|
|
use crate::{ffi, RTSPAuthCredential, RTSPAuthMethod, RTSPAuthParam};
|
2023-12-08 15:48:03 +00:00
|
|
|
use glib::translate::*;
|
|
|
|
|
|
|
|
impl RTSPAuthCredential {
|
|
|
|
pub fn scheme(&self) -> RTSPAuthMethod {
|
2024-06-02 08:48:53 +00:00
|
|
|
let ptr: *mut ffi::GstRTSPAuthCredential = self.to_glib_none().0;
|
2023-12-08 15:48:03 +00:00
|
|
|
unsafe { from_glib((*ptr).scheme) }
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn authorization(&self) -> Option<&str> {
|
2024-06-02 08:48:53 +00:00
|
|
|
let ptr: *mut ffi::GstRTSPAuthCredential = self.to_glib_none().0;
|
2023-12-08 15:48:03 +00:00
|
|
|
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> {
|
2024-06-02 08:48:53 +00:00
|
|
|
let ptr: *mut ffi::GstRTSPAuthCredential = self.to_glib_none().0;
|
2023-12-08 15:48:03 +00:00
|
|
|
unsafe { FromGlibPtrContainer::from_glib_none((*ptr).params) }
|
|
|
|
}
|
|
|
|
}
|