-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getDisplayMedia captured windows get black frames when window gets re…
…sized https://bugs.webkit.org/show_bug.cgi?id=270568 rdar://124131045 Reviewed by Eric Carlson. When a window size changes, we may need to update the capture size so as to respect aspect ratio and not introduce black frames. For that purpose, we store the content size in ScreenCaptureKitCaptureSource::m_contentSize and we initialize it at start up using SCContentFilter. Then, when capture has started, we get the content size from the sample buffer attachment, using SCStreamFrameInfoScaleFactor, SCStreamFrameInfoContentScale and SCStreamFrameInfoContentRect. If m_contentSize changes, we update the capture size. We ensure that the capture size keeps the aspect ratio even in case where width and height are set via media constraints by either computing width from height or the reverse but keeping aspect ratio computed from m_contentSize. * Source/WebCore/PAL/pal/mac/ScreenCaptureKitSoftLink.h: * Source/WebCore/PAL/pal/mac/ScreenCaptureKitSoftLink.mm: * Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.h: * Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm: (WebCore::ScreenCaptureKitCaptureSource::streamConfiguration): (WebCore::ScreenCaptureKitCaptureSource::startContentStream): (WebCore::ScreenCaptureKitCaptureSource::streamDidOutputVideoSampleBuffer): Canonical link: https://commits.webkit.org/275794@main
- Loading branch information
Showing
4 changed files
with
50 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters