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
// 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::{ffi, RTSPMedia};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    ///
    ///
    /// # Implements
    ///
    /// [`RTSPOnvifMediaExt`][trait@crate::prelude::RTSPOnvifMediaExt], [`RTSPMediaExt`][trait@crate::prelude::RTSPMediaExt], [`trait@glib::ObjectExt`], [`RTSPMediaExtManual`][trait@crate::prelude::RTSPMediaExtManual]
    #[doc(alias = "GstRTSPOnvifMedia")]
    pub struct RTSPOnvifMedia(Object<ffi::GstRTSPOnvifMedia, ffi::GstRTSPOnvifMediaClass>) @extends RTSPMedia;

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

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

unsafe impl Send for RTSPOnvifMedia {}
unsafe impl Sync for RTSPOnvifMedia {}

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

/// Trait containing all [`struct@RTSPOnvifMedia`] methods.
///
/// # Implementors
///
/// [`RTSPOnvifMedia`][struct@crate::RTSPOnvifMedia]
pub trait RTSPOnvifMediaExt: IsA<RTSPOnvifMedia> + sealed::Sealed + 'static {
    /// Find the ONVIF backchannel depayloader element. It should be named
    /// 'depay_backchannel', be placed in a bin called 'onvif-backchannel'
    /// and return all supported RTP caps on a caps query. Complete RTP caps with
    /// at least the payload type, clock-rate and encoding-name are required.
    ///
    /// A new [`RTSPStream`][crate::RTSPStream] is created for the backchannel if found.
    ///
    /// # Returns
    ///
    /// [`true`] if a backchannel stream could be found and created
    #[doc(alias = "gst_rtsp_onvif_media_collect_backchannel")]
    fn collect_backchannel(&self) -> bool {
        unsafe {
            from_glib(ffi::gst_rtsp_onvif_media_collect_backchannel(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// 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_get_backchannel_bandwidth")]
    #[doc(alias = "get_backchannel_bandwidth")]
    fn backchannel_bandwidth(&self) -> u32 {
        unsafe {
            ffi::gst_rtsp_onvif_media_get_backchannel_bandwidth(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_set_backchannel_bandwidth")]
    fn set_backchannel_bandwidth(&self, bandwidth: u32) {
        unsafe {
            ffi::gst_rtsp_onvif_media_set_backchannel_bandwidth(
                self.as_ref().to_glib_none().0,
                bandwidth,
            );
        }
    }
}

impl<O: IsA<RTSPOnvifMedia>> RTSPOnvifMediaExt for O {}