forked from mirrors/gstreamer-rs
Implement SetValueOptional for Structure
This commit is contained in:
parent
14adb331ec
commit
337f00a85c
1 changed files with 10 additions and 0 deletions
|
@ -240,6 +240,16 @@ impl glib::value::SetValue for Structure {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl glib::value::SetValueOptional for Structure {
|
||||||
|
unsafe fn set_value_optional(v: &mut glib::Value, s: Option<&Self>) {
|
||||||
|
if let Some(s) = s {
|
||||||
|
gobject_ffi::g_value_set_boxed(v.to_glib_none_mut().0, s.as_ptr() as gpointer);
|
||||||
|
} else {
|
||||||
|
gobject_ffi::g_value_set_boxed(v.to_glib_none_mut().0, ptr::null_mut());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl GlibPtrDefault for Structure {
|
impl GlibPtrDefault for Structure {
|
||||||
type GlibType = *mut ffi::GstStructure;
|
type GlibType = *mut ffi::GstStructure;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue