Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 23fe8add2e30694e12662b64c44b3110a70e040b
      
https://github.com/WebKit/WebKit/commit/23fe8add2e30694e12662b64c44b3110a70e040b
  Author: Youenn Fablet <[email protected]>
  Date:   2025-07-03 (Thu, 03 Jul 2025)

  Changed paths:
    M Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h
    M Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm

  Log Message:
  -----------
  AVVideoCaptureSource first frames check is not always correct on restart
rdar://122102805
https://bugs.webkit.org/show_bug.cgi?id=295333

Reviewed by Eric Carlson.

When capture restarts, we would reset m_frameCount to 0 when getting the signal 
that session is now running.
There could be video frames already in flight on the output queue.
Sometimes, the video frames will be processed before we would reset 
m_frameCount to 0, defeating the skipping of the first video frames which may 
be darker.
This could create a potential flickering.

To prevent this, we now reset m_frameCount to 0 when stopping the capture.
We also make it a std::atomic given it is used in two threads.

Manually tested.

* Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h:
* Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::verifyIsCapturing):
(WebCore::AVVideoCaptureSource::updateVerifyCapturingTimer):

Canonical link: https://commits.webkit.org/296960@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to