mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-05 14:58:41 +00:00
Add GObjectExtManual trait and implement set_property_from_string() there
This commit is contained in:
parent
91649b259a
commit
ce33439465
2 changed files with 19 additions and 0 deletions
17
gstreamer/src/gobject.rs
Normal file
17
gstreamer/src/gobject.rs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
use glib;
|
||||||
|
use glib::IsA;
|
||||||
|
use glib::translate::{ToGlibPtr, from_glib};
|
||||||
|
|
||||||
|
use ffi;
|
||||||
|
|
||||||
|
pub trait GObjectExtManualGst {
|
||||||
|
fn set_property_from_str(&self, name: &str, value: &str);
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<O: IsA<glib::Object>> GObjectExtManualGst for O {
|
||||||
|
fn set_property_from_str(&self, name: &str, value: &str) {
|
||||||
|
unsafe {
|
||||||
|
ffi::gst_util_set_object_arg(self.to_glib_none().0, name.to_glib_none().0, value.to_glib_none().0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -61,7 +61,9 @@ pub use tags::*;
|
||||||
mod element;
|
mod element;
|
||||||
mod bin;
|
mod bin;
|
||||||
mod bus;
|
mod bus;
|
||||||
|
mod gobject;
|
||||||
pub use bin::BinExtManual;
|
pub use bin::BinExtManual;
|
||||||
|
pub use gobject::GObjectExtManualGst;
|
||||||
|
|
||||||
mod value;
|
mod value;
|
||||||
pub use value::*;
|
pub use value::*;
|
||||||
|
|
Loading…
Reference in a new issue