Skip to content

win-capture: Improve automatic capture method selection - #13962

Open
CryZe wants to merge 1 commit into
obsproject:masterfrom
CryZe:win-capture-transparent-window-auto-selection
Open

CryZe wants to merge 1 commit into
obsproject:masterfrom
CryZe:win-capture-transparent-window-auto-selection

Conversation

@CryZe

@CryZe CryZe commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Description

Transparent windows using DirectComposition are recommended to not keep a redirection surface (WS_EX_NOREDIRECTIONBITMAP) to save memory. This has the consequence that the BitBlt method will not work correctly. In that case the automatic capture method selection now prefers the WGC method.

Motivation and Context

Capturing transparent windows that use DirectComposition without a redirection surface don't work without the user manually switching to the "Windows 10" capturing method. Soon LiveSplit will support proper transparency, so I would like it to easily be capturable. This does not yet address various related blending issues, but this is a good first step.

How Has This Been Tested?

I created a test build and captured my WIP LiveSplit build, which works now with the automatic selection, while the master version does not.

  • OS: Windows 11 Pro 25H2
  • CPU: Intel Core i9-13900KF
  • GPU: NVIDIA GeForce RTX 4090
  • RAM: 64 GiB

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
  • I have used AI tooling in the creation of this PR.

I used Codex to research the problem (as to what the original reason was why my window doesn't get auto detected, which led me to the no redirection surface) and help me with my build environment. The code and the PR are hand written of course. I've contributed to OBS before AI was a thing, so writing the code isn't an issue.

Transparent windows using DirectComposition are recommended to not keep
a redirection surface (`WS_EX_NOREDIRECTIONBITMAP`) to save memory. This
has the consequence that the BitBlt method will not work correctly. In
that case the automatic capture method selection now prefers the WGC
method.

Additionally, this also makes it so the automatic capture method
selection is redone when the target window changes.

References: https://learn.microsoft.com/en-us/archive/msdn-magazine/2014/june/windows-with-c-high-performance-window-layering-using-the-windows-composition-engine

This branch has not been deployed

No deployments
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.

1 participant