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
49/// Trait containing all [`struct@RTSPOnvifMediaFactory`] methods.
50///
51/// # Implementors
52///
53/// [`RTSPOnvifMediaFactory`][struct@crate::RTSPOnvifMediaFactory]
54pub trait RTSPOnvifMediaFactoryExt: IsA<RTSPOnvifMediaFactory> + 'static {
55 /// Get the configured/supported bandwidth of the ONVIF backchannel pipeline in
56 /// bits per second.
57 ///
58 /// # Returns
59 ///
60 /// the configured/supported backchannel bandwidth.
61 #[doc(alias = "gst_rtsp_onvif_media_factory_get_backchannel_bandwidth")]
62 #[doc(alias = "get_backchannel_bandwidth")]
63 fn backchannel_bandwidth(&self) -> u32 {
64 unsafe {
65 ffi::gst_rtsp_onvif_media_factory_get_backchannel_bandwidth(
66 self.as_ref().to_glib_none().0,
67 )
68 }
69 }
70
71 /// Get the `gst_parse_launch()` pipeline description that will be used in the
72 /// default prepare vmethod for generating the ONVIF backchannel pipeline.
73 ///
74 /// # Returns
75 ///
76 /// the configured backchannel launch description. `g_free()` after
77 /// usage.
78 #[doc(alias = "gst_rtsp_onvif_media_factory_get_backchannel_launch")]
79 #[doc(alias = "get_backchannel_launch")]
80 fn backchannel_launch(&self) -> Option<glib::GString> {
81 unsafe {
82 from_glib_full(ffi::gst_rtsp_onvif_media_factory_get_backchannel_launch(
83 self.as_ref().to_glib_none().0,
84 ))
85 }
86 }
87
88 /// Returns [`true`] if an ONVIF backchannel is supported by the media factory.
89 ///
90 /// # Returns
91 ///
92 /// [`true`] if an ONVIF backchannel is supported by the media factory.
93 #[doc(alias = "gst_rtsp_onvif_media_factory_has_backchannel_support")]
94 fn has_backchannel_support(&self) -> bool {
95 unsafe {
96 from_glib(ffi::gst_rtsp_onvif_media_factory_has_backchannel_support(
97 self.as_ref().to_glib_none().0,
98 ))
99 }
100 }
101
102 ///
103 /// # Returns
104 ///
105 /// [`true`] if ONVIF replay is supported by the media factory.
106 #[cfg(feature = "v1_18")]
107 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
108 #[doc(alias = "gst_rtsp_onvif_media_factory_has_replay_support")]
109 fn has_replay_support(&self) -> bool {
110 unsafe {
111 from_glib(ffi::gst_rtsp_onvif_media_factory_has_replay_support(
112 self.as_ref().to_glib_none().0,
113 ))
114 }
115 }
116
117 /// Set the configured/supported bandwidth of the ONVIF backchannel pipeline in
118 /// bits per second.
119 /// ## `bandwidth`
120 /// the bandwidth in bits per second
121 #[doc(alias = "gst_rtsp_onvif_media_factory_set_backchannel_bandwidth")]
122 fn set_backchannel_bandwidth(&self, bandwidth: u32) {
123 unsafe {
124 ffi::gst_rtsp_onvif_media_factory_set_backchannel_bandwidth(
125 self.as_ref().to_glib_none().0,
126 bandwidth,
127 );
128 }
129 }
130
131 /// The `gst_parse_launch()` line to use for constructing the ONVIF backchannel
132 /// pipeline in the default prepare vmethod if requested by the client.
133 ///
134 /// The pipeline description should return a GstBin as the toplevel element
135 /// which can be accomplished by enclosing the description with brackets '('
136 /// ')'.
137 ///
138 /// The description should return a pipeline with a single depayloader named
139 /// depay_backchannel. A caps query on the depayloader's sinkpad should return
140 /// all possible, complete RTP caps that are going to be supported. At least
141 /// the payload type, clock-rate and encoding-name need to be specified.
142 ///
143 /// Note: The pipeline part passed here must end in sinks that are not waiting
144 /// until pre-rolling before reaching the PAUSED state, i.e. setting
145 /// async=false on `GstBaseSink`. Otherwise the whole media will not be able to
146 /// prepare.
147 /// ## `launch`
148 /// the launch description
149 #[doc(alias = "gst_rtsp_onvif_media_factory_set_backchannel_launch")]
150 fn set_backchannel_launch(&self, launch: Option<&str>) {
151 unsafe {
152 ffi::gst_rtsp_onvif_media_factory_set_backchannel_launch(
153 self.as_ref().to_glib_none().0,
154 launch.to_glib_none().0,
155 );
156 }
157 }
158
159 /// Set to [`true`] if ONVIF replay is supported by the media factory.
160 #[cfg(feature = "v1_18")]
161 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
162 #[doc(alias = "gst_rtsp_onvif_media_factory_set_replay_support")]
163 fn set_replay_support(&self, has_replay_support: bool) {
164 unsafe {
165 ffi::gst_rtsp_onvif_media_factory_set_replay_support(
166 self.as_ref().to_glib_none().0,
167 has_replay_support.into_glib(),
168 );
169 }
170 }
171}
172
173impl<O: IsA<RTSPOnvifMediaFactory>> RTSPOnvifMediaFactoryExt for O {}