Commit graph

19 commits

Author SHA1 Message Date
Lewis Lakerink
16cb4286b1 Fix pipewire stream double free 2020-10-20 18:56:37 +11:00
Vlad Zahorodnii
9c20df5030 screencast: Use fences to avoid stalling the graphics pipeline
Currently, we use glFinish() to ensure that stream consumers don't see
corrupted or rather incomplete buffers. This is a serious issue because
glFinish() not only prevents the gpu from processing new GL commands,
but it also blocks the compositor.

This change addresses the blocking issue by using native fences. With
the proposed change, after finishing recording a frame, a fence is
inserted in the command stream. When the native fence is signaled, the
pending pipewire buffer will be enqueued.

If the EGL_ANDROID_native_fence_sync extension is not supported, we'll
fall back to using glFinish().
2020-10-19 14:23:06 +00:00
Vlad Zahorodnii
6546ac2cae screencast: Replace EGLFence with a glFinish()
The way EGLFence is used is equivalent to calling glFinish().

CCBUG: 425869
2020-09-29 13:57:24 +00:00
Vlad Zahorodnii
989e0987d7 screencast: Ensure that there is current OpenGL context when recording a window
We need an OpenGL context otherwise we may hit an assert in libepoxy.

BUG: 425869
2020-09-24 15:47:56 +03:00
Aleix Pol
26950a65a6 Have Toplevel::damage emit a QRegion
Instead of looping through the rects in the region, emit the region at
bulk. It reduces the amount of emissions we do and allows us to pack the
response accordingly.
2020-09-22 14:45:08 +02:00
Aleix Pol
bd7f758ac9 screencasting: Mark the stream as dirty from the start
Otherwise we detect the stream as clean and skip sending anything,
ending up waiting for the window to issue some damage.
2020-09-15 22:35:21 +00:00
Vlad Zahorodnii
9663dd5fb3 Adjust screencast service to recent kwayland-server changes 2020-09-09 16:03:41 +00:00
Vlad Zahorodnii
b3f3248543 screencast: Switch to new outputScreencastRequested() signal 2020-09-04 08:49:52 +00:00
Vlad Zahorodnii
0dda9dc7d0 Use namespace kwin only in autotests
In kwin core, we prefer not to put `using namespace KWin` because it
makes defining forward declared classes more trickier.
2020-08-21 22:06:36 +00:00
Aleix Pol
062f1c3c87 Let WaylandServer::findOutput tell us about an output given an OutputInterface
Makes for more readable code and allows to reuse the lookup without
adding the boilerplate.
2020-08-18 10:55:21 +00:00
Aleix Pol
c176778494 screencast: Enforce an initial window repaint when we start streaming
Notifying a damage will only ensure that the full window is redrawn, but
we need the repaint as well so the painting actually happens.
2020-08-14 09:09:34 +00:00
Vlad Zahorodnii
4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii
1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00
Vlad Zahorodnii
a7b922bfce screencast: Don't include platformsupport headers
These headers are meant to be used only by platform and scene plugins.
2020-07-28 21:50:26 +03:00
Vlad Zahorodnii
2103b999e7 screencast: Address minor issues 2020-07-28 18:38:49 +00:00
Vlad Zahorodnii
29064f088d screencast: Address minor issues 2020-07-27 13:43:05 +00:00
Vlad Zahorodnii
5a73f4a350 screencast: Move creation of the global to manager
We want to turn screencasting into a plugin eventually.
2020-07-27 13:43:05 +00:00
Aleix Pol
a051baf1a9 screencasting: still build if memfd isn't available
BUG: 424607
2020-07-24 16:59:11 +02:00
Aleix Pol
38eb72efe3 screencasting: integrate zkde_screencast_unstable_v1
Includes a PipeWire implementation that will send the relevant streams
to the processes that need them.
2020-07-23 13:14:22 +02:00