<div dir="ltr">Works great, thank you!<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 28, 2021 at 9:26 AM Sebastian Dröge <<a href="mailto:sebastian@centricular.com">sebastian@centricular.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 2021-01-28 at 08:57 -0800, Joel Winarske wrote:<br>
> <br>
> I'm down to <a href="https://github.com/jwinarske/waylandsink-with-video-overlay-rs/blob/main/src/main.rs#L59-L72" rel="noreferrer" target="_blank">https://github.com/jwinarske/waylandsink-with-video-overlay-rs/blob/main/src/main.rs#L59-L72</a><br>
> <br>
> error[E0277]: the trait bound `Value: SetValue` is not satisfied<br>
> --> src/main.rs:70:25<br>
> |<br>
> 70 | s.set("handle", &value);<br>
> | ^^^^^^ the trait `SetValue` is not implemented for `Value`<br>
> |<br>
> = note: required because of the requirements on the impl of `ToSendValue` for `Value`<br>
<br>
It indeed needs a bit more massaging. The following code should do it.<br>
<br>
{<br>
let context = context.get_mut().unwrap();<br>
let s = context.get_mut_structure();<br>
let value = unsafe {<br>
use gst::glib::translate::*;<br>
use std::mem;<br>
<br>
let handle = display.c_ptr();<br>
let mut value = mem::MaybeUninit::zeroed();<br>
gst::gobject_sys::g_value_init(value.as_mut_ptr(), gst::gobject_sys::G_TYPE_POINTER);<br>
gst::gobject_sys::g_value_set_pointer(value.as_mut_ptr(), handle as *mut c_void);<br>
gst::glib::SendValue::from_glib_none(&value.assume_init() as *const _)<br>
};<br>
s.set_value("handle", value);<br>
}<br>
<br>
Apart from everything else there's also the problem that you need to<br>
tell the type system that your value is actually thread-safe. So the<br>
easiest/shortest here is actually to just create the whole GValue like<br>
we would be doing in C.<br>
<br>
-- <br>
Sebastian Dröge, Centricular Ltd · <a href="https://www.centricular.com" rel="noreferrer" target="_blank">https://www.centricular.com</a><br>
<br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div>