Changeset 238909 in webkit
- Timestamp:
- Dec 5, 2018 2:32:26 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r238908 r238909 1 2018-12-05 Youenn Fablet <youenn@apple.com> 2 3 Enable the possibility to do video capture in UIProcess 4 https://bugs.webkit.org/show_bug.cgi?id=192394 5 6 Reviewed by Eric Carlson. 7 8 Create IOSurface-backed sample buffers so that we can easily send them through IPC. 9 Manually tested. 10 11 * platform/mediastream/mac/AVVideoCaptureSource.mm: 12 (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): 13 1 14 2018-12-05 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
r238145 r238909 343 343 (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(avVideoCapturePixelBufferFormat()), 344 344 (__bridge NSString *)kCVPixelBufferWidthKey: @(avPreset->size.width()), 345 (__bridge NSString *)kCVPixelBufferHeightKey: @(avPreset->size.height()) 345 (__bridge NSString *)kCVPixelBufferHeightKey: @(avPreset->size.height()), 346 (__bridge NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{ } 346 347 }; 347 348 [m_videoOutput setVideoSettings:settingsDictionary]; -
trunk/Source/WebKit/ChangeLog
r238900 r238909 1 2018-12-05 Youenn Fablet <youenn@apple.com> 2 3 Enable the possibility to do video capture in UIProcess 4 https://bugs.webkit.org/show_bug.cgi?id=192394 5 6 Reviewed by Eric Carlson. 7 8 Add two web preferences to toggle audio/video capture in UIProcess or WebProcess. 9 Add mechanism for video capture that was not implemented yet. 10 11 * Shared/WebPreferences.yaml: 12 * Shared/WebPreferencesDefaultValues.h: 13 * Shared/WebProcessCreationParameters.cpp: 14 (WebKit::WebProcessCreationParameters::encode const): 15 (WebKit::WebProcessCreationParameters::decode): 16 * Shared/WebProcessCreationParameters.h: 17 * UIProcess/API/APIProcessPoolConfiguration.h: 18 * UIProcess/API/C/WKPreferences.cpp: 19 (WKPreferencesSetCaptureAudioInUIProcessEnabled): 20 (WKPreferencesGetCaptureAudioInUIProcessEnabled): 21 (WKPreferencesSetCaptureVideoInUIProcessEnabled): 22 (WKPreferencesGetCaptureVideoInUIProcessEnabled): 23 * UIProcess/API/C/WKPreferencesRef.h: 24 * UIProcess/WebPreferences.cpp: 25 (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey): 26 * UIProcess/WebProcessPool.cpp: 27 (WebKit::WebProcessPool::initializeNewWebProcess): 28 (WebKit::WebProcessPool::createWebPage): 29 * WebProcess/cocoa/UserMediaCaptureManager.cpp: 30 (WebKit::UserMediaCaptureManager::initialize): 31 1 32 2018-12-05 Alex Christensen <achristensen@webkit.org> 2 33 -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r238791 r238909 1475 1475 condition: ENABLE(LAYOUT_FORMATTING_CONTEXT) 1476 1476 1477 CaptureAudioInUIProcessEnabled: 1478 type: bool 1479 defaultValue: DEFAULT_CAPTURE_AUDIO_IN_UIPROCESS 1480 humanReadableName: "Capture audio in UIProcess" 1481 humanReadableDescription: "Enable audio capture in UIProcess" 1482 category: internal 1483 webcoreBinding: none 1484 condition: ENABLE(MEDIA_STREAM) 1485 1486 CaptureVideoInUIProcessEnabled: 1487 type: bool 1488 defaultValue: false 1489 humanReadableName: "Capture video in UIProcess" 1490 humanReadableDescription: "Enable video capture in UIProcess" 1491 category: internal 1492 webcoreBinding: none 1493 condition: ENABLE(MEDIA_STREAM) -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
r238288 r238909 224 224 bool defaultCustomPasteboardDataEnabled(); 225 225 226 #if PLATFORM(MAC) 227 #define DEFAULT_CAPTURE_AUDIO_IN_UIPROCESS true 228 #else 229 #define DEFAULT_CAPTURE_AUDIO_IN_UIPROCESS false 230 #endif 231 226 232 #if PLATFORM(WATCHOS) 227 233 #define DEFAULT_INPUT_TYPE_COLOR_ENABLED false -
trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp
r238746 r238909 70 70 encoder << audioCaptureExtensionHandle; 71 71 encoder << shouldCaptureAudioInUIProcess; 72 encoder << shouldCaptureVideoInUIProcess; 72 73 encoder << shouldCaptureDisplayInUIProcess; 73 74 #endif … … 262 263 if (!decoder.decode(parameters.shouldCaptureAudioInUIProcess)) 263 264 return false; 265 if (!decoder.decode(parameters.shouldCaptureVideoInUIProcess)) 266 return false; 264 267 if (!decoder.decode(parameters.shouldCaptureDisplayInUIProcess)) 265 268 return false; -
trunk/Source/WebKit/Shared/WebProcessCreationParameters.h
r238746 r238909 94 94 SandboxExtension::Handle audioCaptureExtensionHandle; 95 95 bool shouldCaptureAudioInUIProcess { false }; 96 bool shouldCaptureVideoInUIProcess { false }; 96 97 bool shouldCaptureDisplayInUIProcess { false }; 97 98 #endif -
trunk/Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
r238900 r238909 139 139 void setShouldCaptureAudioInUIProcess(bool shouldCaptureAudioInUIProcess) { m_shouldCaptureAudioInUIProcess = shouldCaptureAudioInUIProcess; } 140 140 141 bool shouldCaptureVideoInUIProcess() const { return m_shouldCaptureVideoInUIProcess; } 142 void setShouldCaptureVideoInUIProcess(bool shouldCaptureVideoInUIProcess) { m_shouldCaptureVideoInUIProcess = shouldCaptureVideoInUIProcess; } 143 141 144 bool shouldCaptureDisplayInUIProcess() const { return m_shouldCaptureDisplayInUIProcess; } 142 145 void setShouldCaptureDisplayInUIProcess(bool shouldCaptureDisplayInUIProcess) { m_shouldCaptureDisplayInUIProcess = shouldCaptureDisplayInUIProcess; } … … 207 210 bool m_shouldTakeUIBackgroundAssertion { true }; 208 211 bool m_shouldCaptureAudioInUIProcess { false }; 212 bool m_shouldCaptureVideoInUIProcess { false }; 209 213 bool m_shouldCaptureDisplayInUIProcess { DEFAULT_CAPTURE_DISPLAY_IN_UI_PROCESS }; 210 214 ProcessID m_presentingApplicationPID { getCurrentProcessID() }; -
trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp
r238264 r238909 2080 2080 return toImpl(preferencesRef)->webSQLDisabled(); 2081 2081 } 2082 2083 void WKPreferencesSetCaptureAudioInUIProcessEnabled(WKPreferencesRef preferencesRef, bool flag) 2084 { 2085 toImpl(preferencesRef)->setCaptureAudioInUIProcessEnabled(flag); 2086 } 2087 2088 bool WKPreferencesGetCaptureAudioInUIProcessEnabled(WKPreferencesRef preferencesRef) 2089 { 2090 return toImpl(preferencesRef)->captureAudioInUIProcessEnabled(); 2091 } 2092 2093 void WKPreferencesSetCaptureVideoInUIProcessEnabled(WKPreferencesRef preferencesRef, bool flag) 2094 { 2095 toImpl(preferencesRef)->setCaptureVideoInUIProcessEnabled(flag); 2096 } 2097 2098 bool WKPreferencesGetCaptureVideoInUIProcessEnabled(WKPreferencesRef preferencesRef) 2099 { 2100 return toImpl(preferencesRef)->captureVideoInUIProcessEnabled(); 2101 } -
trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRef.h
r237210 r238909 333 333 WK_EXPORT void WKPreferencesSetWebSQLDisabled(WKPreferencesRef preferencesRef, bool enabled); 334 334 335 WK_EXPORT void WKPreferencesSetCaptureAudioInUIProcessEnabled(WKPreferencesRef preferencesRef, bool flag); 336 WK_EXPORT bool WKPreferencesGetCaptureAudioInUIProcessEnabled(WKPreferencesRef preferencesRef); 337 WK_EXPORT void WKPreferencesSetCaptureVideoInUIProcessEnabled(WKPreferencesRef preferencesRef, bool flag); 338 WK_EXPORT bool WKPreferencesGetCaptureVideoInUIProcessEnabled(WKPreferencesRef preferencesRef); 339 335 340 #ifdef __cplusplus 336 341 } -
trunk/Source/WebKit/UIProcess/WebPreferences.cpp
r235921 r238909 140 140 return; 141 141 } 142 if (key == WebPreferencesKey::captureAudioInUIProcessEnabledKey()) { 143 for (auto* page : m_pages) 144 page->process().processPool().configuration().setShouldCaptureAudioInUIProcess(value); 145 146 return; 147 } 148 if (key == WebPreferencesKey::captureVideoInUIProcessEnabledKey()) { 149 for (auto* page : m_pages) 150 page->process().processPool().configuration().setShouldCaptureVideoInUIProcess(value); 151 152 return; 153 } 142 154 143 155 update(); // FIXME: Only send over the changed key and value. -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r238900 r238909 920 920 #if ENABLE(MEDIA_STREAM) 921 921 parameters.shouldCaptureAudioInUIProcess = m_configuration->shouldCaptureAudioInUIProcess(); 922 parameters.shouldCaptureVideoInUIProcess = m_configuration->shouldCaptureVideoInUIProcess(); 922 923 parameters.shouldCaptureDisplayInUIProcess = m_configuration->shouldCaptureDisplayInUIProcess(); 923 924 #endif … … 1147 1148 auto page = process->createWebPage(pageClient, WTFMove(pageConfiguration)); 1148 1149 m_configuration->setProcessSwapsOnNavigationFromExperimentalFeatures(page->preferences().processSwapOnCrossSiteNavigationEnabled()); 1150 m_configuration->setShouldCaptureAudioInUIProcess(page->preferences().captureAudioInUIProcessEnabled()); 1151 m_configuration->setShouldCaptureVideoInUIProcess(page->preferences().captureVideoInUIProcessEnabled()); 1149 1152 1150 1153 return page; -
trunk/Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.cpp
r237281 r238909 220 220 if (parameters.shouldCaptureAudioInUIProcess) 221 221 RealtimeMediaSourceCenter::setAudioFactory(*this); 222 if (parameters.shouldCaptureVideoInUIProcess) 223 RealtimeMediaSourceCenter::setVideoFactory(*this); 222 224 if (parameters.shouldCaptureDisplayInUIProcess) 223 225 RealtimeMediaSourceCenter::setDisplayCaptureFactory(*this);
Note: See TracChangeset
for help on using the changeset viewer.