Commit Graph

675 Commits

Author SHA1 Message Date
Russell Epstein e4390067fa Versioning.
WebKit-7613.1.1

Canonical link: https://commits.webkit.org/240838@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-23 18:38:34 +00:00
Youenn Fablet 5e82c74643 Add support for RTCDtlsTransport
https://bugs.webkit.org/show_bug.cgi?id=229133

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCDtlsTransport-getRemoteCertificates-expected.txt:
* web-platform-tests/webrtc/RTCDtlsTransport-state-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-connectionSetup-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-helper-test-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-iceConnectionState.https-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-onnegotiationneeded-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer-expected.txt:
* web-platform-tests/webrtc/RTCRtpSender-transport.https-expected.txt:
* web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt:
* web-platform-tests/webrtc/protocol/bundle.https-expected.txt:
* web-platform-tests/webrtc/protocol/crypto-suite.https-expected.txt:

Source/ThirdParty/libwebrtc:

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

RTCDtlsTransport is an object representing the transport used by RTCRtp senders and receivers.
Add WebIDL and backend implementation.
In particular, we set sender/receiver transports as per spec when setting the descriptions.
Add support for state and certificates access. Add support for statechange event.

Covered by rebased tests.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCDtlsTransport.cpp: Added.
(WebCore::RTCDtlsTransport::RTCDtlsTransport):
(WebCore::RTCDtlsTransport::~RTCDtlsTransport):
(WebCore::RTCDtlsTransport::getRemoteCertificates):
(WebCore::RTCDtlsTransport::stop):
(WebCore::RTCDtlsTransport::virtualHasPendingActivity const):
(WebCore::RTCDtlsTransport::onStateChanged):
(WebCore::RTCDtlsTransport::onError):
* Modules/mediastream/RTCDtlsTransport.h: Added.
* Modules/mediastream/RTCDtlsTransport.idl: Added.
* Modules/mediastream/RTCDtlsTransportBackend.h: Added.
(WebCore::operator==):
* Modules/mediastream/RTCDtlsTransportState.h: Added.
* Modules/mediastream/RTCDtlsTransportState.idl: Added.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getOrCreateDtlsTransport):
(WebCore::RTCPeerConnection::updateTransceiverTransports):
(WebCore::RTCPeerConnection::updateTransceiversAfterSuccessfulLocalDescription):
(WebCore::RTCPeerConnection::updateTransceiversAfterSuccessfulRemoteDescription):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpReceiver.cpp:
* Modules/mediastream/RTCRtpReceiver.h:
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpReceiverBackend.h:
* Modules/mediastream/RTCRtpSender.cpp:
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCDtlsTransportBackend.cpp: Added.
(WebCore::toRTCDtlsTransportState):
(WebCore::LibWebRTCDtlsTransportBackendObserver::LibWebRTCDtlsTransportBackendObserver):
(WebCore::LibWebRTCDtlsTransportBackendObserver::updateState):
(WebCore::LibWebRTCDtlsTransportBackendObserver::start):
(WebCore::LibWebRTCDtlsTransportBackendObserver::stop):
(WebCore::LibWebRTCDtlsTransportBackendObserver::OnStateChange):
(WebCore::LibWebRTCDtlsTransportBackendObserver::OnError):
(WebCore::LibWebRTCDtlsTransportBackend::LibWebRTCDtlsTransportBackend):
(WebCore::LibWebRTCDtlsTransportBackend::~LibWebRTCDtlsTransportBackend):
(WebCore::LibWebRTCDtlsTransportBackend::registerClient):
(WebCore::LibWebRTCDtlsTransportBackend::unregisterClient):
* Modules/mediastream/libwebrtc/LibWebRTCDtlsTransportBackend.h: Added.
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
(WebCore::LibWebRTCRtpReceiverBackend::rtpDtlsTransportBackend):
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::rtpDtlsTransportBackend):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventTargetFactory.in:


Canonical link: https://commits.webkit.org/240662@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-19 07:36:49 +00:00
Youenn Fablet dd042b29d0 Use profile auto level for WebRTC H264 encoder on Apple Silicon
https://bugs.webkit.org/show_bug.cgi?id=229071
<rdar://80345048>

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

AS H264 encoder will fail if its profile is too low compared to the size of the video.
Use autolevel to prevent this.
* Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:

LayoutTests:

* platform/mac/TestExpectations:


Canonical link: https://commits.webkit.org/240511@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-13 19:30:44 +00:00
Russell Epstein 788086b3b8 Versioning.
WebKit-7612.2.1

Canonical link: https://commits.webkit.org/240370@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-09 20:07:12 +00:00
Kocsen Chung 9a66910b77 Versioning.
WebKit-7612.2.1

Canonical link: https://commits.webkit.org/240364@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-09 16:39:27 +00:00
Russell Epstein e09283eaa2 Versioning.
WebKit-7612.1.27

Canonical link: https://commits.webkit.org/240068@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-29 17:12:03 +00:00
Ruben Turcios 533b089dc9 Versioning.
WebKit-7612.1.25

Canonical link: https://commits.webkit.org/239691@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-15 16:09:01 +00:00
Ruben Turcios ec22083ba8 Versioning.
WebKit-7612.1.24

Canonical link: https://commits.webkit.org/239433@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-06 20:19:59 +00:00
Youenn Fablet 7658b36779 Disable ABSL_HAVE_THREAD_LOCAL in libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=227577
<rdar://79915864>

Reviewed by Eric Carlson.

We do no want to resort on thread local yet so disable ABSL_HAVE_THREAD_LOCAL until we can use it properly.

* Source/third_party/abseil-cpp/absl/base/config.h:


Canonical link: https://commits.webkit.org/239325@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 17:37:38 +00:00
Youenn Fablet f14eb5cfe1 [Cocoa] Migrate WebRTC UDP socket handling to NW API
https://bugs.webkit.org/show_bug.cgi?id=227210
LayoutTests/imported/w3c:

Reviewed by Eric Carlson.

Rebasing tests as timing changes a bit.
This aligns with Chrome and Firefox behavior.

* web-platform-tests/webrtc/no-media-call-expected.txt:
* web-platform-tests/webrtc/promises-call-expected.txt:

Source/ThirdParty/libwebrtc:

Reviewed by Eric Carlson.

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

Reviewed by Eric Carlson.

Add infrastructure to new experimental feature flag for NW backed UDP sockets.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCPlatformTCPSocketsEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCPlatformTCPSocketsEnabled):
(WebCore::RuntimeEnabledFeatures::webRTCPlatformUDPSocketsEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCPlatformUDPSocketsEnabled):

Source/WebKit:

Reviewed by Eric Carlson.

Migrate UDP socket handling from WebRTC physical socket server to nw API for Cocoa ports.

For each UDP socket opened, we open a nw_listener that will listen to inbound connections.
On inbound connection, we receive a nw_connection that we store in a address -> connection map.

Whenever sending a packet, we look at the remote address.
If needed, we create a nw_connection to that particular remote address and store it in the address -> connection map.
We then use the pre-existing or newly created nw_connection to send the packet.

Make sure to cancel NW connection in case of failure before releasing the socket.

Covered by existing tests

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
(WebKit::NetworkRTCProvider::setPlatformTCPSocketsEnabled):
(WebKit::NetworkRTCProvider::setPlatformUDPSocketsEnabled):
* NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
* NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.h.
* NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm: Renamed from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.mm.
(WebKit::tcpSocketQueue):
(WebKit::NetworkRTCTCPSocketCocoa::createClientTCPSocket):
(WebKit::NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa):
(WebKit::NetworkRTCTCPSocketCocoa::close):
(WebKit::NetworkRTCTCPSocketCocoa::setOption):
(WebKit::NetworkRTCTCPSocketCocoa::createMessageBuffer):
(WebKit::NetworkRTCTCPSocketCocoa::sendTo):
* NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.h: Added.
(WTF::DefaultHash<rtc::SocketAddress>::hash):
(WTF::DefaultHash<rtc::SocketAddress>::equal):
(WTF::HashTraits<rtc::SocketAddress>::emptyValue):
(WTF::HashTraits<rtc::SocketAddress>::constructDeletedValue):
(WTF::HashTraits<rtc::SocketAddress>::isDeletedValue):
* NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: Added.
(WebKit::NetworkRTCUDPSocketCocoaConnections::create):
(WebKit::NetworkRTCUDPSocketCocoaConnections::WTF_GUARDED_BY_LOCK):
(WebKit::udpSocketQueue):
(WebKit::NetworkRTCUDPSocketCocoa::createUDPSocket):
(WebKit::NetworkRTCUDPSocketCocoa::NetworkRTCUDPSocketCocoa):
(WebKit::NetworkRTCUDPSocketCocoa::~NetworkRTCUDPSocketCocoa):
(WebKit::NetworkRTCUDPSocketCocoa::close):
(WebKit::NetworkRTCUDPSocketCocoa::setOption):
(WebKit::NetworkRTCUDPSocketCocoa::sendTo):
(WebKit::NetworkRTCUDPSocketCocoaConnections::NetworkRTCUDPSocketCocoaConnections):
(WebKit::NetworkRTCUDPSocketCocoaConnections::close):
(WebKit::NetworkRTCUDPSocketCocoaConnections::setOption):
(WebKit::processUDPData):
(WebKit::NetworkRTCUDPSocketCocoaConnections::createNWConnection):
(WebKit::NetworkRTCUDPSocketCocoaConnections::setupNWConnection):
(WebKit::NetworkRTCUDPSocketCocoaConnections::sendTo):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::setConnection):

Source/WTF:

Reviewed by Eric Carlson.

Add a new experimental flag for NW backed UDP sockets.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

<rdar://problem/79859045>

