WebKit Bugzilla
Attachment 356532 Details for
Bug 192379
: [MediaStream] Cleanup up Mac screen capture class
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192379-20181204142049.patch (text/plain), 6.75 KB, created by
Eric Carlson
on 2018-12-04 14:20:50 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2018-12-04 14:20:50 PST
Size:
6.75 KB
patch
obsolete
>Subversion Revision: 238804 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 4c0cb384b222d505d0d091f1d4124fc559f18adf..6f45c9e7ff607a9157cc9af63abb4d3a4b84a6b8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2018-12-04 Eric Carlson <eric.carlson@apple.com> >+ >+ [MediaStream] Cleanup up Mac screen capture class >+ https://bugs.webkit.org/show_bug.cgi?id=192379 >+ <rdar://problem/46465458> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests, tested manually. >+ >+ * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp: >+ (WebCore::DisplayCaptureManagerCocoa::captureDevices): Initialize Display devices first. >+ >+ * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: >+ * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: >+ (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Cleanup. Always capture at the >+ native screen size to work around a bug. >+ (WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange): Deleted. >+ > 2018-12-03 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > Use WallTime for file time >diff --git a/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp b/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp >index 88db47c5e45143d898edaa2f5dfaa796c6d4354a..06da625e29c55eb0da1d3593d675fcaa3cef559a 100644 >--- a/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp >+++ b/Source/WebCore/platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp >@@ -52,8 +52,8 @@ const Vector<CaptureDevice>& DisplayCaptureManagerCocoa::captureDevices() > { > m_devices.clear(); > >- updateWindowCaptureDevices(); > updateDisplayCaptureDevices(); >+ updateWindowCaptureDevices(); > > return m_devices; > } >diff --git a/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h b/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h >index 9c8f871c3d1f9c69c257a6bd99ea9f442720d9ed..05ebeae9da3849b3f3aa4bf75eaf9d45b21d6a6a 100644 >--- a/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h >+++ b/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h >@@ -61,7 +61,6 @@ private: > > void startProducingData() final; > void stopProducingData() final; >- void settingsDidChange(OptionSet<RealtimeMediaSourceSettings::Flag>) final; > void commitConfiguration() final; > > bool createDisplayStream(); >@@ -95,8 +94,6 @@ private: > mutable Lock m_currentFrameMutex; > DisplaySurface m_currentFrame; > RetainPtr<CGDisplayStreamRef> m_displayStream; >- CGDisplayStreamFrameAvailableHandler m_frameAvailableBlock; >- > OSObjectPtr<dispatch_queue_t> m_captureQueue; > > uint32_t m_displayID { 0 }; >diff --git a/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm b/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm >index 4cb4d13ca502f43d212bd84a1d7e70b8aee2a2b7..83b2022248e88e4866184cb6640f3df308492f62 100644 >--- a/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm >+++ b/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm >@@ -124,6 +124,7 @@ bool ScreenDisplayCaptureSourceMac::createDisplayStream() > if (m_displayID != actualDisplayID.value()) { > m_displayID = actualDisplayID.value(); > RELEASE_LOG(Media, "ScreenDisplayCaptureSourceMac::createDisplayStream: display ID changed to %d", static_cast<int>(m_displayID)); >+ m_displayStream = nullptr; > } > > if (!m_displayStream) { >@@ -140,34 +141,22 @@ bool ScreenDisplayCaptureSourceMac::createDisplayStream() > if (!m_captureQueue) > m_captureQueue = adoptOSObject(dispatch_queue_create("ScreenDisplayCaptureSourceMac Capture Queue", DISPATCH_QUEUE_SERIAL)); > >- double frameTime = 1 / frameRate(); >- auto frameTimeCF = adoptCF(CFNumberCreate(nullptr, kCFNumberDoubleType, &frameTime)); >- int depth = screenQueueMaximumLength; >- auto depthCF = adoptCF(CFNumberCreate(nullptr, kCFNumberIntType, &depth)); >- CFTypeRef keys[] = { >- kCGDisplayStreamMinimumFrameTime, >- kCGDisplayStreamQueueDepth, >- kCGDisplayStreamColorSpace, >- kCGDisplayStreamShowCursor, >- }; >- CFTypeRef values[] = { >- frameTimeCF.get(), >- depthCF.get(), >- sRGBColorSpaceRef(), >- kCFBooleanTrue, >+ CFDictionaryRef streamOptions = (__bridge CFDictionaryRef) @{ >+ (__bridge NSString *)kCGDisplayStreamMinimumFrameTime :@(1 / frameRate()), >+ (__bridge NSString *)kCGDisplayStreamQueueDepth:@(screenQueueMaximumLength), >+ (__bridge NSString *)kCGDisplayStreamColorSpace:(__bridge id)sRGBColorSpaceRef(), >+ (__bridge NSString *)kCGDisplayStreamShowCursor : @(YES), > }; >- auto streamOptions = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); > > auto weakThis = makeWeakPtr(*this); >- m_frameAvailableBlock = Block_copy(^(CGDisplayStreamFrameStatus status, uint64_t displayTime, IOSurfaceRef frameSurface, CGDisplayStreamUpdateRef updateRef) { >+ auto frameAvailableBlock = ^(CGDisplayStreamFrameStatus status, uint64_t displayTime, IOSurfaceRef frameSurface, CGDisplayStreamUpdateRef updateRef) { > if (!weakThis) > return; > > weakThis->frameAvailable(status, displayTime, frameSurface, updateRef); >- }); >+ }; > >- auto size = frameSize(); >- m_displayStream = adoptCF(CGDisplayStreamCreateWithDispatchQueue(m_displayID, size.width(), size.height(), preferedPixelBufferFormat(), streamOptions.get(), m_captureQueue.get(), m_frameAvailableBlock)); >+ m_displayStream = adoptCF(CGDisplayStreamCreateWithDispatchQueue(m_displayID, screenWidth, screenHeight, preferedPixelBufferFormat(), streamOptions, m_captureQueue.get(), frameAvailableBlock)); > if (!m_displayStream) { > RELEASE_LOG(Media, "ScreenDisplayCaptureSourceMac::createDisplayStream: CGDisplayStreamCreate failed"); > captureFailed(); >@@ -241,14 +230,6 @@ void ScreenDisplayCaptureSourceMac::startDisplayStream() > m_isRunning = true; > } > >-void ScreenDisplayCaptureSourceMac::settingsDidChange(OptionSet<RealtimeMediaSourceSettings::Flag> settings) >-{ >- if (settings.containsAny({ RealtimeMediaSourceSettings::Flag::Width, RealtimeMediaSourceSettings::Flag::Height, RealtimeMediaSourceSettings::Flag::FrameRate })) >- m_displayStream = nullptr; >- >- return DisplayCaptureSourceCocoa::settingsDidChange(settings); >-} >- > void ScreenDisplayCaptureSourceMac::commitConfiguration() > { > if (m_isRunning && !m_displayStream)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192379
:
356532
|
356632