gstreamer-rs/gstreamer-rtsp-server/src/rtsp_client.rs
2018-04-25 11:13:14 +03:00

23 lines
631 B
Rust

use ffi;
use glib;
use glib::object::IsA;
use glib::source::SourceId;
use glib::translate::*;
use RTSPClient;
pub trait RTSPClientExtManual {
fn attach<'a, P: Into<Option<&'a glib::MainContext>>>(&self, context: P) -> SourceId;
}
impl<O: IsA<RTSPClient>> RTSPClientExtManual 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 {
from_glib(ffi::gst_rtsp_client_attach(
self.to_glib_none().0,
context.0,
))
}
}
}