gstreamer_rtsp_server/auto/
rtsp_onvif_media.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, RTSPMedia};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    ///
11    ///
12    /// # Implements
13    ///
14    /// [`RTSPOnvifMediaExt`][trait@crate::prelude::RTSPOnvifMediaExt], [`RTSPMediaExt`][trait@crate::prelude::RTSPMediaExt], [`trait@glib::ObjectExt`], [`RTSPMediaExtManual`][trait@crate::prelude::RTSPMediaExtManual]
15    #[doc(alias = "GstRTSPOnvifMedia")]
16    pub struct RTSPOnvifMedia(Object<ffi::GstRTSPOnvifMedia, ffi::GstRTSPOnvifMediaClass>) @extends RTSPMedia;
17
18    match fn {
19        type_ => || ffi::gst_rtsp_onvif_media_get_type(),
20    }
21}
22
23impl RTSPOnvifMedia {
24    pub const NONE: Option<&'static RTSPOnvifMedia> = None;
25}
26
27unsafe impl Send for RTSPOnvifMedia {}
28unsafe impl Sync for RTSPOnvifMedia {}
29
30mod sealed {
31    pub trait Sealed {}
32    impl<T: super::IsA<super::RTSPOnvifMedia>> Sealed for T {}
33}
34
35/// Trait containing all [`struct@RTSPOnvifMedia`] methods.
36///
37/// # Implementors
38///
39/// [`RTSPOnvifMedia`][struct@crate::RTSPOnvifMedia]
40pub trait RTSPOnvifMediaExt: IsA<RTSPOnvifMedia> + sealed::Sealed + 'static {
41    /// Find the ONVIF backchannel depayloader element. It should be named
42    /// 'depay_backchannel', be placed in a bin called 'onvif-backchannel'
43    /// and return all supported RTP caps on a caps query. Complete RTP caps with
44    /// at least the payload type, clock-rate and encoding-name are required.
45    ///
46    /// A new [`RTSPStream`][crate::RTSPStream] is created for the backchannel if found.
47    ///
48    /// # Returns
49    ///
50    /// [`true`] if a backchannel stream could be found and created
51    #[doc(alias = "gst_rtsp_onvif_media_collect_backchannel")]
52    fn collect_backchannel(&self) -> bool {
53        unsafe {
54            from_glib(ffi::gst_rtsp_onvif_media_collect_backchannel(
55                self.as_ref().to_glib_none().0,
56            ))
57        }
58    }
59
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_get_backchannel_bandwidth")]
67    #[doc(alias = "get_backchannel_bandwidth")]
68    fn backchannel_bandwidth(&self) -> u32 {
69        unsafe {
70            ffi::gst_rtsp_onvif_media_get_backchannel_bandwidth(self.as_ref().to_glib_none().0)
71        }
72    }
73
74    /// Set the configured/supported bandwidth of the ONVIF backchannel pipeline in
75    /// bits per second.
76    /// ## `bandwidth`
77    /// the bandwidth in bits per second
78    #[doc(alias = "gst_rtsp_onvif_media_set_backchannel_bandwidth")]
79    fn set_backchannel_bandwidth(&self, bandwidth: u32) {
80        unsafe {
81            ffi::gst_rtsp_onvif_media_set_backchannel_bandwidth(
82                self.as_ref().to_glib_none().0,
83                bandwidth,
84            );
85        }
86    }
87}
88
89impl<O: IsA<RTSPOnvifMedia>> RTSPOnvifMediaExt for O {}