Skip to content

fix(scap-direct3d): compare in-flight frames to pool size instead of content size (#3594) - #3600

Open
ghazy2001 wants to merge 1 commit into
CapSoftware:mainfrom
ghazy2001:fix/desktop-recording-stall-at-zero-seconds-3594
Open

ghazy2001 wants to merge 1 commit into
CapSoftware:mainfrom
ghazy2001:fix/desktop-recording-stall-at-zero-seconds-3594

Conversation

@ghazy2001

@ghazy2001 ghazy2001 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3594 (CAP-959)

Problem

In Cap v0.6.2, recording immediately stalls at 0 seconds and self-terminates after roughly 3-5 seconds without producing any usable recording on Windows.

Root Cause

When \ ollow_item_size\ was introduced in scap-direct3d, in-flight frame drops checked whether (surface_desc.Width, surface_desc.Height) != (content_width, content_height). On Windows, the \GraphicsCaptureItem\ texture surface for a window capture includes invisible resize borders / drop shadow margins, causing \surface_desc\ to not match \content_width\ and \content_height. Consequently, every single frame was dropped, preventing \on_frame_arrived\ from ever firing until the 5-second initial frame timeout expired and aborted the recording.

Fix

Compare (surface_desc.Width, surface_desc.Height)\ against the active \pool_size\ instead. This accurately drops only stale frames that were in-flight during a dynamic window resize before pool recreation, while allowing normal window frames to proceed to the content trimming and encoding pipeline.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

The PR checks incoming surface dimensions against the active frame pool rather than the frame’s content size.

  • Window capture checks frame surfaces against the active pool size.

Reviews (1) · Last reviewed commit: "fix(scap-direct3d): compare in-flight fr..." · Reviewed by Greptile

…content size (CapSoftware#3594)

Resolves issue CapSoftware#3594 where Windows desktop recording immediately stalls at 0 seconds and self-terminates after a 5-second timeout.

- When follow_item_size is enabled, in-flight frame drops should discard frames whose surface texture dimensions do not match the expected pool dimensions before a pool recreation.
- Comparing (surface_desc.Width, surface_desc.Height) against (content_width, content_height) erroneously dropped all window capture frames because Windows.Graphics.Capture window surfaces include drop shadows and invisible resize borders that differ from content bounds.
- Replaces the content size comparison with the active pool_size, allowing valid window frames to be trimmed and processed rather than dropped.
@vercel

vercel Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

@ghazy2001 is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

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.

Critical Bug: Recording immediately stalls at 0s and self-terminates after 3–5s on v0.6.2

1 participant