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
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
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
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
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
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
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
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
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
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
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
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
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
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