1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

use crate::RTSPMediaFactory;
use glib::{prelude::*, translate::*};

glib::wrapper! {
    ///
    ///
    /// # Implements
    ///
    /// [`RTSPOnvifMediaFactoryExt`][trait@crate::prelude::RTSPOnvifMediaFactoryExt], [`RTSPMediaFactoryExt`][trait@crate::prelude::RTSPMediaFactoryExt], [`trait@glib::ObjectExt`], [`RTSPMediaExtManual`][trait@crate::prelude::RTSPMediaExtManual], [`RTSPMediaFactoryExtManual`][trait@crate::prelude::RTSPMediaFactoryExtManual]
    #[doc(alias = "GstRTSPOnvifMediaFactory")]
    pub struct RTSPOnvifMediaFactory(Object<ffi::GstRTSPOnvifMediaFactory, ffi::GstRTSPOnvifMediaFactoryClass>) @extends RTSPMediaFactory;

    match fn {
        type_ => || ffi::gst_rtsp_onvif_media_factory_get_type(),
    }
}

impl RTSPOnvifMediaFactory {
    pub const NONE: Option<&'static RTSPOnvifMediaFactory> = None;

    /// Create a new [`RTSPOnvifMediaFactory`][crate::RTSPOnvifMediaFactory]
    ///
    /// # Returns
    ///
    /// A new [`RTSPOnvifMediaFactory`][crate::RTSPOnvifMediaFactory]
    #[doc(alias = "gst_rtsp_onvif_media_factory_new")]
    pub fn new() -> RTSPOnvifMediaFactory {
        assert_initialized_main_thread!();
        unsafe {
            RTSPMediaFactory::from_glib_full(ffi::gst_rtsp_onvif_media_factory_new()).unsafe_cast()
        }
    }
}

impl Default for RTSPOnvifMediaFactory {
    fn default() -> Self {
        Self::new()
    }
}

unsafe impl Send for RTSPOnvifMediaFactory {}
unsafe impl Sync for RTSPOnvifMediaFactory {}

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::RTSPOnvifMediaFactory>> Sealed for T {}
}

/// Trait containing all [`struct@RTSPOnvifMediaFactory`] methods.
///
/// # Implementors
///
/// [`RTSPOnvifMediaFactory`][struct@crate::RTSPOnvifMediaFactory]
pub trait RTSPOnvifMediaFactoryExt: IsA<RTSPOnvifMediaFactory> + sealed::Sealed + 'static {
    /// Get the configured/supported bandwidth of the ONVIF backchannel pipeline in
    /// bits per second.
    ///
    /// # Returns
    ///
    /// the configured/supported backchannel bandwidth.
    #[doc(alias = "gst_rtsp_onvif_media_factory_get_backchannel_bandwidth")]
    #[doc(alias = "get_backchannel_bandwidth")]
    fn backchannel_bandwidth(&self) -> u32 {
        unsafe {
            ffi::gst_rtsp_onvif_media_factory_get_backchannel_bandwidth(
                self.as_ref().to_glib_none().0,
            )
        }
    }

    /// Get the `gst_parse_launch()` pipeline description that will be used in the
    /// default prepare vmethod for generating the ONVIF backchannel pipeline.
    ///
    /// # Returns
    ///
    /// the configured backchannel launch description. `g_free()` after
    /// usage.
    #[doc(alias = "gst_rtsp_onvif_media_factory_get_backchannel_launch")]
    #[doc(alias = "get_backchannel_launch")]
    fn backchannel_launch(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::gst_rtsp_onvif_media_factory_get_backchannel_launch(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns [`true`] if an ONVIF backchannel is supported by the media factory.
    ///
    /// # Returns
    ///
    /// [`true`] if an ONVIF backchannel is supported by the media factory.
    #[doc(alias = "gst_rtsp_onvif_media_factory_has_backchannel_support")]
    fn has_backchannel_support(&self) -> bool {
        unsafe {
            from_glib(ffi::gst_rtsp_onvif_media_factory_has_backchannel_support(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    ///
    /// # Returns
    ///
    /// [`true`] if ONVIF replay is supported by the media factory.
    #[cfg(feature = "v1_18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
    #[doc(alias = "gst_rtsp_onvif_media_factory_has_replay_support")]
    fn has_replay_support(&self) -> bool {
        unsafe {
            from_glib(ffi::gst_rtsp_onvif_media_factory_has_replay_support(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Set the configured/supported bandwidth of the ONVIF backchannel pipeline in
    /// bits per second.
    /// ## `bandwidth`
    /// the bandwidth in bits per second
    #[doc(alias = "gst_rtsp_onvif_media_factory_set_backchannel_bandwidth")]
    fn set_backchannel_bandwidth(&self, bandwidth: u32) {
        unsafe {
            ffi::gst_rtsp_onvif_media_factory_set_backchannel_bandwidth(
                self.as_ref().to_glib_none().0,
                bandwidth,
            );
        }
    }

    /// The `gst_parse_launch()` line to use for constructing the ONVIF backchannel
    /// pipeline in the default prepare vmethod if requested by the client.
    ///
    /// The pipeline description should return a GstBin as the toplevel element
    /// which can be accomplished by enclosing the description with brackets '('
    /// ')'.
    ///
    /// The description should return a pipeline with a single depayloader named
    /// depay_backchannel. A caps query on the depayloader's sinkpad should return
    /// all possible, complete RTP caps that are going to be supported. At least
    /// the payload type, clock-rate and encoding-name need to be specified.
    ///
    /// Note: The pipeline part passed here must end in sinks that are not waiting
    /// until pre-rolling before reaching the PAUSED state, i.e. setting
    /// async=false on `GstBaseSink`. Otherwise the whole media will not be able to
    /// prepare.
    /// ## `launch`
    /// the launch description
    #[doc(alias = "gst_rtsp_onvif_media_factory_set_backchannel_launch")]
    fn set_backchannel_launch(&self, launch: Option<&str>) {
        unsafe {
            ffi::gst_rtsp_onvif_media_factory_set_backchannel_launch(
                self.as_ref().to_glib_none().0,
                launch.to_glib_none().0,
            );
        }
    }

    /// Set to [`true`] if ONVIF replay is supported by the media factory.
    #[cfg(feature = "v1_18")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
    #[doc(alias = "gst_rtsp_onvif_media_factory_set_replay_support")]
    fn set_replay_support(&self, has_replay_support: bool) {
        unsafe {
            ffi::gst_rtsp_onvif_media_factory_set_replay_support(
                self.as_ref().to_glib_none().0,
                has_replay_support.into_glib(),
            );
        }
    }
}

impl<O: IsA<RTSPOnvifMediaFactory>> RTSPOnvifMediaFactoryExt for O {}