2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
use crate::RTSPServer;
|
2018-02-09 02:30:08 +00:00
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::source::SourceId;
|
2018-04-01 08:30:03 +00:00
|
|
|
use glib::translate::*;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2018-12-08 09:22:42 +00:00
|
|
|
pub trait RTSPServerExtManual: 'static {
|
2019-05-23 18:19:24 +00:00
|
|
|
fn attach(&self, context: Option<&glib::MainContext>) -> SourceId;
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<RTSPServer>> RTSPServerExtManual for O {
|
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_server_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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|