mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-05-20 17:28:26 +00:00
a00243d529
Only automatic bindings for now, which is enough to allow implementing a simple rtsp-server example. Depends on https://github.com/sdroege/gstreamer-sys/pull/8 Uses a new gir feature proposed at https://github.com/gtk-rs/gir/pull/539 to make doc regeneration easier. Fixes https://github.com/sdroege/gstreamer-rs/pull/80
21 lines
584 B
Rust
21 lines
584 B
Rust
use RTSPClient;
|
|
use ffi;
|
|
use glib;
|
|
use glib::object::IsA;
|
|
use glib::translate::*;
|
|
use glib::source::SourceId;
|
|
|
|
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))
|
|
}
|
|
}
|
|
}
|