OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 } | 80 } |
81 | 81 |
82 bool UseSendSideBwe(const AudioReceiveStream::Config& config) { | 82 bool UseSendSideBwe(const AudioReceiveStream::Config& config) { |
83 return UseSendSideBwe(config.rtp.extensions, config.rtp.transport_cc); | 83 return UseSendSideBwe(config.rtp.extensions, config.rtp.transport_cc); |
84 } | 84 } |
85 | 85 |
86 bool UseSendSideBwe(const FlexfecReceiveStream::Config& config) { | 86 bool UseSendSideBwe(const FlexfecReceiveStream::Config& config) { |
87 return UseSendSideBwe(config.rtp_header_extensions, config.transport_cc); | 87 return UseSendSideBwe(config.rtp_header_extensions, config.transport_cc); |
88 } | 88 } |
89 | 89 |
90 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.
| |
91 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.
| |
92 for (const auto& kv : m) { | |
93 if (kv.second == v) | |
94 return &kv.first; | |
95 } | |
96 return nullptr; | |
97 } | |
98 | |
90 rtclog::StreamConfig CreateRtcLogStreamConfig( | 99 rtclog::StreamConfig CreateRtcLogStreamConfig( |
91 const VideoReceiveStream::Config& config) { | 100 const VideoReceiveStream::Config& config) { |
92 rtclog::StreamConfig rtclog_config; | 101 rtclog::StreamConfig rtclog_config; |
93 rtclog_config.remote_ssrc = config.rtp.remote_ssrc; | 102 rtclog_config.remote_ssrc = config.rtp.remote_ssrc; |
94 rtclog_config.local_ssrc = config.rtp.local_ssrc; | 103 rtclog_config.local_ssrc = config.rtp.local_ssrc; |
95 rtclog_config.rtx_ssrc = config.rtp.rtx_ssrc; | 104 rtclog_config.rtx_ssrc = config.rtp.rtx_ssrc; |
96 rtclog_config.rtcp_mode = config.rtp.rtcp_mode; | 105 rtclog_config.rtcp_mode = config.rtp.rtcp_mode; |
97 rtclog_config.remb = config.rtp.remb; | 106 rtclog_config.remb = config.rtp.remb; |
98 rtclog_config.rtp_extensions = config.rtp.extensions; | 107 rtclog_config.rtp_extensions = config.rtp.extensions; |
99 | 108 |
100 for (const auto& d : config.decoders) { | 109 for (const auto& d : config.decoders) { |
101 auto search = config.rtp.rtx_payload_types.find(d.payload_type); | 110 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.
| |
102 rtclog_config.codecs.emplace_back( | 111 rtclog_config.codecs.emplace_back(d.payload_name, d.payload_type, |
103 d.payload_name, d.payload_type, | 112 search ? *search : 0); |
104 search != config.rtp.rtx_payload_types.end() ? search->second : 0); | |
105 } | 113 } |
106 return rtclog_config; | 114 return rtclog_config; |
107 } | 115 } |
108 | 116 |
109 rtclog::StreamConfig CreateRtcLogStreamConfig( | 117 rtclog::StreamConfig CreateRtcLogStreamConfig( |
110 const VideoSendStream::Config& config, | 118 const VideoSendStream::Config& config, |
111 size_t ssrc_index) { | 119 size_t ssrc_index) { |
112 rtclog::StreamConfig rtclog_config; | 120 rtclog::StreamConfig rtclog_config; |
113 rtclog_config.local_ssrc = config.rtp.ssrcs[ssrc_index]; | 121 rtclog_config.local_ssrc = config.rtp.ssrcs[ssrc_index]; |
114 if (ssrc_index < config.rtp.rtx.ssrcs.size()) { | 122 if (ssrc_index < config.rtp.rtx.ssrcs.size()) { |
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1422 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { | 1430 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { |
1423 receive_side_cc_.OnReceivedPacket( | 1431 receive_side_cc_.OnReceivedPacket( |
1424 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), | 1432 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), |
1425 header); | 1433 header); |
1426 } | 1434 } |
1427 } | 1435 } |
1428 | 1436 |
1429 } // namespace internal | 1437 } // namespace internal |
1430 | 1438 |
1431 } // namespace webrtc | 1439 } // namespace webrtc |
OLD | NEW |