Reviewed by Eric Carlson.

* platform/ios-simulator-wk2/TestExpectations:
Mark test as failed, as this test is using unsupported API (transport).


Canonical link: https://commits.webkit.org/239317@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 10:37:39 +00:00
Truitt Savell 6a8d0a29e8 Unreviewed, reverting r279405.
Casued 50+ webrtc crashes on Big Sur Debug

Reverted changeset:

"[Cocoa] Migrate WebRTC UDP socket handling to NW API"
https://bugs.webkit.org/show_bug.cgi?id=227210
https://commits.webkit.org/r279405

Canonical link: https://commits.webkit.org/239291@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-30 21:16:16 +00:00
Youenn Fablet 737bcaa98a [Cocoa] Migrate WebRTC UDP socket handling to NW API
https://bugs.webkit.org/show_bug.cgi?id=227210
LayoutTests/imported/w3c:

Reviewed by Eric Carlson.

Rebasing tests as timing changes a bit.
This aligns with Chrome and Firefox behavior.

* web-platform-tests/webrtc/no-media-call-expected.txt:
* web-platform-tests/webrtc/promises-call-expected.txt:

Source/ThirdParty/libwebrtc:

Reviewed by Eric Carlson.

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

Reviewed by Eric Carlson.

Add infrastructure to new experimental feature flag for NW backed UDP sockets.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCPlatformTCPSocketsEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCPlatformTCPSocketsEnabled):
(WebCore::RuntimeEnabledFeatures::webRTCPlatformUDPSocketsEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCPlatformUDPSocketsEnabled):

Source/WebKit:

Reviewed by Eric Carlson.

Migrate UDP socket handling from WebRTC physical socket server to nw API for Cocoa ports.

For each UDP socket opened, we open a nw_listener that will listen to inbound connections.
On inbound connection, we receive a nw_connection that we store in a address -> connection map.

Whenever sending a packet, we look at the remote address.
If needed, we create a nw_connection to that particular remote address and store it in the address -> connection map.
We then use the pre-existing or newly created nw_connection to send the packet.

Make sure to cancel NW connection in case of failure before releasing the socket.

Covered by existing tests

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createUDPSocket):
(WebKit::NetworkRTCProvider::createClientTCPSocket):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
(WebKit::NetworkRTCProvider::setPlatformTCPSocketsEnabled):
(WebKit::NetworkRTCProvider::setPlatformUDPSocketsEnabled):
* NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
* NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.h.
* NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm: Renamed from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.mm.
(WebKit::tcpSocketQueue):
(WebKit::NetworkRTCTCPSocketCocoa::createClientTCPSocket):
(WebKit::NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa):
(WebKit::NetworkRTCTCPSocketCocoa::close):
(WebKit::NetworkRTCTCPSocketCocoa::setOption):
(WebKit::NetworkRTCTCPSocketCocoa::createMessageBuffer):
(WebKit::NetworkRTCTCPSocketCocoa::sendTo):
* NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.h: Added.
(WTF::DefaultHash<rtc::SocketAddress>::hash):
(WTF::DefaultHash<rtc::SocketAddress>::equal):
(WTF::HashTraits<rtc::SocketAddress>::emptyValue):
(WTF::HashTraits<rtc::SocketAddress>::constructDeletedValue):
(WTF::HashTraits<rtc::SocketAddress>::isDeletedValue):
* NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: Added.
(WebKit::NetworkRTCUDPSocketCocoaConnections::create):
(WebKit::NetworkRTCUDPSocketCocoaConnections::WTF_GUARDED_BY_LOCK):
(WebKit::udpSocketQueue):
(WebKit::NetworkRTCUDPSocketCocoa::createUDPSocket):
(WebKit::NetworkRTCUDPSocketCocoa::NetworkRTCUDPSocketCocoa):
(WebKit::NetworkRTCUDPSocketCocoa::~NetworkRTCUDPSocketCocoa):
(WebKit::NetworkRTCUDPSocketCocoa::close):
(WebKit::NetworkRTCUDPSocketCocoa::setOption):
(WebKit::NetworkRTCUDPSocketCocoa::sendTo):
(WebKit::NetworkRTCUDPSocketCocoaConnections::NetworkRTCUDPSocketCocoaConnections):
(WebKit::NetworkRTCUDPSocketCocoaConnections::close):
(WebKit::NetworkRTCUDPSocketCocoaConnections::setOption):
(WebKit::processUDPData):
(WebKit::NetworkRTCUDPSocketCocoaConnections::createNWConnection):
(WebKit::NetworkRTCUDPSocketCocoaConnections::setupNWConnection):
(WebKit::NetworkRTCUDPSocketCocoaConnections::sendTo):
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::setConnection):

Source/WTF:

Reviewed by Eric Carlson.

Add a new experimental flag for NW backed UDP sockets.

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

<rdar://problem/79859045>

Reviewed by Eric Carlson.

