Commit graph

34 commits

Author SHA1 Message Date
columbarius
5e4edae701 wlr_screencast: remove wl_display_dispatch
wl_display_dispatch is unnecessary and can cause hangs, if no new requests are queued
2021-04-17 16:25:54 +02:00
columbarius
ca46a98b86 wlr_screencast: add xdg_output_listener after output registration if possible 2021-04-17 11:33:48 +02:00
columbarius
3ca286b0b4 wlr_screencast: call wlr_remove_output only if global is an output 2021-04-17 11:33:48 +02:00
columbarius
d83431335d wlr_screencast: create clean xdpw_wlr_output and free on remove 2021-04-17 11:33:48 +02:00
columbarius
94f1f5d0a8 screencast: workaround corrupted output_list 2021-04-02 15:07:38 +02:00
columbarius
9d78b21695 screencast: add outputchooser with config option
Supports "dmenu" chooser type, which is called with a dmenu type list
piped to stdin, "simple" type, which recieves nothing on stdin and
default, which tries the hardcoded choosers.
Choosers are required to return the name of the choosen output as given
by the xdg-output protocol.

Thanks to piater for closing overlooked pipes.
Thanks to ericonr for suggestions regarding fork and pipes.
2021-04-02 15:07:38 +02:00
Zsolt Donca
ab8ff54f4c Control how many frames are captured per second
The goal is to control the rate of capture while in screencast, as it
can represent a performance issue and can cause input lag and the
feeling of having a laggy mouse.

This commit addresses the issue reported in #66.

The code measures the time elapsed to make a single screen capture, and
calculates how much to wait for the next capture to achieve the targeted
frame rate. To delay the capturing of the next frame, the code
introduces timers into the event loop based on the event loop in
https://github.com/emersion/mako

Added a command-line argument and an entry in the config file as well
for the max FPS. The default value is 0, meaning no rate control.

Added code to measure the average FPS every 5 seconds and print it with
DEBUG level.
2021-03-08 16:59:17 +01:00
Simon Ser
c6d52b4412 Remove extraneous whitespace 2021-02-11 18:55:48 +01:00
columbarius
dafb25fdb1
Update to wlr-screencopy-unstable-v1 version 3 2020-10-19 23:40:30 +02:00
Manuel Romei
25e7719d18
Revert "Remove unnecessary check from wlr_screencast.c" (#54)
* Revert "Remove unnecessary check from wlr_screencast.c"

This reverts commit cc59abb124.
Fixes emersion/xdg-desktop-portal-wlr#50

* Clarify why the check in wlr_screencast is needed
2020-09-11 10:38:04 -04:00
columbarius
61db8968f9 Fix linewidth in wlr_screencast.c 2020-08-23 20:06:47 +02:00
columbarius
cc59abb124 Remove unnecessary check from wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
5ea10ef253 Remove TODO from wlr_sreencast.c 2020-08-18 15:47:44 +02:00
columbarius
a8d12c6163 Rename wlr_frame_buffer_clear to wlr_frame_buffer_destroy in wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
24a793135c Add comments to wlr_frame_buffer_clear in wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
06aa0a0bda Change loglevel for existing buffer in wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
15e30ed35d Remove unecessary checks in wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
c6253415c0 Add functions to clean simple_buffer.{data,buffer} in wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
f23e9e4921 Change refresh logic and add tests in wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
9d4193e5b2 Refresh buffer on change in wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
9c353d6cfb Fix log messages in wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
1245e9c353 munmap simple_frame.data only if needed in wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
4c20660f74 Only recreate simple_frame on change in wlr_screencast.c 2020-08-18 15:47:44 +02:00
columbarius
e57beee43d Destroy wlr_buffer only on quit or error in wlr_screencast.c 2020-08-18 15:47:44 +02:00
Dan Shick
229a34a9fe Globally define _POSIX_C_SOURCE in meson.build
Fix musl issue with time.h
2020-04-23 09:53:34 +02:00
Dan Shick
f6d14d9206 Check cast instance refcount before attaching 2020-04-21 14:45:55 +02: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
45699637d1 Fix CI with libpipewire02, libdrm. Remove png.h unused import. Cleanup style. 2020-03-13 21:01:32 +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
b0c50ff911 Add proper logging 2020-03-13 21:01:32 +01:00
Dan Shick
080d519a0d Add xdg_output protocol for output selection 2020-03-13 21:01:32 +01:00
Dan Shick
7b699f3344 Use variable framerate, add CLI option to override pixelformat metadata 2020-03-13 21:01:32 +01:00
Dan Shick
2a31d2d922 Add thread for wlr screensharing 2020-03-13 21:01:32 +01:00