This patch ensures tracks missing from a subsequent updateTracks() calls are removed from the player. This fixes the following tests regressed by the track switch rework: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-removetrack.https.html imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-applyConstraints.https.html
Created attachment 399548 [details] Patch
Created attachment 399555 [details] Patch
Comment on attachment 399555 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399555&action=review > Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1512 > +template<typename K, typename V> > +HashSet<K> hashSetFromHashMapKeys(const HashMap<K, V>& hashMap) > +{ > + HashSet<K> keys; > + for (auto& key : hashMap.keys()) > + keys.add(key); > + return keys; > +} Would this be worth moving to HashMap as a new method?
Comment on attachment 399555 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399555&action=review >> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1512 >> +} > > Would this be worth moving to HashMap as a new method? I don't know, all HashMap methods are pretty basic, so maybe someone would oppose this in WTF, or maybe a function already exists and I just didn't find it. I wanted a self-contained fix that didn't need a potentially stalling WTF review, so this was a reasonable solution. I've asked in the WebKit slack, if it turns out there was an existing function or there wasn't but people really want it in WTF another patch can be made that moves it there. For now I'm using this.
Committed r261803: <https://trac.webkit.org/changeset/261803> All reviewed patches have been landed. Closing bug and clearing flags on attachment 399555 [details].