* platform/ios-simulator-wk2/TestExpectations:
Mark test as failed, as this test is using unsupported API (transport).


Canonical link: https://commits.webkit.org/239270@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-30 08:46:38 +00:00
Ruben Turcios 8e12736b4b Versioning.
WebKit-7612.1.21

Canonical link: https://commits.webkit.org/239143@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-25 01:27:32 +00:00
Ruben Turcios a1d8878c5f Versioning.
WebKit-7612.1.22

Canonical link: https://commits.webkit.org/239142@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-25 01:26:16 +00:00
Eric Carlson 1708556251 WebKitDecoder.h should include TargetConditionals.h
https://bugs.webkit.org/show_bug.cgi?id=227314
<rdar://problem/79689776>

Reviewed by Geoff Garen.

* Source/webrtc/sdk/WebKit/WebKitDecoder.h: Include TargetConditionals.h so the
TARGET_ defines are initialized correctly.


Canonical link: https://commits.webkit.org/239082@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 21:30:48 +00:00
Eric Carlson ee32b45ec8 [Mac] libwebrtc CMBaseClass objects need alignment fixup
https://bugs.webkit.org/show_bug.cgi?id=227137
<rdar://problem/79464124>

Reviewed by Youenn Fablet.

* Source/webrtc/sdk/WebKit/WebKitDecoder.h: Define CMBASE_OBJECT_NEEDS_ALIGNMENT.

* Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp:
(webrtc::createWebKitVP8Decoder): Add padding to the CMBaseClass object on Mac and
Mac Catalyst when building for x86_64 so function pointers are naturally aligned.
Add static_asserts to ensure alignment and sizes are correct.

* Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp:
(webrtc::createWebKitVP9Decoder): Ditto.


Canonical link: https://commits.webkit.org/239018@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-22 02:15:51 +00:00
Russell Epstein 6fbe355662 Versioning.
WebKit-7612.1.21

Canonical link: https://commits.webkit.org/239007@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-21 23:57:37 +00:00
Philippe Normand 5bc055c06c [GLIB] REGRESSION(r278701): numerous WebRTC tests failing after libwebrtc update to M92
https://bugs.webkit.org/show_bug.cgi?id=227172

Patch by Philippe Normand <pnormand@igalia.com> on 2021-06-21
Reviewed by Adrian Perez de Castro.

Non-apple ports do not use the bundled libvpx library, they rely on the host libvpx instead.
LibWebRTC expects to depend on the bundled version, thus using its API. So we need to be
very careful with which libvpx version is used from the host, in order to avoid API/ABI
issues. Hence the version check should specify a version that is API/ABI compatible with
what libwebrtc expects.

This patch also re-enables data channel support, which was disabled during the update to M92
in CMake ports.

* CMakeLists.txt:

Canonical link: https://commits.webkit.org/238985@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-21 10:13:28 +00:00
Commit Queue e181466484 Unreviewed, reverting r279011.
https://bugs.webkit.org/show_bug.cgi?id=227153

broke ios build

Reverted changeset:

"[Mac] libwebrtc CMBaseClass objects need alignment fixup"
https://bugs.webkit.org/show_bug.cgi?id=227137
https://trac.webkit.org/changeset/279011

Canonical link: https://commits.webkit.org/238943@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-17 23:21:40 +00:00
Eric Carlson 8c7d0cc9da [Mac] libwebrtc CMBaseClass objects need alignment fixup
https://bugs.webkit.org/show_bug.cgi?id=227137

Reviewed by Youenn Fablet.

* Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp:
(webrtc::createWebKitVP8Decoder): Add padding to the CMBaseClass object on x86_64
so function pointers are naturally aligned. Add static_asserts to ensure alignment
and sizes are correct.
* Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp:
(webrtc::createWebKitVP9Decoder): Ditto.


Canonical link: https://commits.webkit.org/238936@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-17 22:01:55 +00:00
Youenn Fablet 0dd9a24e31 Enable kVTVideoEncoderSpecification_RequiredLowLatency in case of MacOS software encoder
https://bugs.webkit.org/show_bug.cgi?id=226873

Reviewed by Eric Carlson.

In case software encoder is being created for baseline, we can use kVTVideoEncoderSpecification_RequiredLowLatency
which provides better bitrate management than the regular SW encoder while still generating baseline content.
We check whether SW encoder is created based on kVTCompressionPropertyKey_UsingHardwareAcceleratedVideoEncoder.
If property is unsupported or if its value is false, it means the encoder is software.

* Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):


Canonical link: https://commits.webkit.org/238840@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-15 22:00:45 +00:00
Youenn Fablet 3c412c72d0 REGRESSION: [ BigSur iOS wk1 Debug ] imported/w3c/web-platform-tests/html/dom/usvstring-reflection.https.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=226928
<rdar://problem/79205526>

Reviewed by Eric Carlson.

