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-01-03 18:58:25 +00:00
|
|
|
use glib::{prelude::*, source::SourceId, translate::*};
|
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
use crate::RTSPServer;
|
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::RTSPServer>> Sealed for T {}
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
pub trait RTSPServerExtManual: sealed::Sealed + IsA<RTSPServer> + 'static {
|
|
|
|
#[doc(alias = "gst_rtsp_server_attach")]
|
2021-02-04 19:53:13 +00:00
|
|
|
fn attach(
|
|
|
|
&self,
|
|
|
|
context: Option<&glib::MainContext>,
|
|
|
|
) -> Result<SourceId, glib::error::BoolError> {
|
2018-02-09 02:30:08 +00:00
|
|
|
unsafe {
|
2021-02-04 19:53:13 +00:00
|
|
|
match ffi::gst_rtsp_server_attach(
|
2019-01-16 11:32:58 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
context.to_glib_none().0,
|
2021-02-04 19:53:13 +00:00
|
|
|
) {
|
|
|
|
0 => Err(glib::bool_error!(
|
|
|
|
"Failed to attach main context to RTSP server"
|
|
|
|
)),
|
|
|
|
id => Ok(from_glib(id)),
|
|
|
|
}
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-05 20:21:43 +00:00
|
|
|
|
|
|
|
impl<O: IsA<RTSPServer>> RTSPServerExtManual for O {}
|