Changeset 272858 in webkit
- Timestamp:
- Feb 15, 2021 9:35:52 AM (3 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/ThirdParty/libwebrtc/ChangeLog
r272758 r272858 1 2021-02-15 Youenn Fablet <youenn@apple.com> 2 3 Move WebRTCPlatformCodecsInGPUProcessEnabled to Page Settings 4 https://bugs.webkit.org/show_bug.cgi?id=221893 5 6 Reviewed by Eric Carlson. 7 8 Always use the remote factory to simplify things. This ensures that factories remain in sync whether callbacks are set or not. 9 We check anyway whether callbacks are set and use them if needed. 10 Otherwise, we default to the in-process code path. 11 12 * Source/webrtc/sdk/WebKit/WebKitDecoder.mm: 13 (webrtc::createWebKitDecoderFactory): 14 * Source/webrtc/sdk/WebKit/WebKitEncoder.mm: 15 (webrtc::createWebKitEncoderFactory): 16 1 17 2021-02-11 Jer Noble <jer.noble@apple.com> 2 18 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitDecoder.mm
r270256 r272858 227 227 { 228 228 auto internalFactory = ObjCToNativeVideoDecoderFactory([[RTCDefaultVideoDecoderFactory alloc] initWithH265: supportsH265 == WebKitH265::On vp9Profile0:supportsVP9 > WebKitVP9::Off vp9Profile2:supportsVP9 == WebKitVP9::Profile0And2 vp9VTB: supportsVP9VTB == WebKitVP9VTB::On]); 229 if (videoDecoderCallbacks().createCallback) 230 return std::make_unique<RemoteVideoDecoderFactory>(std::move(internalFactory)); 231 return internalFactory; 229 return std::make_unique<RemoteVideoDecoderFactory>(std::move(internalFactory)); 232 230 } 233 231 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitEncoder.mm
r270256 r272858 223 223 auto internalFactory = ObjCToNativeVideoEncoderFactory([[RTCDefaultVideoEncoderFactory alloc] initWithH265: supportsH265 == WebKitH265::On vp9Profile0:supportsVP9 > WebKitVP9::Off vp9Profile2:supportsVP9 == WebKitVP9::Profile0And2 lowLatencyH264:useH264LowLatency == WebKitH264LowLatency::On]); 224 224 225 if (videoEncoderCallbacks().createCallback) 226 internalFactory = std::make_unique<RemoteVideoEncoderFactory>(std::move(internalFactory)); 227 228 return std::make_unique<VideoEncoderFactoryWithSimulcast>(std::move(internalFactory)); 225 return std::make_unique<VideoEncoderFactoryWithSimulcast>(std::make_unique<RemoteVideoEncoderFactory>(std::move(internalFactory))); 229 226 } 230 227 -
trunk/Source/WTF/ChangeLog
r272848 r272858 1 2021-02-15 Youenn Fablet <youenn@apple.com> 2 3 Move WebRTCPlatformCodecsInGPUProcessEnabled to Page Settings 4 https://bugs.webkit.org/show_bug.cgi?id=221893 5 6 Reviewed by Eric Carlson. 7 8 * Scripts/Preferences/WebPreferencesExperimental.yaml: 9 1 10 2021-02-15 Lauro Moura <lmoura@igalia.com> 2 11 -
trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
r272848 r272858 1108 1108 humanReadableName: "WebRTC Platform Codecs in GPU Process" 1109 1109 humanReadableDescription: "Enable WebRTC Platform Codecs in GPU Process" 1110 webcoreBinding: RuntimeEnabledFeatures1111 1110 condition: ENABLE(WEB_RTC) 1112 1111 defaultValue: … … 1115 1114 WebKit: 1116 1115 default: WebKit::defaultWebRTCCodecsInGPUProcess() 1116 WebCore: 1117 default: false 1117 1118 1118 1119 WebRTCPlatformSocketsEnabled: -
trunk/Source/WebCore/ChangeLog
r272856 r272858 1 2021-02-15 Youenn Fablet <youenn@apple.com> 2 3 Move WebRTCPlatformCodecsInGPUProcessEnabled to Page Settings 4 https://bugs.webkit.org/show_bug.cgi?id=221893 5 6 Reviewed by Eric Carlson. 7 8 Covered by existing tests. 9 10 * page/RuntimeEnabledFeatures.h: 11 (WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled): 12 (WebCore::RuntimeEnabledFeatures::webRTCPlatformCodecsInGPUProcessEnabled const): Deleted. 13 (WebCore::RuntimeEnabledFeatures::setWebRTCPlatformCodecsInGPUProcessEnabled): Deleted. 14 * testing/InternalSettings.cpp: 15 (WebCore::InternalSettings::setWebRTCPlatformCodecsInGPUProcessEnabled): Deleted. 16 * testing/InternalSettings.h: 17 * testing/InternalSettings.idl: 18 1 19 2021-02-15 Zalan Bujtas <zalan@apple.com> 2 20 -
trunk/Source/WebCore/page/RuntimeEnabledFeatures.h
r272769 r272858 164 164 bool webRTCH264SimulcastEnabled() const { return m_isWebRTCH264SimulcastEnabled; } 165 165 void setWebRTCH264SimulcastEnabled(bool isEnabled) { m_isWebRTCH264SimulcastEnabled = isEnabled; } 166 bool webRTCPlatformCodecsInGPUProcessEnabled() const { return m_isWebRTCPlatformCodecsInGPUProcessEnabled; }167 void setWebRTCPlatformCodecsInGPUProcessEnabled(bool isEnabled) { m_isWebRTCPlatformCodecsInGPUProcessEnabled = isEnabled; }168 166 bool webRTCPlatformSocketsEnabled() const { return m_isWebRTCPlatformSocketsEnabled; } 169 167 void setWebRTCPlatformSocketsEnabled(bool isEnabled) { m_isWebRTCPlatformSocketsEnabled = isEnabled; } … … 337 335 bool m_isWebRTCH264SimulcastEnabled { true }; 338 336 bool m_isWebRTCMDNSICECandidatesEnabled { false }; 339 bool m_isWebRTCPlatformCodecsInGPUProcessEnabled { false };340 337 bool m_isWebRTCH265CodecEnabled { false }; 341 338 bool m_isWebRTCVP9Profile0CodecEnabled { false }; -
trunk/Source/WebCore/testing/InternalSettings.cpp
r270823 r272858 460 460 } 461 461 462 ExceptionOr<void> InternalSettings::setWebRTCPlatformCodecsInGPUProcessEnabled(bool enabled)463 {464 if (!m_page)465 return Exception { InvalidAccessError };466 #if ENABLE(WEB_RTC)467 RuntimeEnabledFeatures::sharedFeatures().setWebRTCPlatformCodecsInGPUProcessEnabled(enabled);468 #else469 UNUSED_PARAM(enabled);470 #endif471 return { };472 }473 474 462 bool InternalSettings::vp9DecoderEnabled() const 475 463 { -
trunk/Source/WebCore/testing/InternalSettings.h
r270823 r272858 95 95 ExceptionOr<void> setFetchAPIKeepAliveEnabled(bool); 96 96 ExceptionOr<void> setCustomPasteboardDataEnabled(bool); 97 ExceptionOr<void> setWebRTCPlatformCodecsInGPUProcessEnabled(bool);98 97 99 98 bool vp9DecoderEnabled() const; -
trunk/Source/WebCore/testing/InternalSettings.idl
r270823 r272858 70 70 [MayThrowException] undefined setFetchAPIKeepAliveEnabled(boolean enabled); 71 71 [MayThrowException] undefined setCustomPasteboardDataEnabled(boolean enabled); 72 [MayThrowException] undefined setWebRTCPlatformCodecsInGPUProcessEnabled(boolean enabled);73 72 74 73 readonly attribute boolean vp9DecoderEnabled; -
trunk/Source/WebKit/ChangeLog
r272855 r272858 1 2021-02-15 Youenn Fablet <youenn@apple.com> 2 3 Move WebRTCPlatformCodecsInGPUProcessEnabled to Page Settings 4 https://bugs.webkit.org/show_bug.cgi?id=221893 5 6 Reviewed by Eric Carlson. 7 8 Make LibWebRTCProvider and MediaRecorder provider keep a WebPage reference. 9 Use it to get WebRTCPlatformCodecsInGPUProcessEnabled setting when needed. 10 For LibWebRTCProvider, set callback only once before creating the first peer connection. 11 This makes sure we do not change callbacks while using them in another thread. 12 13 * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp: 14 (WebKit::MediaRecorderProvider::createMediaRecorderPrivate): 15 * WebProcess/GPU/webrtc/MediaRecorderProvider.h: 16 (WebKit::MediaRecorderProvider::MediaRecorderProvider): 17 * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: 18 (WebKit::LibWebRTCProvider::createPeerConnection): 19 * WebProcess/Network/webrtc/LibWebRTCProvider.h: 20 (WebKit::LibWebRTCProvider::LibWebRTCProvider): 21 * WebProcess/WebPage/WebPage.cpp: 22 (WebKit::m_limitsNavigationsToAppBoundDomains): 23 1 24 2021-02-15 Youenn Fablet <youenn@apple.com> 2 25 -
trunk/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderProvider.cpp
r272206 r272858 30 30 31 31 #include "MediaRecorderPrivate.h" 32 #include "WebPage.h" 32 33 #include <WebCore/MediaRecorderPrivate.h> 33 #include <WebCore/RuntimeEnabledFeatures.h> 34 #include <WebCore/Page.h> 35 #include <WebCore/Settings.h> 34 36 35 37 namespace WebKit { … … 39 41 { 40 42 #if ENABLE(GPU_PROCESS) && HAVE(AVASSETWRITERDELEGATE) 41 if (RuntimeEnabledFeatures::sharedFeatures().webRTCPlatformCodecsInGPUProcessEnabled()) 43 auto* page = m_webPage.corePage(); 44 if (page && page->settings().webRTCPlatformCodecsInGPUProcessEnabled()) 42 45 return makeUnique<MediaRecorderPrivate>(stream, options); 43 46 #endif -
trunk/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderProvider.h
r266116 r272858 30 30 namespace WebKit { 31 31 32 class WebPage; 33 32 34 class MediaRecorderProvider final : public WebCore::MediaRecorderProvider { 33 35 public: 34 MediaRecorderProvider() = default;36 explicit MediaRecorderProvider(WebPage&); 35 37 36 38 private: … … 38 40 std::unique_ptr<WebCore::MediaRecorderPrivate> createMediaRecorderPrivate(WebCore::MediaStreamPrivate&, const WebCore::MediaRecorderPrivateOptions&) final; 39 41 #endif 42 43 #if ENABLE(GPU_PROCESS) && HAVE(AVASSETWRITERDELEGATE) 44 WebPage& m_webPage; 45 #endif 40 46 }; 41 47 48 inline MediaRecorderProvider::MediaRecorderProvider(WebPage& webPage) 49 #if ENABLE(GPU_PROCESS) && HAVE(AVASSETWRITERDELEGATE) 50 : m_webPage(webPage) 51 #endif 52 { 42 53 } 54 55 } -
trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.cpp
r272202 r272858 34 34 35 35 #include "LibWebRTCNetwork.h" 36 #include "WebPage.h" 36 37 #include "WebProcess.h" 37 #include <WebCore/RuntimeEnabledFeatures.h> 38 #include <WebCore/Page.h> 39 #include <WebCore/Settings.h> 38 40 #include <webrtc/api/async_resolver_factory.h> 39 41 #include <webrtc/pc/peer_connection_factory.h> … … 54 56 { 55 57 #if ENABLE(GPU_PROCESS) && PLATFORM(COCOA) && !PLATFORM(MACCATALYST) 56 LibWebRTCCodecs::setCallbacks(RuntimeEnabledFeatures::sharedFeatures().webRTCPlatformCodecsInGPUProcessEnabled()); 58 if (!m_didInitializeCallback) { 59 // We initialize only once since callbacks are used in background threads. 60 auto* page = m_webPage.corePage(); 61 LibWebRTCCodecs::setCallbacks(page && page->settings().webRTCPlatformCodecsInGPUProcessEnabled()); 62 m_didInitializeCallback = true; 63 } 57 64 #endif 65 58 66 return WebCore::LibWebRTCProvider::createPeerConnection(observer, WebProcess::singleton().libWebRTCNetwork().monitor(), *socketFactory, WTFMove(configuration), makeUnique<AsyncResolverFactory>()); 59 67 } -
trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.h
r272202 r272858 36 36 namespace WebKit { 37 37 38 class WebPage; 39 38 40 #if USE(LIBWEBRTC) 39 41 … … 48 50 class LibWebRTCProvider final : public LibWebRTCProviderBase { 49 51 public: 50 LibWebRTCProvider() { m_useNetworkThreadWithSocketServer = false; }52 explicit LibWebRTCProvider(WebPage&); 51 53 52 54 private: … … 59 61 void disableNonLocalhostConnections() final; 60 62 void startedNetworkThread() final; 63 64 #if ENABLE(GPU_PROCESS) && PLATFORM(COCOA) && !PLATFORM(MACCATALYST) 65 WebPage& m_webPage; 66 bool m_didInitializeCallback { false }; 67 #endif 61 68 }; 69 70 inline LibWebRTCProvider::LibWebRTCProvider(WebPage& webPage) 71 #if ENABLE(GPU_PROCESS) && PLATFORM(COCOA) && !PLATFORM(MACCATALYST) 72 : m_webPage(webPage) 73 #endif 74 { 75 m_useNetworkThreadWithSocketServer = false; 76 } 77 78 inline UniqueRef<LibWebRTCProvider> createLibWebRTCProvider(WebPage& page) 79 { 80 return makeUniqueRef<LibWebRTCProvider>(page); 81 } 62 82 #else 63 83 using LibWebRTCProvider = WebCore::LibWebRTCProvider; 84 85 inline UniqueRef<LibWebRTCProvider> createLibWebRTCProvider(WebPage&) 86 { 87 return makeUniqueRef<LibWebRTCProvider>(); 88 } 64 89 #endif // USE(LIBWEBRTC) 65 90 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r272808 r272858 524 524 makeUniqueRef<WebEditorClient>(this), 525 525 WebSocketProvider::create(), 526 makeUniqueRef<WebKit::LibWebRTCProvider>(),526 createLibWebRTCProvider(*this), 527 527 WebProcess::singleton().cacheStorageProvider(), 528 528 m_userContentController, … … 532 532 makeUniqueRef<WebFrameLoaderClient>(m_mainFrame.copyRef()), 533 533 makeUniqueRef<WebSpeechRecognitionProvider>(m_identifier), 534 makeUniqueRef<MediaRecorderProvider>( )534 makeUniqueRef<MediaRecorderProvider>(*this) 535 535 ); 536 536 pageConfiguration.chromeClient = new WebChromeClient(*this);
Note: See TracChangeset
for help on using the changeset viewer.