gstreamer_rtsp_server/
lib.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3#![cfg_attr(docsrs, feature(doc_cfg))]
4#![allow(clippy::missing_safety_doc)]
5#![allow(clippy::manual_c_str_literals)]
6#![doc = include_str!("../README.md")]
7
8pub use gio;
9pub use glib;
10pub use gst;
11pub use gst_net;
12pub use gst_rtsp;
13pub use gst_sdp;
14pub use gstreamer_rtsp_server_sys as ffi;
15
16macro_rules! assert_initialized_main_thread {
17    () => {
18        if !gst::INITIALIZED.load(std::sync::atomic::Ordering::SeqCst) {
19            gst::assert_initialized();
20        }
21    };
22}
23
24macro_rules! skip_assert_initialized {
25    () => {};
26}
27
28#[allow(clippy::type_complexity)]
29#[allow(unused_imports)]
30mod auto;
31pub use crate::auto::*;
32
33#[cfg(feature = "serde")]
34mod flag_serde;
35
36mod rtsp_address_pool;
37mod rtsp_auth;
38mod rtsp_client;
39mod rtsp_context;
40mod rtsp_media;
41mod rtsp_media_factory;
42mod rtsp_onvif_media_factory;
43mod rtsp_server;
44mod rtsp_session;
45mod rtsp_session_pool;
46mod rtsp_thread;
47mod rtsp_token;
48
49pub mod subclass;
50
51pub use crate::{rtsp_context::*, rtsp_thread::*, rtsp_token::*};
52
53pub static RTSP_ADDRESS_POOL_ANY_IPV4: &glib::GStr =
54    unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_ADDRESS_POOL_ANY_IPV4) };
55pub static RTSP_ADDRESS_POOL_ANY_IPV6: &glib::GStr =
56    unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_ADDRESS_POOL_ANY_IPV6) };
57pub static RTSP_AUTH_CHECK_CONNECT: &glib::GStr =
58    unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_AUTH_CHECK_CONNECT) };
59pub static RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS: &glib::GStr = unsafe {
60    glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_ACCESS)
61};
62pub static RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT: &glib::GStr = unsafe {
63    glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_AUTH_CHECK_MEDIA_FACTORY_CONSTRUCT)
64};
65pub static RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS: &glib::GStr = unsafe {
66    glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS)
67};
68pub static RTSP_AUTH_CHECK_URL: &glib::GStr =
69    unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_AUTH_CHECK_URL) };
70pub static RTSP_PERM_MEDIA_FACTORY_ACCESS: &glib::GStr =
71    unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_PERM_MEDIA_FACTORY_ACCESS) };
72pub static RTSP_PERM_MEDIA_FACTORY_CONSTRUCT: &glib::GStr =
73    unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_PERM_MEDIA_FACTORY_CONSTRUCT) };
74pub static RTSP_TOKEN_MEDIA_FACTORY_ROLE: &glib::GStr =
75    unsafe { glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_TOKEN_MEDIA_FACTORY_ROLE) };
76pub static RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS: &glib::GStr = unsafe {
77    glib::GStr::from_utf8_with_nul_unchecked(ffi::GST_RTSP_TOKEN_TRANSPORT_CLIENT_SETTINGS)
78};
79
80// Re-export all the traits in a prelude module, so that applications
81// can always "use gst_rtsp_server::prelude::*" without getting conflicts
82pub mod prelude {
83    #[doc(hidden)]
84    pub use gio::prelude::*;
85
86    #[doc(hidden)]
87    pub use gst_rtsp::prelude::*;
88
89    #[allow(unused_imports)]
90    #[doc(hidden)]
91    pub use gst_net::prelude::*;
92
93    pub use crate::{
94        auto::traits::*, rtsp_address_pool::RTSPAddressPoolExtManual, rtsp_auth::RTSPAuthExtManual,
95        rtsp_client::RTSPClientExtManual, rtsp_media::RTSPMediaExtManual,
96        rtsp_media_factory::RTSPMediaFactoryExtManual,
97        rtsp_onvif_media_factory::RTSPOnvifMediaFactoryExtManual, rtsp_server::RTSPServerExtManual,
98        rtsp_session::RTSPSessionExtManual, rtsp_session_pool::RTSPSessionPoolExtManual,
99    };
100}