On Thu, 2021-01-28 at 08:57 -0800, Joel Winarske wrote:
It indeed needs a bit more massaging. The following code should do it.
{
let context = context.get_mut().unwrap();
let s = context.get_mut_structure();
let value = unsafe {
use gst::glib::translate::*;
use std::mem;
let handle = display.c_ptr();
let mut value = mem::MaybeUninit::zeroed();
gst::gobject_sys::g_value_init(value.as_mut_ptr(), gst::gobject_sys::G_TYPE_POINTER);
gst::gobject_sys::g_value_set_pointer(value.as_mut_ptr(), handle as *mut c_void);
gst::glib::SendValue::from_glib_none(&value.assume_init() as *const _)
};
s.set_value("handle", value);
}
Apart from everything else there's also the problem that you need to
tell the type system that your value is actually thread-safe. So the
easiest/shortest here is actually to just create the whole GValue like
we would be doing in C.
--
Sebastian Dröge, Centricular Ltd ·
https://www.centricular.com_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel