You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[GStreamer][WebRTC] Emit 'track' event before resolving setRemoteDescription's promise
https://bugs.webkit.org/show_bug.cgi?id=275685
Reviewed by Philippe Normand.
The track event should be emitted after sucessfully applying a remote
description and before the promise from setRemoteDescription is resolved.
However, up until now the GstWebRTC backend emitted the event based on
the 'pad-added' signal. The timing of the signal doesn't match what the
spec expects.
Fix the issue by querying the transceiver states after applying a remote
description sucessfully. By providing the transceiver states to
PeerConnectionBackend::setRemoteDescriptionSucceeded(), it's able to
emit the track events correctly acccording to the spec.
A test is added to check that the track event is emitted before
setRemoteDescription resolves, which would fail before this patch in
the GstWebRTC backend.
* LayoutTests/platform/glib/TestExpectations:
* LayoutTests/platform/glib/fast/mediastream/RTCPeerConnection-inspect-answer-expected.txt:
* LayoutTests/platform/glib/fast/mediastream/RTCPeerConnection-media-setup-single-dialog-expected.txt:
* LayoutTests/platform/glib/fast/mediastream/RTCPeerConnection-setRemoteDescription-offer-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-parameterless.https-expected.txt: Removed.
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/webrtc/protocol/split.https-expected.txt: Added.
* LayoutTests/webrtc/setRemoteDescription-track-expected.txt: Added.
* LayoutTests/webrtc/setRemoteDescription-track.html: Added.
* Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
(WebCore::PeerConnectionBackend::stop):
(WebCore::PeerConnectionBackend::dispatchTrackEvent): Deleted.
(WebCore::PeerConnectionBackend::addPendingTrackEvent): Deleted.
* Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::initializePipeline):
(WebCore::GStreamerMediaEndpointTransceiverState::isolatedCopy):
(WebCore::getMediaStreamIdsFromSDPMedia):
(WebCore::isRecvDirection):
(WebCore::toGStreamerMediaEndpointTransceiverState):
(WebCore::transceiverStatesFromWebRTCBin):
(WebCore::GStreamerMediaEndpoint::doSetLocalDescription):
(WebCore::GStreamerMediaEndpoint::setTransceiverCodecPreferences):
(WebCore::GStreamerMediaEndpoint::doSetRemoteDescription):
(WebCore::GStreamerMediaEndpoint::setDescription):
(WebCore::GStreamerMediaEndpoint::connectIncomingTrack):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h:
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.cpp:
(WebCore::GStreamerPeerConnectionBackend::addPendingTrackEvent): Deleted.
(WebCore::GStreamerPeerConnectionBackend::dispatchPendingTrackEvents): Deleted.
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.h:
* Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::dataFlowStarted):
* Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivateObserver::dataFlowStarted):
* Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(webkitMediaStreamSrcCharacteristicsChanged):
Canonical link: https://commits.webkit.org/281892@main
0 commit comments