Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Unified Diff: webrtc/call/call.cc

Issue 3000273002: Reverse |rtx_payload_types| map, and rename. (Closed)
Patch Set: Rebased. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/call/rampup_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/call/call.cc
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
index f2bf27efa764f69f5bf0e4228b2d23338e90b762..2476da16e5b9a381b55b0421af90d7162dede957 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -86,6 +86,14 @@ bool UseSendSideBwe(const FlexfecReceiveStream::Config& config) {
return UseSendSideBwe(config.rtp_header_extensions, config.transport_cc);
}
+const int* FindKeyByValue(const std::map<int, int>& m, int v) {
+ for (const auto& kv : m) {
+ if (kv.second == v)
+ return &kv.first;
+ }
+ return nullptr;
+}
+
rtclog::StreamConfig CreateRtcLogStreamConfig(
const VideoReceiveStream::Config& config) {
rtclog::StreamConfig rtclog_config;
@@ -97,10 +105,10 @@ rtclog::StreamConfig CreateRtcLogStreamConfig(
rtclog_config.rtp_extensions = config.rtp.extensions;
for (const auto& d : config.decoders) {
- auto search = config.rtp.rtx_payload_types.find(d.payload_type);
- rtclog_config.codecs.emplace_back(
- d.payload_name, d.payload_type,
- search != config.rtp.rtx_payload_types.end() ? search->second : 0);
+ const int* search =
+ FindKeyByValue(config.rtp.rtx_associated_payload_types, d.payload_type);
+ rtclog_config.codecs.emplace_back(d.payload_name, d.payload_type,
+ search ? *search : 0);
}
return rtclog_config;
}
« no previous file with comments | « no previous file | webrtc/call/rampup_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698