OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 if (config.rtp.rtcp_mode == RtcpMode::kCompound) { | 120 if (config.rtp.rtcp_mode == RtcpMode::kCompound) { |
121 EXPECT_EQ(rtclog::VideoReceiveConfig::RTCP_COMPOUND, | 121 EXPECT_EQ(rtclog::VideoReceiveConfig::RTCP_COMPOUND, |
122 receiver_config.rtcp_mode()); | 122 receiver_config.rtcp_mode()); |
123 } else { | 123 } else { |
124 EXPECT_EQ(rtclog::VideoReceiveConfig::RTCP_REDUCEDSIZE, | 124 EXPECT_EQ(rtclog::VideoReceiveConfig::RTCP_REDUCEDSIZE, |
125 receiver_config.rtcp_mode()); | 125 receiver_config.rtcp_mode()); |
126 } | 126 } |
127 ASSERT_TRUE(receiver_config.has_remb()); | 127 ASSERT_TRUE(receiver_config.has_remb()); |
128 EXPECT_EQ(config.rtp.remb, receiver_config.remb()); | 128 EXPECT_EQ(config.rtp.remb, receiver_config.remb()); |
129 // Check RTX map. | 129 // Check RTX map. |
130 ASSERT_EQ(static_cast<int>(config.rtp.rtx.size()), | 130 ASSERT_EQ(static_cast<int>(config.rtp.rtx_payload_types.size()), |
131 receiver_config.rtx_map_size()); | 131 receiver_config.rtx_map_size()); |
132 for (const rtclog::RtxMap& rtx_map : receiver_config.rtx_map()) { | 132 for (const rtclog::RtxMap& rtx_map : receiver_config.rtx_map()) { |
133 ASSERT_TRUE(rtx_map.has_payload_type()); | 133 ASSERT_TRUE(rtx_map.has_payload_type()); |
134 ASSERT_TRUE(rtx_map.has_config()); | 134 ASSERT_TRUE(rtx_map.has_config()); |
135 EXPECT_EQ(1u, config.rtp.rtx.count(rtx_map.payload_type())); | 135 EXPECT_EQ(1u, config.rtp.rtx_payload_types.count(rtx_map.payload_type())); |
136 const rtclog::RtxConfig& rtx_config = rtx_map.config(); | 136 const rtclog::RtxConfig& rtx_config = rtx_map.config(); |
137 const VideoReceiveStream::Config::Rtp::Rtx& rtx = | |
138 config.rtp.rtx.at(rtx_map.payload_type()); | |
139 ASSERT_TRUE(rtx_config.has_rtx_ssrc()); | 137 ASSERT_TRUE(rtx_config.has_rtx_ssrc()); |
140 ASSERT_TRUE(rtx_config.has_rtx_payload_type()); | 138 ASSERT_TRUE(rtx_config.has_rtx_payload_type()); |
141 EXPECT_EQ(rtx.ssrc, rtx_config.rtx_ssrc()); | 139 EXPECT_EQ(config.rtp.rtx_ssrc, rtx_config.rtx_ssrc()); |
142 EXPECT_EQ(rtx.payload_type, rtx_config.rtx_payload_type()); | 140 EXPECT_EQ(config.rtp.rtx_payload_types.at(rtx_map.payload_type()), |
| 141 rtx_config.rtx_payload_type()); |
143 } | 142 } |
144 // Check header extensions. | 143 // Check header extensions. |
145 ASSERT_EQ(static_cast<int>(config.rtp.extensions.size()), | 144 ASSERT_EQ(static_cast<int>(config.rtp.extensions.size()), |
146 receiver_config.header_extensions_size()); | 145 receiver_config.header_extensions_size()); |
147 for (int i = 0; i < receiver_config.header_extensions_size(); i++) { | 146 for (int i = 0; i < receiver_config.header_extensions_size(); i++) { |
148 ASSERT_TRUE(receiver_config.header_extensions(i).has_name()); | 147 ASSERT_TRUE(receiver_config.header_extensions(i).has_name()); |
149 ASSERT_TRUE(receiver_config.header_extensions(i).has_id()); | 148 ASSERT_TRUE(receiver_config.header_extensions(i).has_id()); |
150 const std::string& name = receiver_config.header_extensions(i).name(); | 149 const std::string& name = receiver_config.header_extensions(i).name(); |
151 int id = receiver_config.header_extensions(i).id(); | 150 int id = receiver_config.header_extensions(i).id(); |
152 EXPECT_EQ(config.rtp.extensions[i].id, id); | 151 EXPECT_EQ(config.rtp.extensions[i].id, id); |
(...skipping 13 matching lines...) Expand all Loading... |
166 | 165 |
167 // Check consistency of the parser. | 166 // Check consistency of the parser. |
168 VideoReceiveStream::Config parsed_config(nullptr); | 167 VideoReceiveStream::Config parsed_config(nullptr); |
169 parsed_log.GetVideoReceiveConfig(index, &parsed_config); | 168 parsed_log.GetVideoReceiveConfig(index, &parsed_config); |
170 EXPECT_EQ(config.rtp.remote_ssrc, parsed_config.rtp.remote_ssrc); | 169 EXPECT_EQ(config.rtp.remote_ssrc, parsed_config.rtp.remote_ssrc); |
171 EXPECT_EQ(config.rtp.local_ssrc, parsed_config.rtp.local_ssrc); | 170 EXPECT_EQ(config.rtp.local_ssrc, parsed_config.rtp.local_ssrc); |
172 // Check RTCP settings. | 171 // Check RTCP settings. |
173 EXPECT_EQ(config.rtp.rtcp_mode, parsed_config.rtp.rtcp_mode); | 172 EXPECT_EQ(config.rtp.rtcp_mode, parsed_config.rtp.rtcp_mode); |
174 EXPECT_EQ(config.rtp.remb, parsed_config.rtp.remb); | 173 EXPECT_EQ(config.rtp.remb, parsed_config.rtp.remb); |
175 // Check RTX map. | 174 // Check RTX map. |
176 EXPECT_EQ(config.rtp.rtx.size(), parsed_config.rtp.rtx.size()); | 175 EXPECT_EQ(config.rtp.rtx_ssrc, parsed_config.rtp.rtx_ssrc); |
177 for (const auto& kv : config.rtp.rtx) { | 176 EXPECT_EQ(config.rtp.rtx_payload_types.size(), |
178 auto parsed_kv = parsed_config.rtp.rtx.find(kv.first); | 177 parsed_config.rtp.rtx_payload_types.size()); |
| 178 for (const auto& kv : config.rtp.rtx_payload_types) { |
| 179 auto parsed_kv = parsed_config.rtp.rtx_payload_types.find(kv.first); |
179 EXPECT_EQ(kv.first, parsed_kv->first); | 180 EXPECT_EQ(kv.first, parsed_kv->first); |
180 EXPECT_EQ(kv.second.ssrc, parsed_kv->second.ssrc); | 181 EXPECT_EQ(kv.second, parsed_kv->second); |
181 EXPECT_EQ(kv.second.payload_type, parsed_kv->second.payload_type); | |
182 } | 182 } |
183 // Check header extensions. | 183 // Check header extensions. |
184 EXPECT_EQ(config.rtp.extensions.size(), parsed_config.rtp.extensions.size()); | 184 EXPECT_EQ(config.rtp.extensions.size(), parsed_config.rtp.extensions.size()); |
185 for (size_t i = 0; i < parsed_config.rtp.extensions.size(); i++) { | 185 for (size_t i = 0; i < parsed_config.rtp.extensions.size(); i++) { |
186 EXPECT_EQ(config.rtp.extensions[i].uri, | 186 EXPECT_EQ(config.rtp.extensions[i].uri, |
187 parsed_config.rtp.extensions[i].uri); | 187 parsed_config.rtp.extensions[i].uri); |
188 EXPECT_EQ(config.rtp.extensions[i].id, parsed_config.rtp.extensions[i].id); | 188 EXPECT_EQ(config.rtp.extensions[i].id, parsed_config.rtp.extensions[i].id); |
189 } | 189 } |
190 // Check decoders. | 190 // Check decoders. |
191 EXPECT_EQ(config.decoders.size(), parsed_config.decoders.size()); | 191 EXPECT_EQ(config.decoders.size(), parsed_config.decoders.size()); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 486 |
487 void RtcEventLogTestHelper::VerifyLogEndEvent( | 487 void RtcEventLogTestHelper::VerifyLogEndEvent( |
488 const ParsedRtcEventLog& parsed_log, | 488 const ParsedRtcEventLog& parsed_log, |
489 size_t index) { | 489 size_t index) { |
490 const rtclog::Event& event = parsed_log.events_[index]; | 490 const rtclog::Event& event = parsed_log.events_[index]; |
491 ASSERT_TRUE(IsValidBasicEvent(event)); | 491 ASSERT_TRUE(IsValidBasicEvent(event)); |
492 EXPECT_EQ(rtclog::Event::LOG_END, event.type()); | 492 EXPECT_EQ(rtclog::Event::LOG_END, event.type()); |
493 } | 493 } |
494 | 494 |
495 } // namespace webrtc | 495 } // namespace webrtc |
OLD | NEW |