2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
|
|
|
|
2023-12-08 15:48:03 +00:00
|
|
|
use crate::{RTSPClient, RTSPSession};
|
2023-01-03 18:58:25 +00:00
|
|
|
use glib::{prelude::*, source::SourceId, translate::*};
|
2023-12-08 15:48:03 +00:00
|
|
|
use gst_rtsp::rtsp_message::RTSPMessage;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
mod sealed {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl<T: super::IsA<super::RTSPClient>> Sealed for T {}
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
pub trait RTSPClientExtManual: sealed::Sealed + IsA<RTSPClient> + 'static {
|
|
|
|
#[doc(alias = "gst_rtsp_client_attach")]
|
2019-05-23 18:19:24 +00:00
|
|
|
fn attach(&self, context: Option<&glib::MainContext>) -> SourceId {
|
2018-02-09 02:30:08 +00:00
|
|
|
unsafe {
|
2020-11-22 10:45:51 +00:00
|
|
|
from_glib(ffi::gst_rtsp_client_attach(
|
2019-01-16 11:32:58 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
context.to_glib_none().0,
|
2018-02-22 10:18:37 +00:00
|
|
|
))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
2023-12-08 15:48:03 +00:00
|
|
|
|
|
|
|
#[doc(alias = "gst_rtsp_client_send_message")]
|
|
|
|
fn send_message(
|
|
|
|
&self,
|
|
|
|
message: &RTSPMessage,
|
|
|
|
session: Option<&RTSPSession>,
|
|
|
|
) -> gst_rtsp::RTSPResult {
|
|
|
|
unsafe {
|
|
|
|
from_glib(ffi::gst_rtsp_client_send_message(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
session.to_glib_none().0,
|
|
|
|
message.to_glib_none().0,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
2023-07-05 20:21:43 +00:00
|
|
|
|
|
|
|
impl<O: IsA<RTSPClient>> RTSPClientExtManual for O {}
|