2018-04-23 17:34:22 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2018-02-09 02:30:08 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-22 10:40:56 +00:00
|
|
|
use crate::RTSPToken;
|
2019-01-16 11:32:39 +00:00
|
|
|
use glib::object::Cast;
|
2018-02-09 02:30:08 +00:00
|
|
|
use glib::object::IsA;
|
2018-12-08 09:05:20 +00:00
|
|
|
use glib::signal::connect_raw;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::signal::SignalHandlerId;
|
2018-02-09 02:30:08 +00:00
|
|
|
use glib::translate::*;
|
2018-02-23 02:33:37 +00:00
|
|
|
use std::boxed::Box as Box_;
|
2020-04-13 16:11:33 +00:00
|
|
|
use std::mem::transmute;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2020-11-22 10:40:56 +00:00
|
|
|
pub struct RTSPAuth(Object<ffi::GstRTSPAuth, ffi::GstRTSPAuthClass>);
|
2018-02-09 02:30:08 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_rtsp_auth_get_type(),
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl RTSPAuth {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_new")]
|
2018-02-09 02:30:08 +00:00
|
|
|
pub fn new() -> RTSPAuth {
|
|
|
|
assert_initialized_main_thread!();
|
2020-11-22 10:40:56 +00:00
|
|
|
unsafe { from_glib_full(ffi::gst_rtsp_auth_new()) }
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_check")]
|
2019-02-04 14:56:17 +00:00
|
|
|
pub fn check(check: &str) -> Result<(), glib::error::BoolError> {
|
2018-02-09 02:30:08 +00:00
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_auth_check(check.to_glib_none().0),
|
2019-06-18 10:12:00 +00:00
|
|
|
"Check failed"
|
|
|
|
)
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_make_basic")]
|
2020-11-22 10:40:56 +00:00
|
|
|
pub fn make_basic(user: &str, pass: &str) -> glib::GString {
|
2018-02-09 02:30:08 +00:00
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib_full(ffi::gst_rtsp_auth_make_basic(
|
2019-06-18 10:12:00 +00:00
|
|
|
user.to_glib_none().0,
|
|
|
|
pass.to_glib_none().0,
|
|
|
|
))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for RTSPAuth {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self::new()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for RTSPAuth {}
|
|
|
|
unsafe impl Sync for RTSPAuth {}
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
pub const NONE_RTSP_AUTH: Option<&RTSPAuth> = None;
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait RTSPAuthExt: 'static {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_add_basic")]
|
2018-03-01 23:46:12 +00:00
|
|
|
fn add_basic(&self, basic: &str, token: &RTSPToken);
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_add_digest")]
|
2018-03-01 23:46:12 +00:00
|
|
|
fn add_digest(&self, user: &str, pass: &str, token: &RTSPToken);
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_get_default_token")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn default_token(&self) -> Option<RTSPToken>;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_get_realm")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn realm(&self) -> Option<glib::GString>;
|
2019-04-23 14:32:09 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_get_supported_methods")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn supported_methods(&self) -> gst_rtsp::RTSPAuthMethod;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_get_tls_authentication_mode")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn tls_authentication_mode(&self) -> gio::TlsAuthenticationMode;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_get_tls_certificate")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn tls_certificate(&self) -> Option<gio::TlsCertificate>;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_get_tls_database")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn tls_database(&self) -> Option<gio::TlsDatabase>;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_parse_htdigest")]
|
2019-04-23 14:32:09 +00:00
|
|
|
fn parse_htdigest<P: AsRef<std::path::Path>>(&self, path: P, token: &RTSPToken) -> bool;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_remove_basic")]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn remove_basic(&self, basic: &str);
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_remove_digest")]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn remove_digest(&self, user: &str);
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_set_realm")]
|
2019-04-23 14:32:09 +00:00
|
|
|
fn set_realm(&self, realm: &str);
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_set_supported_methods")]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn set_supported_methods(&self, methods: gst_rtsp::RTSPAuthMethod);
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_set_tls_authentication_mode")]
|
2018-02-23 02:33:37 +00:00
|
|
|
fn set_tls_authentication_mode(&self, mode: gio::TlsAuthenticationMode);
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_set_tls_certificate")]
|
2019-03-19 07:40:05 +00:00
|
|
|
fn set_tls_certificate<P: IsA<gio::TlsCertificate>>(&self, cert: Option<&P>);
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_rtsp_auth_set_tls_database")]
|
2019-03-19 07:40:05 +00:00
|
|
|
fn set_tls_database<P: IsA<gio::TlsDatabase>>(&self, database: Option<&P>);
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_accept_certificate<
|
|
|
|
F: Fn(&Self, &gio::TlsConnection, &gio::TlsCertificate, gio::TlsCertificateFlags) -> bool
|
|
|
|
+ Send
|
|
|
|
+ Sync
|
|
|
|
+ 'static,
|
|
|
|
>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
|
2018-03-01 23:46:12 +00:00
|
|
|
fn add_basic(&self, basic: &str, token: &RTSPToken) {
|
2018-02-23 02:33:37 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_auth_add_basic(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
basic.to_glib_none().0,
|
|
|
|
token.to_glib_none().0,
|
|
|
|
);
|
2018-02-23 02:33:37 +00:00
|
|
|
}
|
|
|
|
}
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2018-03-01 23:46:12 +00:00
|
|
|
fn add_digest(&self, user: &str, pass: &str, token: &RTSPToken) {
|
2018-02-23 02:33:37 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_auth_add_digest(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
user.to_glib_none().0,
|
|
|
|
pass.to_glib_none().0,
|
|
|
|
token.to_glib_none().0,
|
|
|
|
);
|
2018-02-23 02:33:37 +00:00
|
|
|
}
|
|
|
|
}
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn default_token(&self) -> Option<RTSPToken> {
|
2018-02-23 02:33:37 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib_full(ffi::gst_rtsp_auth_get_default_token(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-02-23 02:33:37 +00:00
|
|
|
}
|
|
|
|
}
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn realm(&self) -> Option<glib::GString> {
|
2020-11-22 10:40:56 +00:00
|
|
|
unsafe { from_glib_full(ffi::gst_rtsp_auth_get_realm(self.as_ref().to_glib_none().0)) }
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn supported_methods(&self) -> gst_rtsp::RTSPAuthMethod {
|
2018-02-09 02:30:08 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib(ffi::gst_rtsp_auth_get_supported_methods(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn tls_authentication_mode(&self) -> gio::TlsAuthenticationMode {
|
2018-02-23 02:33:37 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib(ffi::gst_rtsp_auth_get_tls_authentication_mode(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-02-23 02:33:37 +00:00
|
|
|
}
|
|
|
|
}
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn tls_certificate(&self) -> Option<gio::TlsCertificate> {
|
2018-02-09 02:30:08 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib_full(ffi::gst_rtsp_auth_get_tls_certificate(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn tls_database(&self) -> Option<gio::TlsDatabase> {
|
2018-02-23 02:33:37 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib_full(ffi::gst_rtsp_auth_get_tls_database(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-02-23 02:33:37 +00:00
|
|
|
}
|
|
|
|
}
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
2019-04-23 14:32:09 +00:00
|
|
|
fn parse_htdigest<P: AsRef<std::path::Path>>(&self, path: P, token: &RTSPToken) -> bool {
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib(ffi::gst_rtsp_auth_parse_htdigest(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
path.as_ref().to_glib_none().0,
|
|
|
|
token.to_glib_none().0,
|
|
|
|
))
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-09 02:30:08 +00:00
|
|
|
fn remove_basic(&self, basic: &str) {
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_auth_remove_basic(self.as_ref().to_glib_none().0, basic.to_glib_none().0);
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn remove_digest(&self, user: &str) {
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_auth_remove_digest(self.as_ref().to_glib_none().0, user.to_glib_none().0);
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_16", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
2019-04-23 14:32:09 +00:00
|
|
|
fn set_realm(&self, realm: &str) {
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_auth_set_realm(self.as_ref().to_glib_none().0, realm.to_glib_none().0);
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn set_supported_methods(&self, methods: gst_rtsp::RTSPAuthMethod) {
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_auth_set_supported_methods(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
methods.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-23 02:33:37 +00:00
|
|
|
fn set_tls_authentication_mode(&self, mode: gio::TlsAuthenticationMode) {
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_auth_set_tls_authentication_mode(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
mode.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2018-02-23 02:33:37 +00:00
|
|
|
}
|
|
|
|
}
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2019-03-19 07:40:05 +00:00
|
|
|
fn set_tls_certificate<P: IsA<gio::TlsCertificate>>(&self, cert: Option<&P>) {
|
2018-02-09 02:30:08 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_auth_set_tls_certificate(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
cert.map(|p| p.as_ref()).to_glib_none().0,
|
|
|
|
);
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-19 07:40:05 +00:00
|
|
|
fn set_tls_database<P: IsA<gio::TlsDatabase>>(&self, database: Option<&P>) {
|
2018-02-23 02:33:37 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_auth_set_tls_database(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
database.map(|p| p.as_ref()).to_glib_none().0,
|
|
|
|
);
|
2018-02-23 02:33:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_accept_certificate<
|
|
|
|
F: Fn(&Self, &gio::TlsConnection, &gio::TlsCertificate, gio::TlsCertificateFlags) -> bool
|
|
|
|
+ Send
|
|
|
|
+ Sync
|
|
|
|
+ 'static,
|
|
|
|
>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn accept_certificate_trampoline<
|
|
|
|
P,
|
|
|
|
F: Fn(&P, &gio::TlsConnection, &gio::TlsCertificate, gio::TlsCertificateFlags) -> bool
|
|
|
|
+ Send
|
|
|
|
+ Sync
|
|
|
|
+ 'static,
|
|
|
|
>(
|
2020-11-22 10:40:56 +00:00
|
|
|
this: *mut ffi::GstRTSPAuth,
|
|
|
|
connection: *mut gio::ffi::GTlsConnection,
|
|
|
|
peer_cert: *mut gio::ffi::GTlsCertificate,
|
|
|
|
errors: gio::ffi::GTlsCertificateFlags,
|
|
|
|
f: glib::ffi::gpointer,
|
|
|
|
) -> glib::ffi::gboolean
|
2019-06-18 10:12:00 +00:00
|
|
|
where
|
|
|
|
P: IsA<RTSPAuth>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2020-04-05 14:52:56 +00:00
|
|
|
&RTSPAuth::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&from_glib_borrow(connection),
|
|
|
|
&from_glib_borrow(peer_cert),
|
|
|
|
from_glib(errors),
|
|
|
|
)
|
2021-04-27 15:10:39 +00:00
|
|
|
.into_glib()
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-02-23 02:33:37 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"accept-certificate\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
accept_certificate_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-02-23 02:33:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|