2018-02-09 02:30:08 +00:00
|
|
|
use ffi;
|
|
|
|
use glib;
|
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::source::SourceId;
|
2018-04-01 08:30:03 +00:00
|
|
|
use glib::translate::*;
|
2018-04-25 08:10:06 +00:00
|
|
|
use RTSPServer;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
|
|
|
pub trait RTSPServerExtManual {
|
|
|
|
fn attach<'a, P: Into<Option<&'a glib::MainContext>>>(&self, context: P) -> SourceId;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<RTSPServer>> RTSPServerExtManual for O {
|
|
|
|
fn attach<'a, P: Into<Option<&'a glib::MainContext>>>(&self, context: P) -> SourceId {
|
|
|
|
let context = context.into();
|
|
|
|
let context = context.to_glib_none();
|
|
|
|
unsafe {
|
2018-02-22 10:18:37 +00:00
|
|
|
from_glib(ffi::gst_rtsp_server_attach(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
context.0,
|
|
|
|
))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|