* Source/webrtc/rtc_base/task_queue_stdlib.cc:
thread_ is created in TaskQueueStdlib constructor before other members pending_queue_ or delayed_queue_.
It might happen that thread_ will start executing its callback which will read delayed_queue_ before it is initialized by TaskQueueStdlib constructor.
Update to create thread_ before all other members.


Canonical link: https://commits.webkit.org/238828@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-15 18:21:57 +00:00
Ruben Turcios bd708bb50d Versioning.
WebKit-7612.1.20

Canonical link: https://commits.webkit.org/238791@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278844 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-14 18:44:12 +00:00
Youenn Fablet 5260c8ee94 Update libwebrtc to M92
https://bugs.webkit.org/show_bug.cgi?id=226494

LayoutTests/imported/w3c:

Reviewed by Eric Carlson.

* web-platform-tests/webrtc/datachannel-emptystring-expected.txt:
* web-platform-tests/webrtc/protocol/rtp-payloadtypes-expected.txt:
* web-platform-tests/webrtc/protocol/unknown-mediatypes-expected.txt:
* web-platform-tests/webrtc/receiver-track-live.https-expected.txt:

Source/ThirdParty/libwebrtc:

Reviewed by Eric Carlson.

* CMakeLists.txt:
* Source/webrtc: Resynced.
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

Reviewed by Eric Carlson.

Covered by existing tests.

* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
(WebCore::LibWebRTCRtpReceiverBackend::createSource):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillInboundRtpStreamStats):
(WebCore::fillOutboundRtpStreamStats):
(WebCore::fillRTCIceCandidateStats):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::signalingThread):
(WebCore::LibWebRTCProvider::createPeerConnectionFactory):
(WebCore::LibWebRTCProvider::setPeerConnectionFactory):
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::createConnection):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnectionOrError):
* testing/MockLibWebRTCPeerConnection.h:

LayoutTests:

Reviewed by Eric Carlson.

* webrtc/receiver-track-should-stay-live-even-if-receiver-is-inactive.html:
Update test since the backend is now fixed.


Canonical link: https://commits.webkit.org/238673@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-10 14:38:22 +00:00
Truitt Savell 77d9b270d7 Unreviewed, reverting r278609.
Broke builds with a linker error.

Reverted changeset:

"Update libwebrtc to M92"
https://bugs.webkit.org/show_bug.cgi?id=226494
https://commits.webkit.org/r278609

Canonical link: https://commits.webkit.org/238605@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 18:01:31 +00:00
Youenn Fablet 339da41e0c Update libwebrtc to M92
https://bugs.webkit.org/show_bug.cgi?id=226494

LayoutTests/imported/w3c:

Reviewed by Eric Carlson.

* web-platform-tests/webrtc/datachannel-emptystring-expected.txt:
* web-platform-tests/webrtc/protocol/rtp-payloadtypes-expected.txt:
* web-platform-tests/webrtc/protocol/unknown-mediatypes-expected.txt:
* web-platform-tests/webrtc/receiver-track-live.https-expected.txt:

Source/ThirdParty/libwebrtc:

Reviewed by Eric Carlson.

* CMakeLists.txt:
* Source/webrtc: Resynced.
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

Reviewed by Eric Carlson.

Covered by existing tests.

* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
(WebCore::LibWebRTCRtpReceiverBackend::createSource):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillInboundRtpStreamStats):
(WebCore::fillOutboundRtpStreamStats):
(WebCore::fillRTCIceCandidateStats):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::signalingThread):
(WebCore::LibWebRTCProvider::createPeerConnectionFactory):
(WebCore::LibWebRTCProvider::setPeerConnectionFactory):
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::createConnection):
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnectionOrError):
* testing/MockLibWebRTCPeerConnection.h:

LayoutTests:

Reviewed by Eric Carlson.

* webrtc/receiver-track-should-stay-live-even-if-receiver-is-inactive.html:
Update test since the backend is now fixed.


Canonical link: https://commits.webkit.org/238598@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 16:14:14 +00:00
Youenn Fablet 300141aacd Update usrsctp to M92
https://bugs.webkit.org/show_bug.cgi?id=226493

Patch by Youenn Fablet <youenn@apple.com> on 2021-06-08
Reviewed by Alex Christensen.

* Source/third_party/usrsctp: Resynced.
* Source/third_party/usrsctp/usrsctplib/.gitattributes: Added.


Canonical link: https://commits.webkit.org/238588@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 09:27:20 +00:00
Ruben Turcios 20307a3cb5 Versioning.
WebKit-7612.1.18

Canonical link: https://commits.webkit.org/238565@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-07 19:46:05 +00:00
Youenn Fablet ba3261d033 Update libvpx to M92
https://bugs.webkit.org/show_bug.cgi?id=226488

Reviewed by Eric Carlson.

* CMakeLists.txt:
* Source/third_party/libvpx: Resynced.
* libwebrtc.xcodeproj/project.pbxproj:


