gstreamer-rs/gstreamer-rtsp-server/src/rtsp_client.rs

23 lines
650 B
Rust
Raw Normal View History

use glib;
use glib::object::IsA;
use glib::source::SourceId;
2018-04-01 08:30:03 +00:00
use glib::translate::*;
2019-03-19 07:58:20 +00:00
use gst_rtsp_server_sys;
2018-04-25 08:10:06 +00:00
use RTSPClient;
pub trait RTSPClientExtManual: 'static {
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();
unsafe {
2019-03-19 07:58:20 +00:00
from_glib(gst_rtsp_server_sys::gst_rtsp_client_attach(
self.as_ref().to_glib_none().0,
context.to_glib_none().0,
))
}
}
}