Bug 257599 - [GStreamer] Do not activate and fill the gst GL context
Summary: [GStreamer] Do not activate and fill the gst GL context
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Garcia Campos
URL:
Keywords: Gtk, InRadar
Depends on:
Blocks:
 
Reported: 2023-06-01 02:47 PDT by Carlos Garcia Campos
Modified: 2023-06-16 06:01 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2023-06-01 02:47:59 PDT
We currently create the GstGLContext wrapping the sharing context and it's activated in the main thread. That means, among other things, that gst sends all gl operations on the context to the main thread. Another side effect is that the sharing context is made current in the main thread and remains forever.
Comment 1 Miguel Gomez 2023-06-01 02:54:52 PDT
Isn't gstreamer creating a new glcontext in its own thread (one of the many that it uses) and sending its gl operations there? I would expect so.
Comment 2 Carlos Garcia Campos 2023-06-01 02:59:23 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14583
Comment 3 Carlos Garcia Campos 2023-06-01 03:00:49 PDT
(In reply to Miguel Gomez from comment #1)
> Isn't gstreamer creating a new glcontext in its own thread (one of the many
> that it uses) and sending its gl operations there? I would expect so.

I don't think so, it does that when not creating a wrapping context.
Comment 4 Carlos Garcia Campos 2023-06-01 04:14:48 PDT
(In reply to Carlos Garcia Campos from comment #3)
> (In reply to Miguel Gomez from comment #1)
> > Isn't gstreamer creating a new glcontext in its own thread (one of the many
> > that it uses) and sending its gl operations there? I would expect so.
> 
> I don't think so, it does that when not creating a wrapping context.

hmm, it's not created for the wrapped context, but another one is created apparently, so I was indeed wrong. I'll continue checking, the patch would still be needed, though to avoid using the sharing context.
Comment 5 Carlos Garcia Campos 2023-06-01 04:46:42 PDT
Ok, I see how it works now, our wrapped context is indeed only used as the sharing context of a gl context created by gst and used in a dedicated thread. I'm sorry for the noise, but this patch doesn't make sense as is. I'll close the PR for now.
Comment 6 Carlos Garcia Campos 2023-06-01 05:44:31 PDT
It's only used as a sharing context, so it doesn't need to be activated and filled. This ways we avoid making the sharing context the current one in the main thread forever.
Comment 7 Carlos Garcia Campos 2023-06-01 05:46:05 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14586
Comment 8 EWS 2023-06-02 01:50:42 PDT
Committed 264826@main (d4b48c265736): <https://commits.webkit.org/264826@main>

Reviewed commits have been landed. Closing PR #14586 and removing active labels.
Comment 9 Radar WebKit Bug Importer 2023-06-02 01:51:17 PDT
<rdar://problem/110158904>