Commit Graph

247 Commits

Author SHA1 Message Date
vaxerski 084d0375e9 updated protocols 2022-12-12 14:50:02 +00:00
Mihai Fufezan 9381d5b41b
nix: fix build 2022-12-12 00:29:37 +02:00
vaxerski 7d491f77bb
toplevel sharing rev2 2022-12-12 00:28:35 +02:00
Mihai Fufezan 1fa106cfdf
Merge pull request #4 from rubyowo/nix-homepage
nix: fix: homepage url
2022-12-12 00:13:27 +02:00
rubyowo fa6a9772d5
nix: fix: homepage url 2022-12-11 21:03:28 +04:00
Vaxry 713e0a1491
update readme 2022-12-10 20:31:30 +00:00
Mihai Fufezan 5f7eecff55
nix: wrap hyprland-share-picker with hyprland in PATH 2022-12-09 15:37:23 +02:00
vaxerski 756789211e export HIS to the picker 2022-12-05 23:20:49 +00:00
vaxerski 2a634b0a60 log more about screencast 2022-12-05 23:11:13 +00:00
vaxerski 4ac6a9af82 export xcursor size to avoid odd-sized cursors 2022-12-05 18:53:51 +00:00
vaxerski 8fba72d33d use in wlroots because we don't conflict 2022-12-05 01:08:56 +00:00
Mihai Fufezan af840a9e09
nix: fix picker not found 2022-12-05 03:05:38 +02:00
vaxerski ac442cc1b2 add aur install 2022-12-05 01:04:20 +00:00
vaxerski 4a1d0c7c92 add usage 2022-12-05 00:57:46 +00:00
vaxerski 38f35236e9 added additional deps 2022-12-05 00:43:40 +00:00
vaxerski cea7c28bae force wayland platform for qt in invoking picker 2022-12-05 00:37:10 +00:00
vaxerski bd91bd0d4e pass env to popen cmd picker 2022-12-05 00:13:36 +00:00
vaxerski 9f933f42f1 add prefix 2022-12-05 00:08:17 +00:00
vaxerski 8a4e83da96 prevent segfaults on no toplevel proto available 2022-12-04 23:18:10 +00:00
Vaxry 3c850a0336
Window sharing (#2)
* added window sharing support

* nix: add hyprland-protocols and streamline build

Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
2022-12-04 21:12:57 +00:00
Mihai Fufezan 1d70c4600b
nix: build hyprland-share-picker 2022-12-04 22:23:27 +02:00
Vaxry 4cbddd34a1
Merge pull request #1 from leftas/master
Change from wlr to hyprland so dbus would recognize
2022-12-04 19:23:35 +00:00
Leftas 607ce73671
Change from wlr to hyprland so dbus would recognize different implementation 2022-12-04 19:57:30 +02:00
Mihai Fufezan 3d3c5a4200
nix: add files 2022-12-04 01:45:36 +02:00
vaxerski e2cfaf3eee minor nix fixes 2022-12-03 23:42:56 +00:00
vaxerski 37c76fd7d8 start at pos 7 to avoid a warn 2022-12-03 23:40:08 +00:00
vaxerski 2dc95fe02f Allow region sharing 2022-12-03 22:42:21 +00:00
vaxerski 80775707ea Implement hyprland-share-picker 2022-12-03 21:27:49 +00:00
Vaxry f2e64940ae
updated readme 2022-12-03 20:47:58 +00:00
Nick Cao 0a8bfa1460 scdoc: mark as build-time dependency 2022-11-21 10:48:20 +01:00
columbarius c83b3cc514 screenshot: Announce version property 2022-09-12 23:33:54 +02:00
Linken Dinh 94c45603b9 add Hyprland to wlr.portal 2022-09-11 23:56:56 +02:00
Simon Ser 1cc5ff570d readme: restrict build badge to commits in the master branch 2022-06-09 11:36:16 +02:00
Simon Ser 520d83ff56 build: bump version to 0.6.0 2022-06-09 11:25:25 +02:00
columbarius 723934d0b0 screencast: check if a valid format was received from wlr_screencopy
When a screencast is started we do a roundtrip on get the offered
formats from wlr_screencopy. This roundtrip can fail [1]. In this case
the formats won't be initialized and we will just error out of the
screencast session.

[1] https://github.com/emersion/xdg-desktop-portal-wlr/issues/214
2022-06-09 11:19:54 +02:00
columbarius 0bbd652c1c screencast: send pesentation timestamp via PipeWire 2022-06-01 21:12:46 +02:00
columbarius b5491df0c0 screencast: destroy session if output is removed
We teardown all existing screencast_instances using the removed output
by destroying the frame, removing all timers and then marking the
instance as ready for teardown so we can destroy it after the last connected
session is closed.

Any wlr_screencopy_frame_v1 has to be destroyed before the connected
output can be removed. Otherwise wlr_screencopy_frame_v1_destroy
segfaults the whole program. To ensure this we will make all frame
callbacks safe to be triggered for a previous destroyed frame.
2022-05-31 01:23:34 +02:00
columbarius ab0a07142d screencast: use wl_array for format-modifier-pairs
wl_array is a better fit than wl_list. It's less intensive on memory and
fits nicely with the flow of dmabuf_feedback announcing all format
modifier pairs at once and reseting them on change.
2022-05-31 01:22:48 +02:00
columbarius 2d54aeb36d screencast: fix handler logging for tranche_formats 2022-05-26 09:39:14 +02:00
columbarius e70a1efa43 screencast: skip duplicated format-modifier pairs 2022-05-26 09:00:40 +02:00
columbarius 2219db7508 screencast: use dmabuf_feedback
The compositor can announce it's default rendering device via
linux_dmabuf_feedback as the main_device [1]. We should use this device
whenever possible. If aquiring this device fails we are adviced to use
force linear layout on buffers allocated with the implicit api.

With linux_dmabuf_v1 the modifier event is deprecated. Instead the
format_table event in combination with the tranches of
linux_dmabuf_feedback_v1 has to be used.

[1] https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/unstable/linux-dmabuf/feedback.rst
2022-05-26 09:00:40 +02:00
columbarius 3591fd2a6c meson: bump version and replace deprecated functions 2022-05-06 21:51:58 +02:00
columbarius 4516d8b79e protocols: Use protocols from the wayland-protocols dependency
We can generate protocol code for wayland-protocols directly from the
dependency instead of shipping our own copy.
2022-05-06 21:51:58 +02:00
columbarius 14852efb05 screencast: Remove MESA hack from the old gbm api fallback
Calling gbm_bo_create_with_modifiers2(...) and setting the modifiers
pointer to NULL for the same result as gmb_bo_create(...) is a MESA hack,
which I missed to remove from 84282e9b5f.
2022-05-05 18:13:02 +02:00
Guido Günther 371138e4c7 Add phosh to portal's UseIn list
The compositor is phoc but XDG_CURRENT_DESKTOP has "Phosh".
2022-04-30 22:12:25 +02:00
columbarius 29f86168b6 screencast: announce supported explicit modifiers
We query the supported modifiers via a wrapper and announce them via
PipeWire.

This wrapper queries the supported formats from wlroots and returns them
as a simple array. The purpose of this wrapper is to ease the use of the
query functions which are kept in the style of the equivalent egl
queries.
2022-04-24 21:46:39 +02:00
columbarius 18efde6dde screencast: add function to query supported modifiers for a format
This function follows the structure of the equivalent function in egl
operating on basis of the announced format modifier pairs by wlroots.
2022-04-24 21:46:39 +02:00
columbarius 2ca2b7b603 screencast: get supported format modifier pairs from wlroots
Registering a zwp_linux_dmabuf_v1_listener gives access to the supported
format modifier pairs of the compositor.

This handler emits events for each format modifier pair. Those are stored
and will later be used to announce capabilities via PipeWire.
2022-04-24 21:46:39 +02:00
columbarius b9c4472c50 screencast: stop assuming that allocation with implicit modifier works
It has shown that the assumption: "Allocation with implicit modifier will
always be available" doesn't hold true in all cases. Thus if allocation
of any dmabuf fails we mark the session to avoid dmabufs, thus falling
back to shm transport.
2022-04-24 21:46:39 +02:00
columbarius 84282e9b5f screencast: fixate modifier from PipeWire format negotiation result
This implements the modifier fixation procedure. The producer of a
stream has to ensure that it can create a buffer with the negotiated
properties. To do that we will take the result of the intersection of
supported modifiers by PipeWire and select the "best" modifier from that
list.

To do this we do the following allocations and fixate on the
modifier of the created buffer should the allocation suceed.
* Try to allocate a buffer with explicit modifiers using the list
  provided by PipeWire
* Walk the list of modifiers and do single allocations for implicit and
  linear modifiers using the old api.

If none of the allocations above succeed we fall back to shm buffers.
This is implemented in the next commit.

If an allocation was successfull we fixate the modifier with
fixate_format().
This function creates an EnumFormat like build_format, but will only
announce support for a single modifier.
It is used to finish the negotiation process by announcing it together
with EnumFormats of our full supported formats.
2022-04-24 21:46:39 +02:00