Commit graph

12 commits

Author SHA1 Message Date
Jan Schmidt
92472ef088 wpe: Don't crash when running on X11.
Don't assume the available EGL display is a wayland display -
instead, check the the GStreamer GL context is EGL, and then
use gst_gl_display_egl_from_gl_display to create a
GstGLDisplayEGL from that, which also adds refcounting
around the underlying EGLDisplay.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1385

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1752>
2020-11-15 15:27:08 +00:00
Philippe Normand
8ef30a9ce5 wpe: Move webview load waiting to WPEView
As waiting for the load to be finished is specific to the WebView, it should be
done from our WPEView, not from the WPEContextThread. This fixes issues where
multiple wpesrc elements are created in sequence. Without this patch the first
view might receive erroneous buffer notifications.

Fixes #1386

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1568>
2020-09-21 16:39:57 +00:00
Philippe Normand
314a8c023f wpe: WebView and WebContext handling fixes
The WPEThreaded view is now split in 2 classes:
- WPEContextThread handles the persistent WebKit thread, where all WebKit API
calls should be handled.
- WPEView: is created from the WPEContextThread. It handles the WebView and
maintains the public interface on which wpesrc relies. This is the facade for
the WebView, basically. It takes care of dispatching API calls into the context
thread.

With these fixes it is now possible to create (and reuse) mutlple wpesrc
elements during the application lifetime.

Fixes #1372

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1484>
2020-08-14 09:41:56 +00:00
Mathieu Duponchelle
ad57b8040f wpe: fix ready signalling
Receiving the WEBKIT_LOAD_COMMITTED event doesn't actually
mean we have committed an SHM buffer / image yet.

As this is the condition we are interested in, check it
instead.

Also wrap g_cond_wait in a loop for extra correctness points.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1476>
2020-07-30 08:09:47 +00:00
Philippe Normand
991bcb22d5 wpe: Add support for SHM without requiring EGLDisplay
The previous version of the SHM export support still required a valid
EGLDisplay. The upcoming WPEBackend-FDO 1.8.x aims to remove this requirement,
hence allowing wpesrc to be used without GPU.
2020-04-13 11:53:16 +00:00
Philippe Normand
26f76dd927 wpe: Enable SHM support for new stable WPEBackend-FDO release
1.5.0 was the development version.
2020-03-23 13:08:46 +00:00
Philippe Normand
9ac798ae5e wpe: Add software rendering support support
Starting from WPEBackend-FDO 1.6.x, software rendering support is available.
This features allows wpesrc to be used on machines without GPU, and/or for
testing purpose. To enable it, set the `LIBGL_ALWAYS_SOFTWARE=true` environment
variable and make sure `video/x-raw, format=BGRA` caps are negotiated by the
wpesrc element.
2020-02-11 16:47:53 +00:00
Philippe Normand
a40476914d wpesrc: Implement load-bytes action signal 2019-10-17 08:15:44 +00:00
Philippe Normand
d7778e6a7c wpe: Rewrite wpesrc as a glbasesrc subclass
And since it no longer allocates memories itself, this fixes issues with
fakevideosink. A lot of code previously copied from gltestsrc is no longer
needed thanks to the glbasesrc super-class.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1046
2019-10-17 08:15:44 +00:00
Philippe Normand
3811d13269 wpe: Port for WPEWebKit 2.25.x
When WPEBackend-fdo >= 1.3.0 is detected, the threaded view now relies on the
wpe_fdo_egl_exported_image API instead of the EGLImageKHR-based API which is
going to be deprecated in 2.26. The GLib sources created by the view now use the
default priority as well, the custom priority is no longer required.
2019-06-25 10:16:25 +00:00
Philippe Normand
5105bc8041 wpe: Fix build with -Werror enabled
Including gl.h from WPEThreadedView.h leads to GST_LEVEL_DEFAULT detected as
redefined. The proposed fix is to include config.h from the CPP implementation
file and disable gl.h inclusion in the header, by using forward declarations.
2019-06-05 12:47:16 +01:00
Philippe Normand
5b8935bc77 wpe: Add a source element acting as a Web Browser based on WebKit WPE
The wpe element is used to produce a video texture representing a web page
rendered off-screen by WPE. This element can be used to overlay HTML on top of
another video stream for instance.
2018-12-06 12:38:52 +00:00