Canonical link: https://commits.webkit.org/238562@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-07 18:10:56 +00:00
Victor Jaquez 2614df7811 Update libyuv to M92
https://bugs.webkit.org/show_bug.cgi?id=226489

Reviewed by Eric Carlson.

* CMakeLists.txt:
* Source/third_party/libyuv: Resynced.
* Source/webrtc/sdk/WebKit/WebKitUtilities.mm:
Updated 10 bits frame conversion routine to use new libyuv routines (covered by webrtc/vp9-profile2.html)
* libwebrtc.xcodeproj/project.pbxproj:


Canonical link: https://commits.webkit.org/238549@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278551 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-07 08:53:33 +00:00
Youenn Fablet 30a5285d65 Update libsrtp to M92
https://bugs.webkit.org/show_bug.cgi?id=226487

Reviewed by Eric Carlson.

* Configurations/libsrtp.xcconfig:
* Source/third_party/libsrtp: Resynced.
* libwebrtc.xcodeproj/project.pbxproj:


Canonical link: https://commits.webkit.org/238545@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278547 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-07 06:59:02 +00:00
Youenn Fablet 76bce951ba Cherry-pick webrtc fix to correctly handle audio track state in case of renegotiation
https://bugs.webkit.org/show_bug.cgi?id=226577

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/receiver-track-live.https-expected.txt:

Source/ThirdParty/libwebrtc:

Cherry-pick https://webrtc.googlesource.com/src/+/c335b0e63bff56ca0fbfa617dee6a644c85df164%5E%21/.
We need to do small changes to peer_connection.cc given the upstream fix is based on a newer version
which has some code moved from peer_connection.cc to rtp_transmission_manager.cc.

* Source/webrtc/pc/audio_rtp_receiver.cc:
* Source/webrtc/pc/audio_rtp_receiver.h:
* Source/webrtc/pc/peer_connection.cc:
* Source/webrtc/pc/peer_connection_rtp_unittest.cc:
* Source/webrtc/pc/remote_audio_source.cc:
* Source/webrtc/pc/remote_audio_source.h:
* Source/webrtc/pc/rtp_sender_receiver_unittest.cc:

LayoutTests:

Update test now that we have the correct behavior.

* webrtc/receiver-track-should-stay-live-even-if-receiver-is-inactive.html:


Canonical link: https://commits.webkit.org/238435@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-03 17:25:28 +00:00
Youenn Fablet 9f9b62a0e2 Update boringssl to M92
https://bugs.webkit.org/show_bug.cgi?id=226486

Reviewed by Alex Christensen.

* CMakeLists.txt:
* Source/third_party/boringssl/BUILD.generated.gni: Resynced.
* libwebrtc.xcodeproj/project.pbxproj:


Canonical link: https://commits.webkit.org/238384@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 15:56:47 +00:00
Youenn Fablet 6fe82d470f Update pffft to M92
https://bugs.webkit.org/show_bug.cgi?id=226491

Reviewed by Alex Christensen.

* Source/third_party/pffft/BUILD.gn:
* Source/third_party/pffft/DIR_METADATA: Added.


Canonical link: https://commits.webkit.org/238381@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 12:17:18 +00:00
Youenn Fablet 38eb0182f1 Update opus to M92
https://bugs.webkit.org/show_bug.cgi?id=226490

Reviewed by Alex Christensen.

* Source/third_party: Resynced.


Canonical link: https://commits.webkit.org/238380@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 12:17:00 +00:00
Youenn Fablet 4a9824f3d0 Update to rnnoise to M92
https://bugs.webkit.org/show_bug.cgi?id=226492

Reviewed by Alex Christensen.

* Source/third_party/rnnoise/DIR_METADATA: Added.
* Source/third_party/rnnoise/OWNERS:


Canonical link: https://commits.webkit.org/238379@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278347 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 12:08:05 +00:00
Youenn Fablet 601f079004 Update abseil-cpp to M92
https://bugs.webkit.org/show_bug.cgi?id=226485

Reviewed by Alex Christensen.

* Source/third_party/abseil-cpp: Resynced.


Canonical link: https://commits.webkit.org/238374@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 08:11:14 +00:00
Youenn Fablet 3a0bc890c8 Use tighter bitrate allocation rules for WebRTC H264 software encoder
https://bugs.webkit.org/show_bug.cgi?id=226319
<rdar://73150695>

Reviewed by Eric Carlson.

Software H264 encoder is sometimes overshooting target bitrate in which case WebRTC backend will start dropping frames.
The encoder might then think it is on target and will not try to increase compression.
This makes it possible to be locked in a very low frame rate but high quality image situation.
It is often better to preserve frame rate and lower quality, the application could always lower frame rate if desired.

To do so, we detect whether the encoder is using software code path or not.
If so, we compute the actual frame rate and compare it with the expected frame rate.
If the actual frame rate is twice smaller or even below, we enter in a low frame rate mode.
Otherwise, we are in a regular frame rate mode where we apply the normal bitrate rules.
In the low frame rate mode, we divide the target bitrate by 3 so as to quickly recover frame rate.

This works well in situations where motion increases from time to time.
It is still not perfect for instance in case the video is muted and gets unmuted or when the scene is completely still and suddenly large motion happens.
In those cases, frame rate is recovered after a minute or so according my testing.

* Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 initWithCodecInfo:]):
(-[RTCVideoEncoderH264 encode:codecSpecificInfo:frameTypes:]):
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
(-[RTCVideoEncoderH264 setEncoderBitrateBps:frameRate:]):
(-[RTCVideoEncoderH264 updateBitRateAccordingActualFrameRate]):


Canonical link: https://commits.webkit.org/238309@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-31 07:28:32 +00:00
Russell Epstein 17e4ef947b Versioning.
WebKit-7612.1.16

Canonical link: https://commits.webkit.org/238066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-23 22:07:37 +00:00
Youenn Fablet d10b3debe6 Enable VCP for H264 baseline
https://bugs.webkit.org/show_bug.cgi?id=224043

Reviewed by Eric Carlson.

Enable VCP for baseline past BigSur/iOS14.
Add macros and introduce _useBaseline in addition to _useVCP for that purpose.

* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h:
* Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 initWithCodecInfo:]):
(-[RTCVideoEncoderH264 configureCompressionSession]):


Canonical link: https://commits.webkit.org/237946@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-20 15:49:23 +00:00
Youenn Fablet 2f78efee78 Improve usrsctp restart handling
https://bugs.webkit.org/show_bug.cgi?id=225638
<rdar://77582953>

Reviewed by Alex Christensen.

* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c:
(sctp_process_cookie_existing):


Canonical link: https://commits.webkit.org/237591@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277332 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-11 18:01:25 +00:00
Russell Epstein a9ad6be2f5 Versioning.
WebKit-7612.1.15

Canonical link: https://commits.webkit.org/237543@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 18:29:23 +00:00
Alex Christensen e4226674b8 Allow libwebrtc to build for Mac Catalyst
https://bugs.webkit.org/show_bug.cgi?id=225505

Reviewed by Youenn Fablet.

This is progress towards rdar://77568774

Changes necessary to get it to build and link were:
1. kCVPixelBufferOpenGLESCompatibilityKey is unavailable on Catalyst, so use kCVPixelBufferOpenGLCompatibilityKey like we do on macOS.
2. SSE4 and AVX seem to be unavailable in the Catalyst SDK like they are in the iOS simulator SDK, so disable them similarly.
3. Link to UIKit and CoreGraphics in debug builds like we do with iOS family builds.
4. Don't use @loader_path/../../../ for DYLIB_INSTALL_NAME_BASE like we do with relocatable Safari builds, similar to an ANGLE change I made in r276318
5. Export the same symbols as iOS for now.  This may need some tweaking when I get it to link with WebCore, but that's why this is only progress.

* Configurations/DebugRelease.xcconfig:
* Configurations/SDKVariant.xcconfig:
* Configurations/libvpx.xcconfig:
* Configurations/libwebrtc.xcconfig:
* Configurations/opus.xcconfig:
* Source/third_party/libvpx/source/config/mac/x64/vp8_rtcd.h:
* Source/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h:
* Source/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h:
* Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH264.mm:
(-[RTCVideoDecoderH264 resetDecompressionSession]):
* Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH265.mm:
(-[RTCVideoDecoderH265 resetDecompressionSession]):
* Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderVTBVP9.mm:
(-[RTCVideoDecoderVTBVP9 resetDecompressionSession]):
* Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
* Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH265.mm:
(-[RTCVideoEncoderH265 resetCompressionSession]):



Canonical link: https://commits.webkit.org/237462@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-07 16:21:55 +00:00
Yury Semikhatsky 33db7ed3ca [LibWebRTC][WPE][GTK] do not use system installed vpx headers when building webrtc
https://bugs.webkit.org/show_bug.cgi?id=225401

Reviewed by Philippe Normand.

Use vpx headers from Source/ThirdParty/libwebrtc instead of those from the host system.

* CMakeLists.txt: expose libvpx headers to webrtc


Canonical link: https://commits.webkit.org/237349@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-05 20:19:23 +00:00
Ruben Turcios 64d90e2833 Versioning.
WebKit-7612.1.13

Canonical link: https://commits.webkit.org/237092@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-27 22:48:54 +00:00
Youenn Fablet d71808e2b9 Disable WebRTC trace event macros
https://bugs.webkit.org/show_bug.cgi?id=225104
<rdar://76146558>

Reviewed by Eric Carlson.

We are not using trace events so we can disable them as a small optimization.

* Configurations/libwebrtc.xcconfig:
* Configurations/libwebrtcpcrtc.xcconfig:


Canonical link: https://commits.webkit.org/237077@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-27 18:50:26 +00:00
Philippe Normand 6edd4ed3ee [LibWebRTC][WPE][GTK] Enable vp9 and NO_MAIN_THREAD_WRAPPING
https://bugs.webkit.org/show_bug.cgi?id=222795

