gstreamer-rs/gstreamer-rtsp-server/src/auto/r_t_s_p_auth.rs
Mathieu Duponchelle a00243d529 Add initial libgstsdp, libgstrtsp and libgstrtspserver bindings
Only automatic bindings for now, which is enough to allow
implementing a simple rtsp-server example.

Depends on https://github.com/sdroege/gstreamer-sys/pull/8

Uses a new gir feature proposed at
https://github.com/gtk-rs/gir/pull/539 to make doc regeneration
easier.

Fixes https://github.com/sdroege/gstreamer-rs/pull/80
2018-02-14 18:57:58 +02:00

171 lines
5.5 KiB
Rust

// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
use ffi;
use gio;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
#[cfg(any(feature = "v1_12", feature = "dox"))]
use gst_rtsp;
use std::mem;
use std::ptr;
glib_wrapper! {
pub struct RTSPAuth(Object<ffi::GstRTSPAuth, ffi::GstRTSPAuthClass>);
match fn {
get_type => || ffi::gst_rtsp_auth_get_type(),
}
}
impl RTSPAuth {
pub fn new() -> RTSPAuth {
assert_initialized_main_thread!();
unsafe {
from_glib_full(ffi::gst_rtsp_auth_new())
}
}
pub fn check(check: &str) -> bool {
assert_initialized_main_thread!();
unsafe {
from_glib(ffi::gst_rtsp_auth_check(check.to_glib_none().0))
}
}
pub fn make_basic(user: &str, pass: &str) -> String {
assert_initialized_main_thread!();
unsafe {
from_glib_full(ffi::gst_rtsp_auth_make_basic(user.to_glib_none().0, pass.to_glib_none().0))
}
}
}
impl Default for RTSPAuth {
fn default() -> Self {
Self::new()
}
}
unsafe impl Send for RTSPAuth {}
unsafe impl Sync for RTSPAuth {}
pub trait RTSPAuthExt {
//fn add_basic(&self, basic: &str, token: /*Ignored*/&mut RTSPToken);
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn add_digest(&self, user: &str, pass: &str, token: /*Ignored*/&mut RTSPToken);
//fn get_default_token(&self) -> /*Ignored*/Option<RTSPToken>;
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn get_supported_methods(&self) -> gst_rtsp::RTSPAuthMethod;
//fn get_tls_authentication_mode(&self) -> /*Ignored*/gio::TlsAuthenticationMode;
fn get_tls_certificate(&self) -> Option<gio::TlsCertificate>;
//fn get_tls_database(&self) -> /*Ignored*/Option<gio::TlsDatabase>;
fn remove_basic(&self, basic: &str);
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn remove_digest(&self, user: &str);
//fn set_default_token<'a, P: Into<Option<&'a /*Ignored*/RTSPToken>>>(&self, token: P);
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn set_supported_methods(&self, methods: gst_rtsp::RTSPAuthMethod);
//fn set_tls_authentication_mode<'a, P: Into<Option<&'a /*Ignored*/gio::TlsAuthenticationMode>>>(&self, mode: P);
fn set_tls_certificate<'a, P: Into<Option<&'a gio::TlsCertificate>>>(&self, cert: P);
//fn set_tls_database<'a, P: IsA</*Ignored*/gio::TlsDatabase> + 'a, Q: Into<Option<&'a P>>>(&self, database: Q);
//fn connect_accept_certificate<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<RTSPAuth>> RTSPAuthExt for O {
//fn add_basic(&self, basic: &str, token: /*Ignored*/&mut RTSPToken) {
// unsafe { TODO: call ffi::gst_rtsp_auth_add_basic() }
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn add_digest(&self, user: &str, pass: &str, token: /*Ignored*/&mut RTSPToken) {
// unsafe { TODO: call ffi::gst_rtsp_auth_add_digest() }
//}
//fn get_default_token(&self) -> /*Ignored*/Option<RTSPToken> {
// unsafe { TODO: call ffi::gst_rtsp_auth_get_default_token() }
//}
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn get_supported_methods(&self) -> gst_rtsp::RTSPAuthMethod {
unsafe {
from_glib(ffi::gst_rtsp_auth_get_supported_methods(self.to_glib_none().0))
}
}
//fn get_tls_authentication_mode(&self) -> /*Ignored*/gio::TlsAuthenticationMode {
// unsafe { TODO: call ffi::gst_rtsp_auth_get_tls_authentication_mode() }
//}
fn get_tls_certificate(&self) -> Option<gio::TlsCertificate> {
unsafe {
from_glib_full(ffi::gst_rtsp_auth_get_tls_certificate(self.to_glib_none().0))
}
}
//fn get_tls_database(&self) -> /*Ignored*/Option<gio::TlsDatabase> {
// unsafe { TODO: call ffi::gst_rtsp_auth_get_tls_database() }
//}
fn remove_basic(&self, basic: &str) {
unsafe {
ffi::gst_rtsp_auth_remove_basic(self.to_glib_none().0, basic.to_glib_none().0);
}
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn remove_digest(&self, user: &str) {
unsafe {
ffi::gst_rtsp_auth_remove_digest(self.to_glib_none().0, user.to_glib_none().0);
}
}
//fn set_default_token<'a, P: Into<Option<&'a /*Ignored*/RTSPToken>>>(&self, token: P) {
// unsafe { TODO: call ffi::gst_rtsp_auth_set_default_token() }
//}
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn set_supported_methods(&self, methods: gst_rtsp::RTSPAuthMethod) {
unsafe {
ffi::gst_rtsp_auth_set_supported_methods(self.to_glib_none().0, methods.to_glib());
}
}
//fn set_tls_authentication_mode<'a, P: Into<Option<&'a /*Ignored*/gio::TlsAuthenticationMode>>>(&self, mode: P) {
// unsafe { TODO: call ffi::gst_rtsp_auth_set_tls_authentication_mode() }
//}
fn set_tls_certificate<'a, P: Into<Option<&'a gio::TlsCertificate>>>(&self, cert: P) {
let cert = cert.into();
let cert = cert.to_glib_none();
unsafe {
ffi::gst_rtsp_auth_set_tls_certificate(self.to_glib_none().0, cert.0);
}
}
//fn set_tls_database<'a, P: IsA</*Ignored*/gio::TlsDatabase> + 'a, Q: Into<Option<&'a P>>>(&self, database: Q) {
// unsafe { TODO: call ffi::gst_rtsp_auth_set_tls_database() }
//}
//fn connect_accept_certificate<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored connection: Gio.TlsConnection
//}
}