File tree Expand file tree Collapse file tree
platform/mediastream/libwebrtc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 2020-09-18 Youenn Fablet <youenn@apple.com>
2+
3+ Add internal flag to enable/disable H264 hardware encoder
4+ https://bugs.webkit.org/show_bug.cgi?id=216534
5+
6+ Reviewed by Eric Carlson.
7+
8+ Update process-wide hardware H264 boolean flag based on internal feature flag.
9+ No change of behavior.
10+
11+ * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
12+ (WebCore::LibWebRTCProvider::setH264HardwareEncoderAllowed):
13+ * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
14+ * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
15+ (WebCore::LibWebRTCProvider::setH264HardwareEncoderAllowed):
16+ (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
17+ (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed): Deleted.
18+ * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
19+ * testing/Internals.cpp:
20+ (WebCore::Internals::resetToConsistentState):
21+ (WebCore::Internals::setH264HardwareEncoderAllowed):
22+
1232020-09-18 Youenn Fablet <youenn@apple.com>
224
325 Hash deviceIds in WebProcess instead of UIProcess to allow audio output device IDs in WebProcess
Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ bool LibWebRTCProvider::webRTCAvailable()
6969void LibWebRTCProvider::registerWebKitVP9Decoder ()
7070{
7171}
72+
73+ void LibWebRTCProvider::setH264HardwareEncoderAllowed (bool )
74+ {
75+ }
7276#endif
7377
7478void LibWebRTCProvider::setActive (bool )
Original file line number Diff line number Diff line change @@ -73,11 +73,10 @@ class WEBCORE_EXPORT LibWebRTCProvider {
7373
7474 static bool webRTCAvailable ();
7575 static void registerWebKitVP9Decoder ();
76+ static void setH264HardwareEncoderAllowed (bool );
7677
7778 virtual void setActive (bool );
7879
79- virtual void setH264HardwareEncoderAllowed (bool ) { }
80-
8180 using IPAddressOrError = Expected<String, MDNSRegisterError>;
8281 using MDNSNameOrError = Expected<String, MDNSRegisterError>;
8382
Original file line number Diff line number Diff line change @@ -46,13 +46,13 @@ UniqueRef<LibWebRTCProvider> LibWebRTCProvider::create()
4646 return makeUniqueRef<LibWebRTCProviderCocoa>();
4747}
4848
49- LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa ( )
49+ void LibWebRTCProvider::setH264HardwareEncoderAllowed ( bool allowed )
5050{
51+ webrtc::setH264HardwareEncoderAllowed (allowed);
5152}
5253
53- void LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed ( bool allowed )
54+ LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa ( )
5455{
55- webrtc::setH264HardwareEncoderAllowed (allowed);
5656}
5757
5858std::unique_ptr<webrtc::VideoDecoderFactory> LibWebRTCProviderCocoa::createDecoderFactory ()
Original file line number Diff line number Diff line change @@ -46,8 +46,6 @@ class WEBCORE_EXPORT LibWebRTCProviderCocoa : public LibWebRTCProvider {
4646private:
4747 void setActive (bool ) final ;
4848 std::unique_ptr<webrtc::VideoEncoderFactory> createEncoderFactory () final ;
49-
50- void setH264HardwareEncoderAllowed (bool allowed) final ;
5149};
5250
5351} // namespace WebCore
Original file line number Diff line number Diff line change @@ -563,7 +563,7 @@ void Internals::resetToConsistentState(Page& page)
563563 auto & rtcProvider = page.libWebRTCProvider ();
564564 WebCore::useRealRTCPeerConnectionFactory (rtcProvider);
565565 rtcProvider.disableNonLocalhostConnections ();
566- rtcProvider. setH264HardwareEncoderAllowed (true );
566+ LibWebRTCProvider:: setH264HardwareEncoderAllowed (true );
567567 RuntimeEnabledFeatures::sharedFeatures ().setWebRTCH265CodecEnabled (true );
568568 page.settings ().setWebRTCEncryptionEnabled (true );
569569#endif
@@ -5179,10 +5179,7 @@ bool Internals::isPageActive() const
51795179#if ENABLE(WEB_RTC)
51805180void Internals::setH264HardwareEncoderAllowed (bool allowed)
51815181{
5182- auto * document = contextDocument ();
5183- if (!document || !document->page ())
5184- return ;
5185- document->page ()->libWebRTCProvider ().setH264HardwareEncoderAllowed (allowed);
5182+ LibWebRTCProvider::setH264HardwareEncoderAllowed (allowed);
51865183}
51875184#endif
51885185
Original file line number Diff line number Diff line change 1+ 2020-09-18 Youenn Fablet <youenn@apple.com>
2+
3+ Add internal flag to enable/disable H264 hardware encoder
4+ https://bugs.webkit.org/show_bug.cgi?id=216534
5+
6+ Reviewed by Eric Carlson.
7+
8+ * Shared/WebPreferencesInternal.yaml:
9+ * WebProcess/WebPage/WebPage.cpp:
10+ (WebKit::WebPage::updatePreferences):
11+
1122020-09-18 Youenn Fablet <youenn@apple.com>
213
314 Hash deviceIds in WebProcess instead of UIProcess to allow audio output device IDs in WebProcess
Original file line number Diff line number Diff line change @@ -55,6 +55,15 @@ WebRTCH264SimulcastEnabled:
5555 humanReadableName : " WebRTC H264 Simulcast"
5656 humanReadableDescription : " Enable WebRTC H264 Simulcast"
5757
58+ WebRTCH264HardwareEncoderEnabled :
59+ type : bool
60+ defaultValue : true
61+ webcoreBinding : none
62+ condition : ENABLE(WEB_RTC)
63+ humanReadableName : " WebRTC H264 Hardware encoder"
64+ humanReadableDescription : " Enable H264 Hardware encoder"
65+ category : internal
66+
5867WebRTCMDNSICECandidatesEnabled :
5968 type : bool
6069 defaultValue : true
Original file line number Diff line number Diff line change @@ -3780,6 +3780,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
37803780#if USE(LIBWEBRTC)
37813781 m_page->libWebRTCProvider ().setH265Support (RuntimeEnabledFeatures::sharedFeatures ().webRTCH265CodecEnabled ());
37823782 m_page->libWebRTCProvider ().setVP9Support (RuntimeEnabledFeatures::sharedFeatures ().webRTCVP9CodecEnabled ());
3783+ LibWebRTCProvider::setH264HardwareEncoderAllowed (store.getBoolValueForKey (WebPreferencesKey::webRTCH264HardwareEncoderEnabledKey ()));
37833784#endif
37843785
37853786#if ENABLE(GPU_PROCESS)
You can’t perform that action at this time.
0 commit comments