Commit graph

127 commits

Author SHA1 Message Date
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
danshick
323d89ead7 Fix link to trigger-screen-shot.py 2021-03-04 20:42:40 +01:00
Simon Ser
4489ea4bb6 Fix whitespace issues in meson.build 2021-03-04 20:17:35 +01:00
Simon Ser
d3ac33a0aa Fix segfault in config_parse_file
configfile is a `char *`. %s needs a `char *`, so we shouldn't
dereference the pointer here.

Closes: https://github.com/emersion/xdg-desktop-portal-wlr/issues/91
2021-03-04 14:16:30 -05:00
columbarius
07154bb1e3
Add support for config file
Closes: https://github.com/emersion/xdg-desktop-portal-wlr/issues/60
2021-03-03 10:29:56 +01:00
Simon Ser
e103e120e2 Bump to v0.2.0 2021-02-15 10:22:29 +01:00
danshick
92e6877fce
Update README to include repology badge 2021-02-15 10:20:30 +01:00
Simon Ser
5401e7f9f2 Add --replace flag
This allows replacing a running xdpw instance. xdg-desktop-portal
itself has this feature.

This is useful when developing, to stop the currently running
system instance.
2021-02-11 13:24:53 -05:00
Simon Ser
c6d52b4412 Remove extraneous whitespace 2021-02-11 18:55:48 +01:00
Simon Ser
9f72a6d874 Fix freeze on skipped frame
When a frame is skipped, we weren't destroying the wlr frame. Since
this function kicks off the next frame capture, the stream was getting
stuck.

Closes: https://github.com/emersion/xdg-desktop-portal-wlr/issues/81
2021-02-11 18:55:48 +01:00
Tobi Fuhrimann
5b646c0482 Link official Arch Linux package in readme 2021-02-09 23:55:32 +01:00
Jan Beich
cf3e02695e ci: add FreeBSD job
Test basu unlike Alpine (elogind) and Arch (systemd).
2021-01-09 12:21:13 +01: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
Jan Beich
4dbeaf3a06 build: add basu as sd-bus provider
Based on https://github.com/emersion/mako/commit/805663cc76e0
2021-01-09 12:21:13 +01:00
Jan Beich
7b7d927cae build: introduce sd-bus-provider option
Based on https://github.com/emersion/mako/commit/67f2ed1862a9
2021-01-09 12:21:13 +01:00
Isaac Freund
727f13f34d Add river to portal UseIn list 2020-12-08 15:46:19 +01:00
columbarius
f0e1de02f4 Fix cursor_mode checks in screencast.c 2020-11-06 13:44:58 +01:00
columbarius
24bc68f0f2 Remove SPA_PARAM_BUFFERS_dataType
Don't announce a SPA_PARAM_BUFFERS_dataType. This is reserved for consumer
2020-11-04 11:09:09 -05:00
Christopher Snowhill
cb36e0df23 Add Wayfire to portal UseIn list, as it is also supported 2020-10-27 08:25:12 +01:00
columbarius
dafb25fdb1
Update to wlr-screencopy-unstable-v1 version 3 2020-10-19 23:40:30 +02:00
columbarius
39b82ff471 Bump minimum pipewire version 2020-09-19 10:22:44 +02:00
columbarius
c2883a4e43 Add pipewire buffers_dataType parameter in pipwire_screencast.c 2020-09-19 10:22:44 +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
Maxim Baz
68f9759a78 systemd: ensure service is stopped on exit of graphical session 2020-08-07 12:33:26 -04:00
danshick
bc89778fdc Update contrib to mention XDG_DESKTOP_PORTAL_DIR 2020-05-27 16:49:15 +02:00
Marian Buschsieweke
1e92d603a8 core/main: Clean up option handling
- Add a missing space in the usage string
- Drop short option "p", which is unused
2020-05-26 17:02:56 +02:00
Marian Buschsieweke
4cd31295cf core/main: Use EXIT_FAILURE / EXIT_SUCCESS 2020-05-26 12:58:13 +02:00
Marian Buschsieweke
05f44e7a7d core/main: Add static qualifier to internal func 2020-05-26 12:58:13 +02:00
Marian Buschsieweke
a105e0e363
core: fix error handling in main
The error handling at the `error:` label tears down the whole state. Thus, the
state needs to be fully initialized in order for the tear down to succeed.
Currently, if e.g. `sd_bus_open_user()` fails, a `segfault` is triggered by
the tear down. This commit adds individual tear down code that only touches
stuff that until that point was successfully initialized.
2020-05-21 16:44:47 +02:00
Simon Ser
b82d3fcc01
build: bump version to 0.1.0 2020-05-05 16:18:37 +02:00
Simon Ser
f5bfe9fe12 Replace void * with correct type in start_screencast 2020-05-05 10:00:10 -04:00
Simon Ser
a7ea407e2f Remove --pixelformat flag
This hack is not needed anymore.
2020-05-05 10:00:10 -04:00
Simon Ser
26b6bf69aa Advertise format with alpha channel stripped 2020-05-05 10:00:10 -04:00
danshick
3b56140032
Add documentation
Improve the README, add links to the wiki and add a contributing guide.
2020-04-29 19:50:53 +02:00
Simon Ser
6ecb5dffc7
ci: add Alpine build (#30)
Alpine uses musl, which may behave differently than glibc. Add Alpine to
the CI to make sure we don't rely on glibc-specific behaviour.

References: https://github.com/emersion/xdg-desktop-portal-wlr/issues/28
2020-04-23 09:57:02 -04: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