gstreamer_webrtc/auto/
web_rtcice_stream.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, WebRTCICEComponent, WebRTCICETransport};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    ///
11    ///
12    /// This is an Abstract Base Class, you cannot instantiate it.
13    ///
14    /// ## Properties
15    ///
16    ///
17    /// #### `stream-id`
18    ///  Readable | Writeable | Construct Only
19    /// <details><summary><h4>Object</h4></summary>
20    ///
21    ///
22    /// #### `name`
23    ///  Readable | Writeable | Construct
24    ///
25    ///
26    /// #### `parent`
27    ///  The parent of the object. Please note, that when changing the 'parent'
28    /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and `GstObject::deep-notify`
29    /// signals due to locking issues. In some cases one can use
30    /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
31    /// achieve a similar effect.
32    ///
33    /// Readable | Writeable
34    /// </details>
35    ///
36    /// # Implements
37    ///
38    /// [`WebRTCICEStreamExt`][trait@crate::prelude::WebRTCICEStreamExt], [`trait@glib::ObjectExt`]
39    #[doc(alias = "GstWebRTCICEStream")]
40    pub struct WebRTCICEStream(Object<ffi::GstWebRTCICEStream, ffi::GstWebRTCICEStreamClass>);
41
42    match fn {
43        type_ => || ffi::gst_webrtc_ice_stream_get_type(),
44    }
45}
46
47impl WebRTCICEStream {
48    pub const NONE: Option<&'static WebRTCICEStream> = None;
49}
50
51unsafe impl Send for WebRTCICEStream {}
52unsafe impl Sync for WebRTCICEStream {}
53
54mod sealed {
55    pub trait Sealed {}
56    impl<T: super::IsA<super::WebRTCICEStream>> Sealed for T {}
57}
58
59/// Trait containing all [`struct@WebRTCICEStream`] methods.
60///
61/// # Implementors
62///
63/// [`WebRTCICEStream`][struct@crate::WebRTCICEStream]
64pub trait WebRTCICEStreamExt: IsA<WebRTCICEStream> + sealed::Sealed + 'static {
65    /// ## `component`
66    /// The [`WebRTCICEComponent`][crate::WebRTCICEComponent]
67    ///
68    /// # Returns
69    ///
70    /// the [`WebRTCICETransport`][crate::WebRTCICETransport], or [`None`]
71    #[doc(alias = "gst_webrtc_ice_stream_find_transport")]
72    fn find_transport(&self, component: WebRTCICEComponent) -> Option<WebRTCICETransport> {
73        unsafe {
74            from_glib_full(ffi::gst_webrtc_ice_stream_find_transport(
75                self.as_ref().to_glib_none().0,
76                component.into_glib(),
77            ))
78        }
79    }
80
81    ///
82    /// # Returns
83    ///
84    /// FALSE on error, TRUE otherwise
85    #[doc(alias = "gst_webrtc_ice_stream_gather_candidates")]
86    fn gather_candidates(&self) -> bool {
87        unsafe {
88            from_glib(ffi::gst_webrtc_ice_stream_gather_candidates(
89                self.as_ref().to_glib_none().0,
90            ))
91        }
92    }
93
94    #[doc(alias = "stream-id")]
95    fn stream_id(&self) -> u32 {
96        ObjectExt::property(self.as_ref(), "stream-id")
97    }
98}
99
100impl<O: IsA<WebRTCICEStream>> WebRTCICEStreamExt for O {}