Patch by Philippe Normand <pnormand@igalia.com> on 2021-04-23
Reviewed by Xabier Rodriguez-Calvar.

Source/ThirdParty/libwebrtc:

* CMakeLists.txt: Enable NO_MAIN_THREAD_WRAPPING as in the XCode build and harmonize options
between Apple and non-Apple ports.
* Source/webrtc/common_video/h265/h265_pps_parser.h:

Source/WebCore:

Add VP9 encoding and decoding support in the WPE/GTK LibWebRTC backend. The underlying
encoding support is based on LibWebRTC's internal VP9 support. The GStreamer VPx encoders
lack simulcast and high profile support, so can't really be used anyway. The
GStreamerVP8Encoder was removed for this reason as well.

* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::VP9Decoder::VP9Decoder):
(WebCore::VP9Decoder::Create):
(WebCore::GStreamerVideoDecoderFactory::CreateVideoDecoder):
(WebCore::GStreamerVideoDecoderFactory::GStreamerVideoDecoderFactory):
(WebCore::GStreamerVideoDecoderFactory::GetSupportedFormats const):
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.h:
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::makeElement):
(WebCore::GStreamerVideoEncoder::createEncoder):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
(WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder):
(WebCore::GStreamerVideoEncoderFactory::GStreamerVideoEncoderFactory):
(WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h:
* platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp:
(WebCore::LibWebRTCProviderGStreamer::createDecoderFactory):
(WebCore::LibWebRTCProviderGStreamer::createEncoderFactory):

LayoutTests:

Update GLIB baselines for webrtc tests.

* platform/glib/TestExpectations:
* platform/glib/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-onnegotiationneeded-expected.txt: Added.
* platform/glib/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-restartIce.https-expected.txt: Added.
* platform/glib/imported/w3c/web-platform-tests/webrtc/RTCRtpTransceiver-setCodecPreferences-expected.txt: Added.

Canonical link: https://commits.webkit.org/236950@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276491 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-23 09:23:04 +00:00
Kimmo Kinnunen e347f08000 WebRTC should be compiled with thread-safe statics
https://bugs.webkit.org/show_bug.cgi?id=224863

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-04-21
Reviewed by Youenn Fablet.

Compile libwebrtc with normal thread-safe c++ local statics.
No known threading failures. Based on ad-hoc risk vs benefit
evaluation of today and after future merges, it appears
better to err in the side of caution.

* Configurations/Base.xcconfig:

Canonical link: https://commits.webkit.org/236840@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-21 15:25:14 +00:00
Youenn Fablet ed2e5562cc [ BigSur wk2 ARM64 ] http/wpt/webrtc/change-encoded-transform.html is a flakey crash
https://bugs.webkit.org/show_bug.cgi?id=224696
<rdar://problem/76780020>

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

On stream recreation, the new delegate may have to process a transformed frame before receiving one from the encoder.
Check for encoder_queue to not be null in that case.

* Source/webrtc/modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc:

Source/WebCore:

Sometimes the video sender delegate will be recreated on the fly.
In that case, it might receive a frame from the old delegate before processing an existing frame.
This makes the encoder queue being null.
To prevent this we update backends to only register once.

Covered by tests no longer crashing.

* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.cpp:
(WebCore::LibWebRTCRtpReceiverTransformBackend::setTransformableFrameCallback):
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.cpp:
(WebCore::LibWebRTCRtpSenderTransformBackend::setTransformableFrameCallback):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.h:


Canonical link: https://commits.webkit.org/236827@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-21 07:33:00 +00:00
Philippe Normand 0a4edf6dcd [WebRTC][GStreamer] Build and use the openh264 based encoder if present on the system
https://bugs.webkit.org/show_bug.cgi?id=202538
<rdar://problem/76047172>

Patch by Philippe Normand <pnormand@igalia.com> on 2021-04-15
Reviewed by Xabier Rodriguez-Calvar.

.:

* Source/CMakeLists.txt:
* Source/cmake/GStreamerChecks.cmake:

Source/ThirdParty/libwebrtc:

In WPE/GTK we would like to have the libwebrtc openh264 encoder enabled if libopenh264 is
present on the host (eg not vendored).

* CMakeLists.txt:
* LibWebRTCWebKitMacros.h.in: Added.
* Source/webrtc/modules/video_coding/codecs/h264/h264.cc:
* Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc:
* Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h:
* cmake/FindOpenh264.cmake: Added.

Source/WebCore:

Enable the openh264 encoder if it is available, it would be preferred over existing
GStreamer H.264 encoders in such case.

* platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp:
(WebCore::supportedH264Formats):
* platform/mediastream/libwebrtc/GStreamerVideoCommon.h:
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder):
(WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const):

Canonical link: https://commits.webkit.org/236571@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-15 13:02:06 +00:00