Title: [279033] trunk
Revision
279033
Author
[email protected]
Date
2021-06-18 01:29:09 -0700 (Fri, 18 Jun 2021)

Log Message

[WebRTC][GStreamer] fast/mediastream/MediaStream-video-element-remove-track.html is failing
https://bugs.webkit.org/show_bug.cgi?id=191886

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Trigger source pad removal in the mediastream source element when a track has been removed.

* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebKitMediaStreamObserver::didRemoveTrack):

LayoutTests:

* platform/glib/TestExpectations: Unflag test now passing.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (279032 => 279033)


--- trunk/LayoutTests/ChangeLog	2021-06-18 08:05:25 UTC (rev 279032)
+++ trunk/LayoutTests/ChangeLog	2021-06-18 08:29:09 UTC (rev 279033)
@@ -1,3 +1,12 @@
+2021-06-18  Philippe Normand  <[email protected]>
+
+        [WebRTC][GStreamer] fast/mediastream/MediaStream-video-element-remove-track.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=191886
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * platform/glib/TestExpectations: Unflag test now passing.
+
 2021-06-18  Carlos Garcia Campos  <[email protected]>
 
         [SOUP] Add Timing-Allow-Origin checks to NetworkDataTaskSoup

Modified: trunk/LayoutTests/platform/glib/TestExpectations (279032 => 279033)


--- trunk/LayoutTests/platform/glib/TestExpectations	2021-06-18 08:05:25 UTC (rev 279032)
+++ trunk/LayoutTests/platform/glib/TestExpectations	2021-06-18 08:29:09 UTC (rev 279033)
@@ -544,11 +544,9 @@
 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html [ Timeout ]
 webkit.org/b/79203 fast/mediastream/RTCRtpSender-replaceTrack.html [ Failure ]
 webkit.org/b/187603 fast/mediastream/media-stream-track-source-failure.html [ Timeout Failure Pass ]
-webkit.org/b/191886 fast/mediastream/MediaStream-video-element-remove-track.html [ Failure ]
 
 webkit.org/b/218317 media/media-source/media-source-trackid-change.html [ Failure ]
 
-
 webkit.org/b/211995 fast/images/animated-image-mp4.html [ Failure Timeout ]
 webkit.org/b/211995 fast/images/animated-image-mp4-crash.html [ Timeout Pass ]
 

Modified: trunk/Source/WebCore/ChangeLog (279032 => 279033)


--- trunk/Source/WebCore/ChangeLog	2021-06-18 08:05:25 UTC (rev 279032)
+++ trunk/Source/WebCore/ChangeLog	2021-06-18 08:29:09 UTC (rev 279033)
@@ -1,3 +1,15 @@
+2021-06-18  Philippe Normand  <[email protected]>
+
+        [WebRTC][GStreamer] fast/mediastream/MediaStream-video-element-remove-track.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=191886
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Trigger source pad removal in the mediastream source element when a track has been removed.
+
+        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
+        (WebKitMediaStreamObserver::didRemoveTrack):
+
 2021-06-17  Said Abou-Hallawa  <[email protected]>
 
         [Cocoa] Disable hardware decoding in the WebProcess

Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp (279032 => 279033)


--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp	2021-06-18 08:05:25 UTC (rev 279032)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp	2021-06-18 08:29:09 UTC (rev 279033)
@@ -352,6 +352,8 @@
     PROP_LAST
 };
 
+static void webkitMediaStreamSrcTrackEnded(WebKitMediaStreamSrc*, InternalSource&);
+
 void WebKitMediaStreamObserver::didRemoveTrack(MediaStreamTrackPrivate& track)
 {
     if (!m_src)
@@ -358,9 +360,22 @@
         return;
 
     auto* element = WEBKIT_MEDIA_STREAM_SRC_CAST(m_src);
-    element->priv->sources.removeFirstMatching([&](auto& item) {
+    auto* priv = element->priv;
+
+    // Lookup the corresponding InternalSource and take it from the storage.
+    auto index = priv->sources.findMatching([&](auto& item) {
         return item->track().id() == track.id();
     });
+    std::unique_ptr<InternalSource> source = WTFMove(priv->sources[index]);
+    priv->sources.remove(index);
+
+    // Remove track from internal storage, so that the new stream collection will not reference it.
+    priv->tracks.removeFirstMatching([&](auto& item) {
+        return item->id() == track.id();
+    });
+
+    // Remove corresponding source pad, emit new stream collection.
+    webkitMediaStreamSrcTrackEnded(element, *source);
 }
 
 static GstURIType webkitMediaStreamSrcUriGetType(GType)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to