Skip to content
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

Don't hold a reference to a GraphicsCaptureItem when not capturing #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TheLastRar
Copy link
Contributor

Only create the GraphicsCaptureItem just before we need to use the capture

This will allow the Windows Graphics Capture service to suspend itself when we are not capturing

This also gives the bonus effect of no longer having issues when the service dies while we aren't capturing (which would crash uWC without #43

This did require a couple changes I would like you to review the impact of;
Removal of IsAvailable, as this relied on a persistent item_, this may affect any code that ensures capture is possible
Using GetWindowTitle() when a given item is not capturing

@hecomi
Copy link
Owner

hecomi commented Mar 28, 2022

Thanks for the pull request. Please give me a few moments to review.

@hecomi hecomi self-assigned this Mar 28, 2022
@hecomi
Copy link
Owner

hecomi commented Apr 17, 2022

Sorry for the delay in replying.

I have tried and it worked in Windows Graphics Capture mode. However, uWC currently has three capture methods (Windows Graphics Capture / PrintWindow / BitBlt). If Auto mode is set, it tries Windows Graphics Capture first, and if it is not available (e.g. in the case where it captures child windows), then try the other available methods. If IsAvailable() is removed, this Auto mode will not work, so I would like to find another way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants