From fade919bb16c2b11f20aeacc24537ab3f63c98ac Mon Sep 17 00:00:00 2001 From: Victor Boivie Date: Tue, 25 May 2021 13:34:07 +0200 Subject: [PATCH] Partial revert: "Use unordered map in RtpDemuxer" While the savings were positive in Media Servers, there was a regression in some scenarios (crbug.com/webrtc/12718) so let's revert it. This partially reverts commit 553fd3220b7b1a476af6759b27b3a274677d21e3. Bug: webrtc:12718 Change-Id: If9252fd996ffc5efd7609eb4c7c0e7f001893676 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220103 Reviewed-by: Sebastian Jansson Commit-Queue: Victor Boivie Cr-Commit-Position: refs/heads/master@{#34117} --- call/rtp_demuxer.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/call/rtp_demuxer.h b/call/rtp_demuxer.h index 00c0508584..b71c2bc494 100644 --- a/call/rtp_demuxer.h +++ b/call/rtp_demuxer.h @@ -14,12 +14,9 @@ #include #include #include -#include #include #include -#include "rtc_base/hash.h" - namespace webrtc { class RtpPacketReceived; @@ -171,14 +168,12 @@ class RtpDemuxer { // Note: Mappings are only modified by AddSink/RemoveSink (except for // SSRC mapping which receives all MID, payload type, or RSID to SSRC bindings // discovered when demuxing packets). - std::unordered_map sink_by_mid_; - std::unordered_map sink_by_ssrc_; - std::unordered_multimap sinks_by_pt_; - std::unordered_map, - RtpPacketSinkInterface*, - webrtc::PairHash> + std::map sink_by_mid_; + std::map sink_by_ssrc_; + std::multimap sinks_by_pt_; + std::map, RtpPacketSinkInterface*> sink_by_mid_and_rsid_; - std::unordered_map sink_by_rsid_; + std::map sink_by_rsid_; // Tracks all the MIDs that have been identified in added criteria. Used to // determine if a packet should be dropped right away because the MID is @@ -189,8 +184,8 @@ class RtpDemuxer { // received. // This is stored separately from the sink mappings because if a sink is // removed we want to still remember these associations. - std::unordered_map mid_by_ssrc_; - std::unordered_map rsid_by_ssrc_; + std::map mid_by_ssrc_; + std::map rsid_by_ssrc_; // Adds a binding from the SSRC to the given sink. void AddSsrcSinkBinding(uint32_t ssrc, RtpPacketSinkInterface* sink);