gstreamer_gl (rust) on Windows

Sebastian Dröge sebastian at centricular.com
Mon Feb 7 11:11:21 UTC 2022


On Fri, 2022-02-04 at 14:50 -0700, Steven Fontaine via gstreamer-devel wrote:
> 
> Due to the inconsistencies between the C library and rust bindings,

Which inconsistencies are making things difficult for you?

> in addition to the differences between writing a gst plugin and an
> app that depends on gst, I'm unsure where in the glupload.rs example
> code this deactivation and reactivation is needed.

I think you need to make the glutin context "uncurrent" before these
lines and make it current again afterwards:

https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/blob/8b09a84bf197a8516858ea46db74c5132ea59406/examples/src/glupload.rs#L408-416

but I'm not entirely sure.

It might also be necessary to not have the glutin context current
during pipeline startup as that's when the actual GStreamer GL context
is created.

> To be more specific, I'm unsure where the sharing of the contexts is
> actually happening, since the bindings are fairly opaque without
> sludging through them (which isn't for the faint of heart, since the
> bindings are automatically generated by gir.)

There's no context (de)activation or sharing happening behind the
scenes in the bindings. The API is mapping more or less directly to the
C API with an added layer of memory and type safety: if you check the
generated or manual bindings code, it mostly just calls the C functions
plus some checks and type conversions before/afterwards.

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com


More information about the gstreamer-devel mailing list