forked from mirrors/gstreamer-rs
gstreamer: implement FromGlibPtrBorrow trait for gst::Structure
needed for callbacks that pass GstStructure by reference for example: the PlaySignalAdapter error and warning signals needed by https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1036
This commit is contained in:
parent
268e351dde
commit
5d2f36fac3
1 changed files with 12 additions and 0 deletions
|
@ -281,6 +281,18 @@ impl FromGlibPtrFull<*mut ffi::GstStructure> for Structure {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl FromGlibPtrBorrow<*const ffi::GstStructure> for Structure {
|
||||||
|
unsafe fn from_glib_borrow(ptr: *const ffi::GstStructure) -> Borrowed<Self> {
|
||||||
|
Borrowed::new(from_glib_full(ptr))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FromGlibPtrBorrow<*mut ffi::GstStructure> for Structure {
|
||||||
|
unsafe fn from_glib_borrow(ptr: *mut ffi::GstStructure) -> Borrowed<Self> {
|
||||||
|
Borrowed::new(from_glib_full(ptr))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl glib::value::ValueType for Structure {
|
impl glib::value::ValueType for Structure {
|
||||||
type Type = Self;
|
type Type = Self;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue