uWindowCapture
uWindowCapture copied to clipboard
Don't hold a reference to a GraphicsCaptureItem when not capturing
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 https://github.com/hecomi/uWindowCapture/pull/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
Thanks for the pull request. Please give me a few moments to review.
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.