Skip to content

Conversation

cgutman
Copy link
Collaborator

@cgutman cgutman commented Jan 28, 2023

Description

This fixes some issues with capture initialization/reinitialization that could cause us to discard good frames. When we reinitialize encoding, the encoder thread will free any pending frames and encode an initial dummy frame. This could result in the first captured frame from the newly reinitialized display being dropped or immediately superseded by a dummy frame.

@psyke83 Please give this a try to ensure it doesn't regress #823. It should also fix the black screen issue when starting a stream or triggering a UAC prompt when no new frames are being generated.

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

Copy link
Contributor

@psyke83 psyke83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested over 100 fullscreen transitions using the same testcase in #823 with this PR and couldn't reproduce the problem. Additionally, I couldn't trigger the Capture size changed message, but I'm guessing that the changes here might impact that. Seems fine to me.

@psyke83
Copy link
Contributor

psyke83 commented Jan 29, 2023

I also tested the issue related to the dummy frame on first connect:

  1. Open an image in Windows 10 Photos app & enter fullscreen.
  2. Repeatedly disconnect and reconnect without moving the mouse or keyboard.

Prior to this PR, sometimes the stream would stay black indefinitely until some input triggers a screen refresh. With the PR, the new behaviour is that a black screen may occur on connect that lasts for 1 second followed by the proper desktop image. I assume this delay is likely due to AcquireNextFrame being set with a 1 second timeout and thus may not be an indication of anything wrong with this PR.

@cgutman cgutman merged commit 592f3a7 into LizardByte:nightly Jan 29, 2023
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