gstreamer_rtsp_server/auto/
rtsp_onvif_media_factory.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{ffi, RTSPMediaFactory};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    ///
11    ///
12    /// # Implements
13    ///
14    /// [`RTSPOnvifMediaFactoryExt`][trait@crate::prelude::RTSPOnvifMediaFactoryExt], [`RTSPMediaFactoryExt`][trait@crate::prelude::RTSPMediaFactoryExt], [`trait@glib::ObjectExt`], [`RTSPMediaExtManual`][trait@crate::prelude::RTSPMediaExtManual], [`RTSPMediaFactoryExtManual`][trait@crate::prelude::RTSPMediaFactoryExtManual]
15    #[doc(alias = "GstRTSPOnvifMediaFactory")]
16    pub struct RTSPOnvifMediaFactory(Object<ffi::GstRTSPOnvifMediaFactory, ffi::GstRTSPOnvifMediaFactoryClass>) @extends RTSPMediaFactory;
17
18    match fn {
19        type_ => || ffi::gst_rtsp_onvif_media_factory_get_type(),
20    }
21}
22
23impl RTSPOnvifMediaFactory {
24    pub const NONE: Option<&'static RTSPOnvifMediaFactory> = None;
25
26    /// Create a new [`RTSPOnvifMediaFactory`][crate::RTSPOnvifMediaFactory]
27    ///
28    /// # Returns
29    ///
30    /// A new [`RTSPOnvifMediaFactory`][crate::RTSPOnvifMediaFactory]
31    #[doc(alias = "gst_rtsp_onvif_media_factory_new")]
32    pub fn new() -> RTSPOnvifMediaFactory {
33        assert_initialized_main_thread!();
34        unsafe {
35            RTSPMediaFactory::from_glib_full(ffi::gst_rtsp_onvif_media_factory_new()).unsafe_cast()
36        }
37    }
38}
39
40impl Default for RTSPOnvifMediaFactory {
41    fn default() -> Self {
42        Self::new()
43    }
44}
45
46unsafe impl Send for RTSPOnvifMediaFactory {}
47unsafe impl Sync for RTSPOnvifMediaFactory {}
48
49mod sealed {
50    pub trait Sealed {}
51    impl<T: super::IsA<super::RTSPOnvifMediaFactory>> Sealed for T {}
52}
53
54/// Trait containing all [`struct@RTSPOnvifMediaFactory`] methods.
55///
56/// # Implementors
57///
58/// [`RTSPOnvifMediaFactory`][struct@crate::RTSPOnvifMediaFactory]
59pub trait RTSPOnvifMediaFactoryExt: IsA<RTSPOnvifMediaFactory> + sealed::Sealed + 'static {
60    /// Get the configured/supported bandwidth of the ONVIF backchannel pipeline in
61    /// bits per second.
62    ///
63    /// # Returns
64    ///
65    /// the configured/supported backchannel bandwidth.
66    #[doc(alias = "gst_rtsp_onvif_media_factory_get_backchannel_bandwidth")]
67    #[doc(alias = "get_backchannel_bandwidth")]
68    fn backchannel_bandwidth(&self) -> u32 {
69        unsafe {
70            ffi::gst_rtsp_onvif_media_factory_get_backchannel_bandwidth(
71                self.as_ref().to_glib_none().0,
72            )
73        }
74    }
75
76    /// Get the `gst_parse_launch()` pipeline description that will be used in the
77    /// default prepare vmethod for generating the ONVIF backchannel pipeline.
78    ///
79    /// # Returns
80    ///
81    /// the configured backchannel launch description. `g_free()` after
82    /// usage.
83    #[doc(alias = "gst_rtsp_onvif_media_factory_get_backchannel_launch")]
84    #[doc(alias = "get_backchannel_launch")]
85    fn backchannel_launch(&self) -> Option<glib::GString> {
86        unsafe {
87            from_glib_full(ffi::gst_rtsp_onvif_media_factory_get_backchannel_launch(
88                self.as_ref().to_glib_none().0,
89            ))
90        }
91    }
92
93    /// Returns [`true`] if an ONVIF backchannel is supported by the media factory.
94    ///
95    /// # Returns
96    ///
97    /// [`true`] if an ONVIF backchannel is supported by the media factory.
98    #[doc(alias = "gst_rtsp_onvif_media_factory_has_backchannel_support")]
99    fn has_backchannel_support(&self) -> bool {
100        unsafe {
101            from_glib(ffi::gst_rtsp_onvif_media_factory_has_backchannel_support(
102                self.as_ref().to_glib_none().0,
103            ))
104        }
105    }
106
107    ///
108    /// # Returns
109    ///
110    /// [`true`] if ONVIF replay is supported by the media factory.
111    #[cfg(feature = "v1_18")]
112    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
113    #[doc(alias = "gst_rtsp_onvif_media_factory_has_replay_support")]
114    fn has_replay_support(&self) -> bool {
115        unsafe {
116            from_glib(ffi::gst_rtsp_onvif_media_factory_has_replay_support(
117                self.as_ref().to_glib_none().0,
118            ))
119        }
120    }
121
122    /// Set the configured/supported bandwidth of the ONVIF backchannel pipeline in
123    /// bits per second.
124    /// ## `bandwidth`
125    /// the bandwidth in bits per second
126    #[doc(alias = "gst_rtsp_onvif_media_factory_set_backchannel_bandwidth")]
127    fn set_backchannel_bandwidth(&self, bandwidth: u32) {
128        unsafe {
129            ffi::gst_rtsp_onvif_media_factory_set_backchannel_bandwidth(
130                self.as_ref().to_glib_none().0,
131                bandwidth,
132            );
133        }
134    }
135
136    /// The `gst_parse_launch()` line to use for constructing the ONVIF backchannel
137    /// pipeline in the default prepare vmethod if requested by the client.
138    ///
139    /// The pipeline description should return a GstBin as the toplevel element
140    /// which can be accomplished by enclosing the description with brackets '('
141    /// ')'.
142    ///
143    /// The description should return a pipeline with a single depayloader named
144    /// depay_backchannel. A caps query on the depayloader's sinkpad should return
145    /// all possible, complete RTP caps that are going to be supported. At least
146    /// the payload type, clock-rate and encoding-name need to be specified.
147    ///
148    /// Note: The pipeline part passed here must end in sinks that are not waiting
149    /// until pre-rolling before reaching the PAUSED state, i.e. setting
150    /// async=false on `GstBaseSink`. Otherwise the whole media will not be able to
151    /// prepare.
152    /// ## `launch`
153    /// the launch description
154    #[doc(alias = "gst_rtsp_onvif_media_factory_set_backchannel_launch")]
155    fn set_backchannel_launch(&self, launch: Option<&str>) {
156        unsafe {
157            ffi::gst_rtsp_onvif_media_factory_set_backchannel_launch(
158                self.as_ref().to_glib_none().0,
159                launch.to_glib_none().0,
160            );
161        }
162    }
163
164    /// Set to [`true`] if ONVIF replay is supported by the media factory.
165    #[cfg(feature = "v1_18")]
166    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
167    #[doc(alias = "gst_rtsp_onvif_media_factory_set_replay_support")]
168    fn set_replay_support(&self, has_replay_support: bool) {
169        unsafe {
170            ffi::gst_rtsp_onvif_media_factory_set_replay_support(
171                self.as_ref().to_glib_none().0,
172                has_replay_support.into_glib(),
173            );
174        }
175    }
176}
177
178impl<O: IsA<RTSPOnvifMediaFactory>> RTSPOnvifMediaFactoryExt for O {}