r_t_s_p_server.rs 631 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use RTSPServer;
use ffi;
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib::source::SourceId;

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 {
17 18 19 20
            from_glib(ffi::gst_rtsp_server_attach(
                self.to_glib_none().0,
                context.0,
            ))
21 22 23
        }
    }
}