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
30/// Trait containing all [`struct@RTSPOnvifMedia`] methods.
31///
32/// # Implementors
33///
34/// [`RTSPOnvifMedia`][struct@crate::RTSPOnvifMedia]
35pub trait RTSPOnvifMediaExt: IsA<RTSPOnvifMedia> + 'static {
36 /// Find the ONVIF backchannel depayloader element. It should be named
37 /// 'depay_backchannel', be placed in a bin called 'onvif-backchannel'
38 /// and return all supported RTP caps on a caps query. Complete RTP caps with
39 /// at least the payload type, clock-rate and encoding-name are required.
40 ///
41 /// A new [`RTSPStream`][crate::RTSPStream] is created for the backchannel if found.
42 ///
43 /// # Returns
44 ///
45 /// [`true`] if a backchannel stream could be found and created
46 #[doc(alias = "gst_rtsp_onvif_media_collect_backchannel")]
47 fn collect_backchannel(&self) -> bool {
48 unsafe {
49 from_glib(ffi::gst_rtsp_onvif_media_collect_backchannel(
50 self.as_ref().to_glib_none().0,
51 ))
52 }
53 }
54
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_get_backchannel_bandwidth")]
62 #[doc(alias = "get_backchannel_bandwidth")]
63 fn backchannel_bandwidth(&self) -> u32 {
64 unsafe {
65 ffi::gst_rtsp_onvif_media_get_backchannel_bandwidth(self.as_ref().to_glib_none().0)
66 }
67 }
68
69 /// Set the configured/supported bandwidth of the ONVIF backchannel pipeline in
70 /// bits per second.
71 /// ## `bandwidth`
72 /// the bandwidth in bits per second
73 #[doc(alias = "gst_rtsp_onvif_media_set_backchannel_bandwidth")]
74 fn set_backchannel_bandwidth(&self, bandwidth: u32) {
75 unsafe {
76 ffi::gst_rtsp_onvif_media_set_backchannel_bandwidth(
77 self.as_ref().to_glib_none().0,
78 bandwidth,
79 );
80 }
81 }
82}
83
84impl<O: IsA<RTSPOnvifMedia>> RTSPOnvifMediaExt for O {}