Commit graph

71 commits

Author SHA1 Message Date
Simon Ser
491cbb1cc6 Constify config_path arguments
These are not modified.
2021-03-15 18:08:57 +01:00
Simon Ser
b92ad3eb6b Drop /etc/xdg-desktop-portal-wlr/ from config file dirs
We were checking both /etc/xdg-desktop-portal-wlr/ and
/etc/xdg/xdg-desktop-portal-wlr/. These two directories serve the same
purpose, let's just settle on a single one.
2021-03-15 18:08:57 +01: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
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
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
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
a7ea407e2f Remove --pixelformat flag
This hack is not needed anymore.
2020-05-05 10:00:10 -04: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
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
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
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