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 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib; use glib::object::IsA; use glib::translate::*; use glib::GString; use gst; use gst_rtsp_server_sys; use std::mem; use RTSPMedia; use RTSPStreamTransport; glib_wrapper! { /// State of a client session regarding a specific media identified by path. /// /// # Implements /// /// [`RTSPSessionMediaExt`](trait.RTSPSessionMediaExt.html), [`glib::object::ObjectExt`](../glib/object/trait.ObjectExt.html) pub struct RTSPSessionMedia(Object<gst_rtsp_server_sys::GstRTSPSessionMedia, gst_rtsp_server_sys::GstRTSPSessionMediaClass, RTSPSessionMediaClass>); match fn { get_type => || gst_rtsp_server_sys::gst_rtsp_session_media_get_type(), } } impl RTSPSessionMedia { /// Create a new `RTSPSessionMedia` that manages the streams /// in `media` for `path`. `media` should be prepared. /// /// Ownership is taken of `media`. /// ## `path` /// the path /// ## `media` /// the `RTSPMedia` /// /// # Returns /// /// a new `RTSPSessionMedia`. pub fn new<P: IsA<RTSPMedia>>(path: &str, media: &P) -> RTSPSessionMedia { skip_assert_initialized!(); unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_media_new( path.to_glib_none().0, media.as_ref().to_glib_full(), )) } } } unsafe impl Send for RTSPSessionMedia {} unsafe impl Sync for RTSPSessionMedia {} pub const NONE_RTSP_SESSION_MEDIA: Option<&RTSPSessionMedia> = None; /// Trait containing all `RTSPSessionMedia` methods. /// /// # Implementors /// /// [`RTSPSessionMedia`](struct.RTSPSessionMedia.html) pub trait RTSPSessionMediaExt: 'static { //fn alloc_channels(&self, range: /*Ignored*/gst_rtsp::RTSPRange) -> bool; /// Get the base_time of the `RTSPMedia` in `self` /// /// # Returns /// /// the base_time of the media. fn get_base_time(&self) -> gst::ClockTime; /// Get the `RTSPMedia` that was used when constructing `self` /// /// # Returns /// /// the `RTSPMedia` of `self`. /// Remains valid as long as `self` is valid. fn get_media(&self) -> Option<RTSPMedia>; /// Retrieve the RTP-Info header string for all streams in `self` /// with configured transports. /// /// # Returns /// /// The RTP-Info as a string or /// `None` when no RTP-Info could be generated, `g_free` after usage. fn get_rtpinfo(&self) -> Option<GString>; //fn get_rtsp_state(&self) -> /*Ignored*/gst_rtsp::RTSPState; /// Get a previously created `RTSPStreamTransport` for the stream at `idx`. /// ## `idx` /// the stream index /// /// # Returns /// /// a `RTSPStreamTransport` that is /// valid until the session of `self` is unreffed. fn get_transport(&self, idx: u32) -> Option<RTSPStreamTransport>; //#[cfg(any(feature = "v1_14", feature = "dox"))] //fn get_transports(&self) -> /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 27 }; /// Check if the path of `self` matches `path`. It `path` matches, the amount of /// matched characters is returned in `matched`. /// ## `path` /// a path /// ## `matched` /// the amount of matched characters of `path` /// /// # Returns /// /// `true` when `path` matches the path of `self`. fn matches(&self, path: &str) -> Option<i32>; //fn set_rtsp_state(&self, state: /*Ignored*/gst_rtsp::RTSPState); /// Tell the media object `self` to change to `state`. /// ## `state` /// the new state /// /// # Returns /// /// `true` on success. fn set_state(&self, state: gst::State) -> Result<(), glib::error::BoolError>; //fn set_transport<P: IsA<RTSPStream>>(&self, stream: &P, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> Option<RTSPStreamTransport>; } impl<O: IsA<RTSPSessionMedia>> RTSPSessionMediaExt for O { //fn alloc_channels(&self, range: /*Ignored*/gst_rtsp::RTSPRange) -> bool { // unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_media_alloc_channels() } //} fn get_base_time(&self) -> gst::ClockTime { unsafe { from_glib(gst_rtsp_server_sys::gst_rtsp_session_media_get_base_time( self.as_ref().to_glib_none().0, )) } } fn get_media(&self) -> Option<RTSPMedia> { unsafe { from_glib_none(gst_rtsp_server_sys::gst_rtsp_session_media_get_media( self.as_ref().to_glib_none().0, )) } } fn get_rtpinfo(&self) -> Option<GString> { unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_session_media_get_rtpinfo( self.as_ref().to_glib_none().0, )) } } //fn get_rtsp_state(&self) -> /*Ignored*/gst_rtsp::RTSPState { // unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_media_get_rtsp_state() } //} fn get_transport(&self, idx: u32) -> Option<RTSPStreamTransport> { unsafe { from_glib_none(gst_rtsp_server_sys::gst_rtsp_session_media_get_transport( self.as_ref().to_glib_none().0, idx, )) } } //#[cfg(any(feature = "v1_14", feature = "dox"))] //fn get_transports(&self) -> /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 27 } { // unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_media_get_transports() } //} fn matches(&self, path: &str) -> Option<i32> { unsafe { let mut matched = mem::MaybeUninit::uninit(); let ret = from_glib(gst_rtsp_server_sys::gst_rtsp_session_media_matches( self.as_ref().to_glib_none().0, path.to_glib_none().0, matched.as_mut_ptr(), )); let matched = matched.assume_init(); if ret { Some(matched) } else { None } } } //fn set_rtsp_state(&self, state: /*Ignored*/gst_rtsp::RTSPState) { // unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_media_set_rtsp_state() } //} fn set_state(&self, state: gst::State) -> Result<(), glib::error::BoolError> { unsafe { glib_result_from_gboolean!( gst_rtsp_server_sys::gst_rtsp_session_media_set_state( self.as_ref().to_glib_none().0, state.to_glib() ), "Failed to set state of session media" ) } } //fn set_transport<P: IsA<RTSPStream>>(&self, stream: &P, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> Option<RTSPStreamTransport> { // unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_session_media_set_transport() } //} }