mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-22 16:16:37 +00:00
Implement SetValueOptional for GstRc<T>
This commit is contained in:
parent
489e6dc456
commit
6c4ee55f27
1 changed files with 10 additions and 0 deletions
|
@ -434,6 +434,16 @@ impl<T: MiniObject + glib::StaticType> glib::value::SetValue for GstRc<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: MiniObject + glib::StaticType> glib::value::SetValueOptional for GstRc<T> {
|
||||
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<T: MiniObject + 'static> GlibPtrDefault for GstRc<T> {
|
||||
type GlibType = *mut T::GstType;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue