gstreamer_rtsp/
rtsp_auth_credential.rs

1use crate::{ffi, RTSPAuthCredential, RTSPAuthMethod, RTSPAuthParam};
2use glib::translate::*;
3
4impl RTSPAuthCredential {
5    pub fn scheme(&self) -> RTSPAuthMethod {
6        let ptr: *mut ffi::GstRTSPAuthCredential = self.to_glib_none().0;
7        unsafe { from_glib((*ptr).scheme) }
8    }
9
10    pub fn authorization(&self) -> Option<&str> {
11        let ptr: *mut ffi::GstRTSPAuthCredential = self.to_glib_none().0;
12        unsafe {
13            if (*ptr).authorization.is_null() {
14                None
15            } else {
16                std::ffi::CStr::from_ptr((*ptr).authorization).to_str().ok()
17            }
18        }
19    }
20
21    pub fn params(&self) -> glib::collections::PtrSlice<RTSPAuthParam> {
22        let ptr: *mut ffi::GstRTSPAuthCredential = self.to_glib_none().0;
23        unsafe { FromGlibPtrContainer::from_glib_none((*ptr).params) }
24    }
25}