Commit Graph

191 Commits

Author SHA1 Message Date
David Lane
188f1e2959 style(cpp): separate multiple variable declarations (#4795) 2026-03-01 09:02:17 -05:00
David Lane
2b7af2119d refactor: replace macros with constexpr/consts (#4791) 2026-02-28 18:22:33 -05:00
Vladimir Solomatin
5395a9a515 fix(linux/xdgportal): don't pass external_only argument to eglQueryDmaBufModifiersEXT (#4754) 2026-02-26 15:00:18 -05:00
Conn O'Griofa
502be64682 fix(linux/kmsgrab): fix handle leak in update_cursor (#4757) 2026-02-22 15:56:35 -05:00
Conn O'Griofa
95da4b5c85 feat(linux/xdgportal): implement reactive capture with duplicate detection (#4740)
* feat(linux/xdgportal): implement reactive capture with duplicate detection

Replaces polling-based frame capture with event-driven approach using
condition variables for immediate notification when new frames arrive.

Changes:
- on_process: Notify snapshot() via condition variable on new buffer
- fill_img: Extract and pass through PipeWire seq/pts metadata
- snapshot: Block on condition variable with timeout; detect and skip
  duplicate frames using seq/pts metadata to avoid redundant processing
- capture: Simplify catch-up logic to maintain timeline consistency
  by advancing in delay intervals without resetting origin

This eliminates tight polling loops and reduces unnecessary frame
processing when compositor reuses buffers.

* feat(linux/xdgportal): optimize software path and fix modesetting crashes

This patch addresses a performance bottleneck in the software encoding
path and a race condition during PipeWire stream re-initialization.

1. Performance Optimization (Double-Buffering):
   - Implemented a front/back buffer swapping strategy for the software
     (MemPtr) path.
   - Frame data is copied to a `back_buffer` without holding the
     `frame_mutex`, then swapped with the `front_buffer` under a
     short-lived lock.
   - This prevents memory bandwidth contention and allows the encoder
     and PipeWire threads to work in parallel without blocking.

2. Stability Fixes:
   - Implemented `frame_mutex` protection across `on_process`, `fill_img`,
     and `cleanup_stream` to prevent use-after-free and dangling pointers
     during resolution changes.
   - Enhanced `fill_img` to safely bail out if the stream is dead or
     no new frame is ready.
   - Added explicit state resets (`frame_ready = false`, `current_buffer = nullptr`)
     to ensure the encoder thread ignores stale data during re-init.

Fixes intermittent segfaults during resolution changes and restores
performance on systems using software encoding.

* feat(linux/xdgportal): support x-nv-video[0].clientRefreshRateX100 for requesting fractional NTSC framerates

* fix(linux/xdgportal): improve dbus & pipewire teardown logic

* Close dbus proxy connection; fixes orphaned XDG notification icons after
  mode changes or stream pauses via XDG icon interaction.
* Migrate shared pipewire destructor logic into cleanup_stream() to reduce
  duplication.

---------

Co-authored-by: Andy Grundman <andy@hybridized.org>
2026-02-22 12:43:49 -05:00
herbie
c9bcee4480 fix(linux): fix touch misalignment for wlgrab on scaled outputs (#4665) 2026-02-17 23:40:16 -05:00
Conn O'Griofa
24c5dfd622 fix(linux/xdgportal): stream scaling and mode change support (#4700) 2026-02-15 17:42:11 -05:00
Conn O'Griofa
638cd699d4 fix(linux/xdgportal): improve thread loop (un)locking & teardown logic (#4705) 2026-02-12 10:34:22 -05:00
David Lane
5bd3a2b225 docs: miscellaneous updates (#4597) 2026-02-08 00:12:38 -05:00
Conn O'Griofa
2f61116432 revert: "fix(linux/xdgportal): flag stream as realtime" (#4686)
This reverts commit bf574afdfd.
2026-02-07 22:03:27 -05:00
Conn O'Griofa
bf574afdfd fix(linux/xdgportal): flag stream as realtime (#4684) 2026-02-07 11:32:37 -05:00
Conn O'Griofa
b48a96f9f1 fix(linux/xdgportal): populate host latency statistics (#4685) 2026-02-07 09:40:06 -05:00
David Lane
874880e5ea feat(linux)!: Support streaming through XDG portals and Pipewire (#4417)
Co-authored-by: Carlos Garnacho <carlosg@gnome.org>
Co-authored-by: Carson Katri <Carson.katri@gmail.com>
Co-authored-by: Bond <bond-d@ukr.net>
Co-authored-by: d.bondarev <d.bondarev@crm-onebox.com>
Co-authored-by: Conn O'Griofa <connogriofa@gmail.com>
2026-02-03 08:19:02 -05:00
Cole Leavitt
38a94b3cfd fix(linux/kms): skip NVIDIA cards for VAAPI on hybrid GPU laptops (#4473) 2026-01-25 19:10:11 -05:00
Andy Grundman
3a12f96a86 perf(threads): implement adjust_thread_priority for macOS and add set_thread_name (#4605) 2026-01-22 19:38:09 -05:00
Julio Sanz
aca5d23f4e fix(linux): fix issues with rendering and touchscreens when displays are scaled (#4607) 2026-01-21 18:29:53 -05:00
Julio Sanz
c313851878 fix(linux): added support for logical screen size with zxdg_output_v1 (#4594) 2026-01-17 20:32:24 -05:00
tstokes22
fd2bfaac7e fix(windows): resolve disappearing cursor after KVM switch (#4407) 2026-01-16 19:45:16 -05:00
Dregu
cf7b0dc7d3 fix(linux/wlr): Fix dmabuf buffer params protocol violation/leak (#4588) 2026-01-16 13:19:45 -05:00
Cameron Gutman
4a9f17415b build(vaapi): Add vaMapBuffers2() stub (#4581) 2026-01-12 23:33:00 -06:00
David Lane
1d6d916b7a build: add freebsd support (#4049) 2025-11-11 23:46:11 -05:00
ns6089
cdb7e2b813 feat(video): use unified color conversion matrix generator (#4387) 2025-11-05 08:49:56 -05:00
David Lane
875ad1d11a build(deps): bump boost to 1.89 (#4253) 2025-11-01 21:02:15 -04:00
Mariotaku
fbcf2116c2 feat(audio): allow sending continuous audio (#4261) 2025-10-11 16:53:11 -04:00
Ehren Bendler
26e5f2f610 build(Linux): Cleanup CUDA compiler options for modern versions (#4162) 2025-08-19 10:05:25 -04:00
Kishi
cc6e853fba feat(input/linux): allow ds5 gamepads to have a fixed device mac based on controller index (#4158) 2025-08-16 18:17:04 -04:00
Cameron Gutman
02036920ac build(deps): Update to FFmpeg 8.0 branch (#4143) 2025-08-10 13:22:00 -04:00
ReenigneArcher
dbe80d0f92 style(sonar): fix cpp:S6185 (#4133) 2025-08-07 23:17:13 -04:00
Cameron Gutman
2a9bb98c6e fix(build): remove VLA zeroing to fix Clang build (#4052) 2025-07-06 00:50:34 -05:00
LizardByte-bot
1df4c89026 chore: update global workflows (#3813)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2025-04-25 19:09:06 -04:00
Ondřej Glet
b43a9b8efb fix(linux): headless monitors on wayland (#3783) 2025-04-14 09:56:21 -04:00
ABeltramo
f65bb842ff feat(input/linux): DualSense adaptive trigger support (#3738) 2025-03-26 19:16:20 -04:00
ReenigneArcher
2cd4b1b3ad fix(linux): update sunshine rules (#3748)
Co-authored-by: ABeltramo <beltramo.ale@gmail.com>
2025-03-25 08:26:32 -04:00
ReenigneArcher
c2420427b1 style: adjust clang-format rules (#2186)
Co-authored-by: Vithorio Polten <reach@vithor.io>
2025-01-19 22:34:47 -05:00
ReenigneArcher
f57aee9025 build(linux)!: remove legacy input option (#3562) 2025-01-19 12:18:08 -05:00
ReenigneArcher
820180c9e7 docs(hrefs): update readthedocs hrefs (#3476) 2025-01-13 22:34:54 -05:00
Lukas Senionis
76bea8acb9 feat(display): Configure display device based on user config (#3441) 2025-01-07 20:40:48 -05:00
Cameron Gutman
fb1f5b5a89 fix(hostname): fix handling of non-ASCII hostnames on Windows (#3382) 2024-11-09 14:05:46 -06:00
Cameron Gutman
1cab1a5a1e fix(process): avoid leaking zombies and fds in detached processes (#3379) 2024-11-07 22:15:33 -06:00
Cameron Gutman
9e52ac426d feat(vaapi): add option to enable strict enforcement of frame size (#3332)
* feat(vaapi): add option to enable strict enforcement of frame size

* Eliminate the QP fallback code that was only required for VAAPI
2024-11-01 12:36:25 -05:00
Lukas Senionis
e90b71ce62 fix(boost)!: migrate boost to 1.86 (#3256) 2024-10-03 21:42:16 -04:00
ReenigneArcher
697e877070 fix(linux): use correct value for AMD_DEBUG environment variable (#3115) 2024-09-01 09:01:03 -04:00
LizardByte-bot
0f40a092de chore: update global workflows (#3113)
Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
2024-08-31 17:45:57 +00:00
Cameron Gutman
88ce5077b0 fix(mdns): don't hardcode mDNS instance name (#3084) 2024-08-25 19:20:33 -04:00
ReenigneArcher
bf92fda969 fix(linux): enable lowlatency mode for AMD (#3088) 2024-08-25 10:50:51 -04:00
Insanemal
c246c78b13 fix(linux): ensure NvFBC capture works after multiple sessions (#3020) 2024-08-15 21:30:00 -04:00
ns6089
f9c885a414 fix(linux/audio): don't set pulseaudio buffer size (#2999) 2024-08-09 20:29:17 +00:00
ns6089
f4dda21248 Migrate audio pipeline to float from 16-bit integer (#2873)
Co-authored-by: Cameron Gutman <aicommander@gmail.com>
2024-07-25 21:01:43 -04:00
Cameron Gutman
3935d305ae Implement S/G IO for batched sends and eliminate another frame copy (#2874) 2024-07-19 04:04:18 +00:00
Cameron Gutman
81c6e61594 Implement S/G IO for non-batched sends and eliminate more data copies (#2867) 2024-07-18 02:34:56 +00:00