-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: WGC Capture Improvements (allow usage in service) #4066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I had closed it because I suspect it might be another few weeks before this one is fully polished and ready to go. It did not mean I was stopping the work entirely. I had planned on doing a re-submit once the polish was completed, however after some discussions with RA we both agreed its best to put it back in draft. So to clarify, this is still planned and I am working on it… but I have been getting my ass kicked the past week on this one. I try one thing and the entire thing breaks. The code is mostly working as-is right now, just quality wise it is not that great. I really had hoped to get this in a reviewable state much sooner, but I am really struggling getting that down. |
- Introduced `sunshine_wgc_helper.cpp` to handle Windows Graphics Capture. - Removed the old `shared_memory.cpp` as its functionality is integrated into the new helper. - Created a simple test program `test_wgc_ipc.cpp` to verify the IPC implementation. - Updated `CMakeLists.txt` to include the new helper executable and its dependencies. - Added unit tests for process handling and shared memory functionality. - Implemented integration tests for the display IPC to ensure proper initialization and error handling. - Enhanced existing tests for robustness and added deadlock protection.
Co-authored-by: ReenigneArcher <[email protected]>
They no longer require acquire/release because the frame queue is no longer multithreaded.
|
|
Kudos for your work! Btw it looks like you closed it again by mistake |
|
Thanks for great work, I've been testing this (wgc variable) for a while with Moonlight VRR client at 120fps and stream smoothness after last commit [refactor pointer usage] now seems to be on par with ddx capture method. Host processing latency is lower up to 1 ms in comparison to ddx. |
Good morning, due to disagreements with owner the PR actually was intentionally closed. I'm not sure if I'm going to be banned yet but that's typically what he will do as next step. |
|
Don't blame me... You had a disagreement with yourself at 3am, again. Last time you were banned because you started cussing at me. If you start that again, yes you will be banned. |
|
I'm just saying that because you've banned everyone else who's disagreed with you in the past. But thanks for clearing that up |
|
You have absolutely no idea who has been banned or why, so stop spewing misinformation. I've never banned anyone who I disagreed with. I've only ever banned spammers and people who can't act professional and follow the code of conduct. https://github.com/LizardByte/.github/blob/master/CODE_OF_CONDUCT.md |
|
I am re-opening this if Sunshine decides to inherit it or not. It does not matter to me. I maintain my own fork now; however, WGC still has major benefits for users, so I am open to having it reviewed again. I have been testing it for a few months now and haven't had issues so its pretty much stable as is. |
|
|
This is unlikely to get merged in it's current state, some things that can be done to improve the chances. A. Fix sonar warnings (rebase needed to actually view the current ones) |
A. Not going to happen, SonarQube is a complete waste of time and resources and 99% of the “issues” is more of an opinion rather than an actual serious issue. This code has been working for months without crashes and is fine, any sonar warning is entirely pointless. B. Also unrealistic, this is low level code and would be challenging to write tests for because its would only work on the Windows Environment. C. Fixing the split log issue is easy, we can just add more compiler switches to null-out the extra logging code. D. Also unlikely going to happen, splitting a complex feature into multiple smaller PR’s is much worse than having it all together. How can anyone test code in the PR if for example it is not complete? If I make a smaller PR that makes the capture process, but does not include anything else, the entire PR is pointless and also cannot be tested because you need more than just that code to see it function. |




Description
This pull request introduces Windows Game Capture (WGC) support to Sunshine via a dedicated helper process, along with a reusable IPC framework for inter-process communication.
Motivation and Benefits
Sunshine currently relies on DXGI for screen capture on Windows, which works well but has limitations in headless service mode, frame pacing consistency, and compatibility with features like Xbox Game Bar. WGC addresses these by providing a more robust, game-optimized capture API.
Key benefits include:
Implementation Overview
sunshine_wgc_capture.exeas a subprocess launched by the Sunshine service.Development Status
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage