1// Take a look at the license at the top of the repository in the LICENSE file.
23use crate::{ffi, RTSPClient, RTSPSession};
4use glib::{prelude::*, source::SourceId, translate::*};
5use gst_rtsp::rtsp_message::RTSPMessage;
67pub trait RTSPClientExtManual: IsA<RTSPClient> + 'static {
8/// Attaches `self` to `context`. When the mainloop for `context` is run, the
9 /// client will be dispatched. When `context` is [`None`], the default context will be
10 /// used).
11 ///
12 /// This function should be called when the client properties and urls are fully
13 /// configured and the client is ready to start.
14 /// ## `context`
15 /// a [`glib::MainContext`][crate::glib::MainContext]
16 ///
17 /// # Returns
18 ///
19 /// the ID (greater than 0) for the source within the GMainContext.
20#[doc(alias = "gst_rtsp_client_attach")]
21fn attach(&self, context: Option<&glib::MainContext>) -> SourceId {
22unsafe {
23 from_glib(ffi::gst_rtsp_client_attach(
24self.as_ref().to_glib_none().0,
25 context.to_glib_none().0,
26 ))
27 }
28 }
2930#[doc(alias = "gst_rtsp_client_send_message")]
31fn send_message(
32&self,
33 message: &RTSPMessage,
34 session: Option<&RTSPSession>,
35 ) -> gst_rtsp::RTSPResult {
36unsafe {
37 from_glib(ffi::gst_rtsp_client_send_message(
38self.as_ref().to_glib_none().0,
39 session.to_glib_none().0,
40 message.to_glib_none().0,
41 ))
42 }
43 }
44}
4546impl<O: IsA<RTSPClient>> RTSPClientExtManual for O {}