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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 bool UseSendSideBwe(const AudioReceiveStream::Config& config) { | 81 bool UseSendSideBwe(const AudioReceiveStream::Config& config) { |
82 return UseSendSideBwe(config.rtp.extensions, config.rtp.transport_cc); | 82 return UseSendSideBwe(config.rtp.extensions, config.rtp.transport_cc); |
83 } | 83 } |
84 | 84 |
85 bool UseSendSideBwe(const FlexfecReceiveStream::Config& config) { | 85 bool UseSendSideBwe(const FlexfecReceiveStream::Config& config) { |
86 return UseSendSideBwe(config.rtp_header_extensions, config.transport_cc); | 86 return UseSendSideBwe(config.rtp_header_extensions, config.transport_cc); |
87 } | 87 } |
88 | 88 |
| 89 const int* FindKeyByValue(const std::map<int, int>& m, int v) { |
| 90 for (const auto& kv : m) { |
| 91 if (kv.second == v) |
| 92 return &kv.first; |
| 93 } |
| 94 return nullptr; |
| 95 } |
| 96 |
89 rtclog::StreamConfig CreateRtcLogStreamConfig( | 97 rtclog::StreamConfig CreateRtcLogStreamConfig( |
90 const VideoReceiveStream::Config& config) { | 98 const VideoReceiveStream::Config& config) { |
91 rtclog::StreamConfig rtclog_config; | 99 rtclog::StreamConfig rtclog_config; |
92 rtclog_config.remote_ssrc = config.rtp.remote_ssrc; | 100 rtclog_config.remote_ssrc = config.rtp.remote_ssrc; |
93 rtclog_config.local_ssrc = config.rtp.local_ssrc; | 101 rtclog_config.local_ssrc = config.rtp.local_ssrc; |
94 rtclog_config.rtx_ssrc = config.rtp.rtx_ssrc; | 102 rtclog_config.rtx_ssrc = config.rtp.rtx_ssrc; |
95 rtclog_config.rtcp_mode = config.rtp.rtcp_mode; | 103 rtclog_config.rtcp_mode = config.rtp.rtcp_mode; |
96 rtclog_config.remb = config.rtp.remb; | 104 rtclog_config.remb = config.rtp.remb; |
97 rtclog_config.rtp_extensions = config.rtp.extensions; | 105 rtclog_config.rtp_extensions = config.rtp.extensions; |
98 | 106 |
99 for (const auto& d : config.decoders) { | 107 for (const auto& d : config.decoders) { |
100 auto search = config.rtp.rtx_payload_types.find(d.payload_type); | 108 const int* search = |
101 rtclog_config.codecs.emplace_back( | 109 FindKeyByValue(config.rtp.rtx_associated_payload_types, d.payload_type); |
102 d.payload_name, d.payload_type, | 110 rtclog_config.codecs.emplace_back(d.payload_name, d.payload_type, |
103 search != config.rtp.rtx_payload_types.end() ? search->second : 0); | 111 search ? *search : 0); |
104 } | 112 } |
105 return rtclog_config; | 113 return rtclog_config; |
106 } | 114 } |
107 | 115 |
108 rtclog::StreamConfig CreateRtcLogStreamConfig( | 116 rtclog::StreamConfig CreateRtcLogStreamConfig( |
109 const VideoSendStream::Config& config, | 117 const VideoSendStream::Config& config, |
110 size_t ssrc_index) { | 118 size_t ssrc_index) { |
111 rtclog::StreamConfig rtclog_config; | 119 rtclog::StreamConfig rtclog_config; |
112 rtclog_config.local_ssrc = config.rtp.ssrcs[ssrc_index]; | 120 rtclog_config.local_ssrc = config.rtp.ssrcs[ssrc_index]; |
113 if (ssrc_index < config.rtp.rtx.ssrcs.size()) { | 121 if (ssrc_index < config.rtp.rtx.ssrcs.size()) { |
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { | 1441 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { |
1434 receive_side_cc_.OnReceivedPacket( | 1442 receive_side_cc_.OnReceivedPacket( |
1435 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), | 1443 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), |
1436 header); | 1444 header); |
1437 } | 1445 } |
1438 } | 1446 } |
1439 | 1447 |
1440 } // namespace internal | 1448 } // namespace internal |
1441 | 1449 |
1442 } // namespace webrtc | 1450 } // namespace webrtc |
OLD | NEW |