Commit graph

16 commits

Author SHA1 Message Date
columbarius
2f32d17448 screencast: remove swap_buffer function
Dequeuing a new buffer imidiately creates a problem when the buffer is
destroid while renegotiation of a valid modifier because we can end up using
a buffer which was freed while waiting for the buffer_done event. Then
xdpw will segfault when requesting a copy with a nonexisting buffer. To fix
this we can just dequeue a buffer right before we need it. This makes
the fallback via on_process obsolete since we dequeue the buffer at the
lates possible time.
2022-04-24 21:46:39 +02:00
columbarius
074e62d0c3 screencast: restructure the screencopy flow
The previous implemented way to use wlr_screencopy events to cicle the
screencast had issues, like halting the stream if it was paused and
resumed before PipeWire triggered a recreation of buffers. This came
from not returning a dequeued buffer. This is now mititgated by
enqueuing the current pw_buffer imidiately on a paused event and trying
to dequeue a buffer just before requesting a screencopy if none is
present.
2022-04-04 15:37:53 +02:00
columbarius
10a07f7e90 screencast: don't use the PipeWire event to trigger screencast
Using the on_process event of the PipeWire can create a race condition
when a previous started screencast hasn't finished before the next
event.
2022-04-04 15:37:53 +02:00
columbarius
3ee4c5cca2 screencast: bump the prefered amount of pipewire buffers to 4
This tells pipewire, we prefere to use 4 pw_buffers in the pipe. This
should remove most "out of buffer" occourences.
2021-11-06 16:51:36 +01:00
columbarius
b2f1a10023 screencast: use the pipewire callback process to start screencast
We can trigger that with pw_stream_trigger_process when we are the
driver of the stream. Additionally this let's us run passivly with the
consumer driving the stream.
2021-11-06 16:51:36 +01:00
columbarius
4b03a5acfd screencast: pipewire add functions to dequeue and enqueue a buffer 2021-11-06 16:51:36 +01:00
columbarius
f2d08cc5b5 screencast: create pwr_update_stream_param
This will let us notify pipewire that our buffer has changed and trigger a renegotiation cycle which will take care of reallocating the buffers
2021-07-02 09:45:46 +02:00
Tobias Jakobi
f60bdcef71 screencast: improve cleanup on error in xdpw_screencast_init()
- currently the cleanup can segfault due to uninitialized
  list objects
- introduce xdpw_pwr_context_destroy() and fixup goto logic
2021-05-24 10:03:40 +02:00
Tobias Jakobi
dbe71a66c7 screencast: bring function names in line with the wlroots guidelines
- no functional changes
2021-05-24 10:03:40 +02:00
Jan Beich
a3e203584a screencast: prefix macros to avoid conflict with system definitions
In file included from ../src/screencast/wlr_screencast.c:18:
../include/pipewire_screencast.h:7:9: error: 'ALIGN' macro redefined [-Werror,-Wmacro-redefined]
 #define ALIGN 16
         ^
/usr/include/machine/param.h:79:9: note: previous definition is here
 #define ALIGN(p)                _ALIGN(p)
         ^
2021-01-09 12:21:13 +01:00
danshick
55f873dac4
Screencast session support (#22)
* Initial session support WIP
Remove libdrm dependency

Remove display from context, add dbus properties

Use random names for shm and pw_stream, init the stream only for new cast instances

Separate cast initialized flag from refcount, cleanup names and comments

* Refactor and stability improvements

Properly report xdp screencast implementation version
2020-04-16 10:21:55 +02:00
Dan Shick
ccc8a31568 Remove pipewire workarounds after upstream fix 2020-04-01 13:38:38 -04:00
Dan Shick
bba347be4c Add pipewire 0.3 support. Workaround pipewire bugs. 2020-03-16 22:43:45 +01:00
Dan Shick
c0da39f022 Add proper event loop. Remove last threads. Update CI with pipewire. 2020-03-13 21:01:32 +01:00
Dan Shick
eb229b708e Remove thread for pipewire and all locking. Add support for elogind in meson. 2020-03-13 21:01:32 +01:00
Dan Shick
2a31d2d922 Add thread for wlr screensharing 2020-03-13 21:01:32 +01:00