Skip to content

gtk4: Refactor and simplify GL context handling

Create a single, global GDK GL context and the corresponding GStreamer GL display and wrapped GStreamer GL context when initializing the first sink and continue using that for all further sinks.

Additionally, don't create a full GStreamer GL context inside the sink but only distribute the wrapped GL context in the pipeline so that elements that actually need a full GL context can create one that is sharing with that one. The sink itself does not need a full GStreamer GL context.

Then inside the sink check that any GL memory that arrives was created by a GL context that can share with the wrapped GDK GL context and only then use it.

And lastly, use the correct GL contexts for a) creating a sync point and b) actually waiting on it.

Fixes #318 (closed)

Merge request reports