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

Unified Diff: webrtc/call/call.cc

Issue 3000273002: Reverse |rtx_payload_types| map, and rename. (Closed)
Patch Set: 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') | webrtc/video/rtp_video_stream_receiver.cc » ('J')
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 1b5bc456b0f1a722436902db740881233f5dbee1..a315d744d6080da0e3f1065ffca1c643fa0ee65f 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -87,6 +87,15 @@ bool UseSendSideBwe(const FlexfecReceiveStream::Config& config) {
return UseSendSideBwe(config.rtp_header_extensions, config.transport_cc);
}
+template <typename K, typename V>
danilchap 2017/08/21 14:11:26 may be do not use template until you'll use it for
nisse-webrtc 2017/08/22 07:11:01 Done.
+const K* find_by_value(const std::map<K, V>& m, V v) {
danilchap 2017/08/21 14:11:26 FindByValue https://google.github.io/styleguide/cp
nisse-webrtc 2017/08/22 07:11:01 Done.
+ 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;
@@ -98,10 +107,9 @@ 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);
+ auto search = find_by_value(config.rtp.media_pt_by_rtx_pt, d.payload_type);
danilchap 2017/08/21 14:11:26 since search is no longer a long-named iterator, u
nisse-webrtc 2017/08/22 07:11:01 Done.
+ 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') | webrtc/video/rtp_video_stream_receiver.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698