Skip to content

Windows runtime capture: live 60s segment rotation (gapless) #46

Description

@shaik-zeeshan

@

What to build

Add live segment rotation to the Windows backend so a continuous recording produces gapless 60 s .mp4 segments — matching the macOS ScreenCaptureKit "stream stays live, swap the writer" model.

  • Implement rotate_screen_capture_session on Windows: finalize the current MF sink writer (flushing the held lookahead frame with its duration clamped to the segment boundary), create the next .mp4 sink writer, and keep the WGC frame pool, D3D11 device, and capture thread alive across the swap.
  • Widen plan_live_rotation_segment (and its call in the segment loop) from cfg(macos) to cfg(any(macos, windows)). Ensure the Windows path takes the rotation branch but skips the macOS-only inactivity-pause and wake-recovery branches (which call unsupported fns).
  • Per-segment timestamp rebaseline: each new segment resets t0 to its first frame; one-frame lookahead computes each sample duration.

This is the area most prone to a "video breaks after the first minute" bug (timestamp rebaseline) and to accidentally calling an unsupported macOS fn on Windows (the cfg surgery in the loop).

Acceptance criteria

  • A continuous Windows recording produces sequential 60 s .mp4 segments
  • Playback is clean across segment seams (no black gap, no timestamp glitch at the 60 s boundary)
  • WGC stream / D3D device are not torn down on rotation (no capture re-acquire each minute)
  • plan_live_rotation_segment runs on Windows; inactivity/wake branches are not reached on the Windows path
  • Pure-logic unit tests for per-segment rebaseline and the boundary-clamped lookahead duration
  • Manual smoke test on Win11 across several rotations recorded in the PR

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    afk-readyScoped and ready for an autonomous (AFK) agent to implementenhancementNew feature or requestneeds-smoke-testRequires manual on-device verification before merge (not CI-verifiable)windowsWindows platform support

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions