2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-11-27 13:37:49 +00:00
|
|
|
#![cfg_attr(feature = "dox", feature(doc_cfg))]
|
2021-07-30 19:23:46 +00:00
|
|
|
#![allow(clippy::missing_safety_doc)]
|
2022-01-13 21:12:53 +00:00
|
|
|
#![allow(clippy::non_send_fields_in_send_ty)]
|
2021-07-30 16:03:12 +00:00
|
|
|
#![doc = include_str!("../README.md")]
|
2020-11-18 12:48:41 +00:00
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
pub use ffi;
|
2020-12-20 17:39:15 +00:00
|
|
|
pub use gio;
|
|
|
|
pub use glib;
|
|
|
|
pub use gst;
|
|
|
|
pub use gst_net;
|
|
|
|
pub use gst_rtsp;
|
|
|
|
pub use gst_sdp;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
|
|
|
macro_rules! assert_initialized_main_thread {
|
2018-04-01 08:30:03 +00:00
|
|
|
() => {
|
2022-06-27 07:28:28 +00:00
|
|
|
if !gst::INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) {
|
|
|
|
#[allow(unused_unsafe)]
|
|
|
|
if unsafe { gst::ffi::gst_is_initialized() } != glib::ffi::GTRUE {
|
|
|
|
panic!("GStreamer has not been initialized. Call `gst::init` first.");
|
|
|
|
} else {
|
|
|
|
gst::INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst);
|
|
|
|
}
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
2018-04-01 08:30:03 +00:00
|
|
|
};
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! skip_assert_initialized {
|
2018-04-01 08:30:03 +00:00
|
|
|
() => {};
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
|
2019-02-28 08:32:13 +00:00
|
|
|
#[allow(clippy::unreadable_literal)]
|
|
|
|
#[allow(clippy::too_many_arguments)]
|
|
|
|
#[allow(clippy::match_same_arms)]
|
|
|
|
#[allow(clippy::type_complexity)]
|
2019-09-07 10:08:09 +00:00
|
|
|
#[allow(clippy::let_and_return)]
|
2021-04-29 20:06:11 +00:00
|
|
|
#[allow(clippy::use_self)]
|
2021-11-06 17:09:27 +00:00
|
|
|
#[allow(unused_imports)]
|
2018-02-09 02:30:08 +00:00
|
|
|
mod auto;
|
2020-11-22 10:45:51 +00:00
|
|
|
pub use crate::auto::*;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2022-09-12 16:32:16 +00:00
|
|
|
#[cfg(feature = "serde")]
|
2022-05-05 10:40:07 +00:00
|
|
|
mod flag_serde;
|
|
|
|
|
2018-04-23 17:37:08 +00:00
|
|
|
mod rtsp_address_pool;
|
|
|
|
mod rtsp_auth;
|
|
|
|
mod rtsp_client;
|
|
|
|
mod rtsp_context;
|
2020-02-23 08:00:05 +00:00
|
|
|
mod rtsp_media;
|
2018-04-23 17:37:08 +00:00
|
|
|
mod rtsp_media_factory;
|
2022-02-18 11:21:10 +00:00
|
|
|
mod rtsp_onvif_media_factory;
|
2018-04-23 17:37:08 +00:00
|
|
|
mod rtsp_server;
|
2022-09-13 09:13:07 +00:00
|
|
|
mod rtsp_session;
|
2018-04-23 17:37:08 +00:00
|
|
|
mod rtsp_session_pool;
|
2020-02-23 07:58:54 +00:00
|
|
|
mod rtsp_thread;
|
2018-04-23 17:37:08 +00:00
|
|
|
mod rtsp_token;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-02-23 08:00:05 +00:00
|
|
|
pub mod subclass;
|
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
pub use crate::rtsp_context::*;
|
2021-04-24 20:41:35 +00:00
|
|
|
pub use crate::rtsp_thread::*;
|
2020-11-22 10:45:51 +00:00
|
|
|
pub use crate::rtsp_token::*;
|
2018-02-23 02:33:37 +00:00
|
|
|
|
2020-01-22 17:38:13 +00:00
|
|
|
use once_cell::sync::Lazy;
|
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
use std::ffi::CStr;
|
|
|
|
|
2020-01-22 17:38:13 +00:00
|
|
|
pub static RTSP_ADDRESS_POOL_ANY_IPV4: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_ADDRESS_POOL_ANY_IPV4)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
|
|
|
pub static RTSP_ADDRESS_POOL_ANY_IPV6: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_ADDRESS_POOL_ANY_IPV6)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
|
|
|
pub static RTSP_AUTH_CHECK_CONNECT: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_CONNECT)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
|
|
|
pub static RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
|
|
|
pub static RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
|
|
|
pub static RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
|
|
|
pub static RTSP_AUTH_CHECK_URL: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_AUTH_CHECK_URL)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
|
|
|
pub static RTSP_PERM_MEDIA_FACTORY_ACCESS: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_PERM_MEDIA_FACTORY_ACCESS)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
|
|
|
pub static RTSP_PERM_MEDIA_FACTORY_CONSTRUCT: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
|
|
|
pub static RTSP_TOKEN_MEDIA_FACTORY_ROLE: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
|
|
|
pub static RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS: Lazy<&'static str> = Lazy::new(|| unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
CStr::from_ptr(ffi::GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS)
|
2020-01-22 17:38:13 +00:00
|
|
|
.to_str()
|
|
|
|
.unwrap()
|
|
|
|
});
|
2018-02-15 15:03:31 +00:00
|
|
|
|
2018-02-09 02:30:08 +00:00
|
|
|
// Re-export all the traits in a prelude module, so that applications
|
2021-04-27 07:30:13 +00:00
|
|
|
// can always "use gst_rtsp_server::prelude::*" without getting conflicts
|
2018-02-09 02:30:08 +00:00
|
|
|
pub mod prelude {
|
2020-12-20 17:39:15 +00:00
|
|
|
#[doc(hidden)]
|
|
|
|
pub use gio::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
|
|
pub use gst_net::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
|
|
pub use gst_rtsp::prelude::*;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
pub use crate::auto::traits::*;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
pub use crate::rtsp_address_pool::RTSPAddressPoolExtManual;
|
|
|
|
pub use crate::rtsp_auth::RTSPAuthExtManual;
|
|
|
|
pub use crate::rtsp_client::RTSPClientExtManual;
|
|
|
|
pub use crate::rtsp_media::RTSPMediaExtManual;
|
|
|
|
pub use crate::rtsp_media_factory::RTSPMediaFactoryExtManual;
|
2022-02-18 11:21:10 +00:00
|
|
|
pub use crate::rtsp_onvif_media_factory::RTSPOnvifMediaFactoryExtManual;
|
2020-11-22 10:45:51 +00:00
|
|
|
pub use crate::rtsp_server::RTSPServerExtManual;
|
2022-09-13 09:13:07 +00:00
|
|
|
pub use crate::rtsp_session::RTSPSessionExtManual;
|
2020-11-22 10:45:51 +00:00
|
|
|
pub use crate::rtsp_session_pool::RTSPSessionPoolExtManual;
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|