Changeset 240320 in webkit
- Timestamp:
- Jan 22, 2019 8:42:54 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r240251 r240320 1 2019-01-22 Youenn Fablet <youenn@apple.com> 2 3 Resync libwebrtc with latest M72 branch 4 https://bugs.webkit.org/show_bug.cgi?id=193693 5 <rdar://problem/47463803> 6 7 Reviewed by Eric Carlson. 8 9 * web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt: 10 1 11 2019-01-22 Oriol Brufau <obrufau@igalia.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCRtpTransceiver.https-expected.txt
r238182 r240320 9 9 PASS checkAddTransceiverWithSetRemoteOfferNoSend 10 10 PASS checkAddTransceiverBadKind 11 FAIL checkNoMidOffer promise_test: Unhandled rejection with value: object "InvalidAccessError: Failed to set remote offer sdp: The BUNDLE group contains MID:0 matching no m= section." 11 PASS checkNoMidOffer 12 12 PASS checkSetDirection 13 13 PASS checkCurrentDirection -
trunk/Source/ThirdParty/libwebrtc/ChangeLog
r240176 r240320 1 2019-01-22 Youenn Fablet <youenn@apple.com> 2 3 Resync libwebrtc with latest M72 branch 4 https://bugs.webkit.org/show_bug.cgi?id=193693 5 6 Reviewed by Eric Carlson. 7 8 Update libwebrtc up to latest M72 branch to fix some identified issues: 9 - Bad bandwidth estimation in case of multiple transceivers 10 - mid handling for legacy endpoints 11 - msid handling for updating mediastreams accordingly. 12 13 * Source/webrtc/modules/congestion_controller/goog_cc/delay_based_bwe.cc: 14 * Source/webrtc/modules/congestion_controller/goog_cc/delay_based_bwe.h: 15 * Source/webrtc/modules/congestion_controller/goog_cc/goog_cc_network_control.cc: 16 * Source/webrtc/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc: 17 * Source/webrtc/modules/congestion_controller/send_side_congestion_controller_unittest.cc: 18 * Source/webrtc/pc/jsepsessiondescription_unittest.cc: 19 * Source/webrtc/pc/mediasession.cc: 20 * Source/webrtc/pc/mediasession_unittest.cc: 21 * Source/webrtc/pc/peerconnection.cc: 22 * Source/webrtc/pc/peerconnection.h: 23 * Source/webrtc/pc/peerconnection_jsep_unittest.cc: 24 * Source/webrtc/pc/peerconnection_media_unittest.cc: 25 * Source/webrtc/pc/peerconnection_rtp_unittest.cc: 26 * Source/webrtc/pc/sessiondescription.cc: 27 * Source/webrtc/pc/sessiondescription.h: 28 * Source/webrtc/pc/webrtcsdp.cc: 29 * Source/webrtc/pc/webrtcsdp_unittest.cc: 30 * Source/webrtc/system_wrappers/include/metrics.h: 31 * Source/webrtc/video/BUILD.gn: 32 1 33 2019-01-18 Jer Noble <jer.noble@apple.com> 2 34 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/congestion_controller/goog_cc/delay_based_bwe.cc
r238967 r240320 47 47 constexpr double kDefaultTrendlineThresholdGain = 4.0; 48 48 49 constexpr int kMaxConsecutiveFailedLookups = 5;50 51 49 const char kBweWindowSizeInPacketsExperiment[] = 52 50 "WebRTC-BweWindowSizeInPackets"; … … 95 93 trendline_smoothing_coeff_(kDefaultTrendlineSmoothingCoeff), 96 94 trendline_threshold_gain_(kDefaultTrendlineThresholdGain), 97 consecutive_delayed_feedbacks_(0),98 95 prev_bitrate_(DataRate::Zero()), 99 96 prev_state_(BandwidthUsage::kBwNormal) { … … 148 145 149 146 if (delayed_feedback) { 150 Timestamp arrival_time = Timestamp::PlusInfinity(); 151 if (packet_feedback_vector.back().arrival_time_ms > 0) 152 arrival_time = 153 Timestamp::ms(packet_feedback_vector.back().arrival_time_ms); 154 return OnDelayedFeedback(arrival_time); 155 156 } else { 157 consecutive_delayed_feedbacks_ = 0; 158 return MaybeUpdateEstimate(acked_bitrate, probe_bitrate, 159 recovered_from_overuse, at_time); 160 } 161 return Result(); 162 } 163 164 DelayBasedBwe::Result DelayBasedBwe::OnDelayedFeedback(Timestamp receive_time) { 165 ++consecutive_delayed_feedbacks_; 166 if (consecutive_delayed_feedbacks_ >= kMaxConsecutiveFailedLookups) { 167 consecutive_delayed_feedbacks_ = 0; 168 return OnLongFeedbackDelay(receive_time); 169 } 170 return Result(); 171 } 172 173 DelayBasedBwe::Result DelayBasedBwe::OnLongFeedbackDelay( 174 Timestamp arrival_time) { 175 // Estimate should always be valid since a start bitrate always is set in the 176 // Call constructor. An alternative would be to return an empty Result here, 177 // or to estimate the throughput based on the feedback we received. 178 RTC_DCHECK(rate_control_.ValidEstimate()); 179 rate_control_.SetEstimate(rate_control_.LatestEstimate() / 2, arrival_time); 180 Result result; 181 result.updated = true; 182 result.probe = false; 183 result.target_bitrate = rate_control_.LatestEstimate(); 184 RTC_LOG(LS_WARNING) << "Long feedback delay detected, reducing BWE to " 185 << ToString(result.target_bitrate); 186 return result; 147 // TODO(bugs.webrtc.org/10125): Design a better mechanism to safe-guard 148 // against building very large network queues. 149 return Result(); 150 } 151 return MaybeUpdateEstimate(acked_bitrate, probe_bitrate, 152 recovered_from_overuse, at_time); 187 153 } 188 154 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/congestion_controller/goog_cc/delay_based_bwe.h
r238967 r240320 50 50 absl::optional<DataRate> probe_bitrate, 51 51 Timestamp at_time); 52 Result OnDelayedFeedback(Timestamp receive_time);53 52 void OnRttUpdate(TimeDelta avg_rtt); 54 53 bool LatestEstimate(std::vector<uint32_t>* ssrcs, DataRate* bitrate) const; … … 61 60 void IncomingPacketFeedback(const PacketFeedback& packet_feedback, 62 61 Timestamp at_time); 63 Result OnLongFeedbackDelay(Timestamp arrival_time);64 62 Result MaybeUpdateEstimate(absl::optional<DataRate> acked_bitrate, 65 63 absl::optional<DataRate> probe_bitrate, … … 82 80 double trendline_smoothing_coeff_; 83 81 double trendline_threshold_gain_; 84 int consecutive_delayed_feedbacks_;85 82 DataRate prev_bitrate_; 86 83 BandwidthUsage prev_state_; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/congestion_controller/goog_cc/goog_cc_network_control.cc
r238967 r240320 395 395 TransportPacketsFeedback report) { 396 396 if (report.packet_feedbacks.empty()) { 397 DelayBasedBwe::Result result = delay_based_bwe_->OnDelayedFeedback( 398 report.sendless_arrival_times.back()); 399 NetworkControlUpdate update; 400 if (result.updated) { 401 bandwidth_estimation_->UpdateDelayBasedEstimate(report.feedback_time, 402 result.target_bitrate); 403 MaybeTriggerOnNetworkChanged(&update, report.feedback_time); 404 } 405 return update; 397 // TODO(bugs.webrtc.org/10125): Design a better mechanism to safe-guard 398 // against building very large network queues. 399 return NetworkControlUpdate(); 406 400 } 407 401 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/congestion_controller/goog_cc/goog_cc_network_control_unittest.cc
r238967 r240320 192 192 193 193 update = controller_->OnProcessInterval(DefaultInterval()); 194 }195 196 // Estimated bitrate reduced when the feedbacks arrive with such a long delay,197 // that the send-time-history no longer holds the feedbacked packets.198 TEST_F(GoogCcNetworkControllerTest, LongFeedbackDelays) {199 TargetBitrateTrackingSetup();200 const webrtc::PacedPacketInfo kPacingInfo0(0, 5, 2000);201 const webrtc::PacedPacketInfo kPacingInfo1(1, 8, 4000);202 const int64_t kFeedbackTimeoutMs = 60001;203 const int kMaxConsecutiveFailedLookups = 5;204 for (int i = 0; i < kMaxConsecutiveFailedLookups; ++i) {205 std::vector<PacketResult> packets;206 packets.push_back(CreateResult(i * 100, 2 * i * 100, 1500, kPacingInfo0));207 packets.push_back(208 CreateResult(i * 100 + 10, 2 * i * 100 + 10, 1500, kPacingInfo0));209 packets.push_back(210 CreateResult(i * 100 + 20, 2 * i * 100 + 20, 1500, kPacingInfo0));211 packets.push_back(212 CreateResult(i * 100 + 30, 2 * i * 100 + 30, 1500, kPacingInfo1));213 packets.push_back(214 CreateResult(i * 100 + 40, 2 * i * 100 + 40, 1500, kPacingInfo1));215 216 TransportPacketsFeedback feedback;217 for (PacketResult& packet : packets) {218 controller_->OnSentPacket(packet.sent_packet);219 feedback.sendless_arrival_times.push_back(packet.receive_time);220 }221 222 feedback.feedback_time = packets[0].receive_time;223 AdvanceTimeMilliseconds(kFeedbackTimeoutMs);224 SentPacket later_packet;225 later_packet.send_time = Timestamp::ms(kFeedbackTimeoutMs + i * 200 + 40);226 later_packet.size = DataSize::bytes(1500);227 later_packet.pacing_info = kPacingInfo1;228 controller_->OnSentPacket(later_packet);229 230 OnUpdate(controller_->OnTransportPacketsFeedback(feedback));231 }232 OnUpdate(controller_->OnProcessInterval(DefaultInterval()));233 234 EXPECT_EQ(kInitialBitrateKbps / 2, target_bitrate_->kbps());235 236 // Test with feedback that isn't late enough to time out.237 {238 std::vector<PacketResult> packets;239 packets.push_back(CreateResult(100, 200, 1500, kPacingInfo0));240 packets.push_back(CreateResult(110, 210, 1500, kPacingInfo0));241 packets.push_back(CreateResult(120, 220, 1500, kPacingInfo0));242 packets.push_back(CreateResult(130, 230, 1500, kPacingInfo1));243 packets.push_back(CreateResult(140, 240, 1500, kPacingInfo1));244 245 for (const PacketResult& packet : packets)246 controller_->OnSentPacket(packet.sent_packet);247 248 TransportPacketsFeedback feedback;249 feedback.feedback_time = packets[0].receive_time;250 feedback.packet_feedbacks = packets;251 252 AdvanceTimeMilliseconds(kFeedbackTimeoutMs - 1);253 254 SentPacket later_packet;255 later_packet.send_time = Timestamp::ms(kFeedbackTimeoutMs + 240);256 later_packet.size = DataSize::bytes(1500);257 later_packet.pacing_info = kPacingInfo1;258 controller_->OnSentPacket(later_packet);259 260 OnUpdate(controller_->OnTransportPacketsFeedback(feedback));261 }262 194 } 263 195 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/congestion_controller/send_side_congestion_controller_unittest.cc
r238967 r240320 345 345 } 346 346 347 // Estimated bitrate reduced when the feedbacks arrive with such a long delay,348 // that the send-time-history no longer holds the feedbacked packets.349 TEST_F(LegacySendSideCongestionControllerTest, LongFeedbackDelays) {350 TargetBitrateTrackingSetup();351 352 const int64_t kFeedbackTimeoutMs = 60001;353 const int kMaxConsecutiveFailedLookups = 5;354 for (int i = 0; i < kMaxConsecutiveFailedLookups; ++i) {355 std::vector<PacketFeedback> packets;356 packets.push_back(357 PacketFeedback(i * 100, 2 * i * 100, 0, 1500, kPacingInfo0));358 packets.push_back(359 PacketFeedback(i * 100 + 10, 2 * i * 100 + 10, 1, 1500, kPacingInfo0));360 packets.push_back(361 PacketFeedback(i * 100 + 20, 2 * i * 100 + 20, 2, 1500, kPacingInfo0));362 packets.push_back(363 PacketFeedback(i * 100 + 30, 2 * i * 100 + 30, 3, 1500, kPacingInfo1));364 packets.push_back(365 PacketFeedback(i * 100 + 40, 2 * i * 100 + 40, 4, 1500, kPacingInfo1));366 367 for (const PacketFeedback& packet : packets)368 OnSentPacket(packet);369 370 rtcp::TransportFeedback feedback;371 feedback.SetBase(packets[0].sequence_number,372 packets[0].arrival_time_ms * 1000);373 374 for (const PacketFeedback& packet : packets) {375 EXPECT_TRUE(feedback.AddReceivedPacket(packet.sequence_number,376 packet.arrival_time_ms * 1000));377 }378 379 feedback.Build();380 381 clock_.AdvanceTimeMilliseconds(kFeedbackTimeoutMs);382 PacketFeedback later_packet(kFeedbackTimeoutMs + i * 100 + 40,383 kFeedbackTimeoutMs + i * 200 + 40, 5, 1500,384 kPacingInfo1);385 OnSentPacket(later_packet);386 387 controller_->OnTransportFeedback(feedback);388 389 // Check that packets have timed out.390 for (PacketFeedback& packet : packets) {391 packet.send_time_ms = PacketFeedback::kNoSendTime;392 packet.payload_size = 0;393 packet.pacing_info = PacedPacketInfo();394 }395 ComparePacketFeedbackVectors(packets,396 controller_->GetTransportFeedbackVector());397 }398 399 controller_->Process();400 401 EXPECT_EQ(kInitialBitrateBps / 2, target_bitrate_bps_);402 403 // Test with feedback that isn't late enough to time out.404 {405 std::vector<PacketFeedback> packets;406 packets.push_back(PacketFeedback(100, 200, 0, 1500, kPacingInfo0));407 packets.push_back(PacketFeedback(110, 210, 1, 1500, kPacingInfo0));408 packets.push_back(PacketFeedback(120, 220, 2, 1500, kPacingInfo0));409 packets.push_back(PacketFeedback(130, 230, 3, 1500, kPacingInfo1));410 packets.push_back(PacketFeedback(140, 240, 4, 1500, kPacingInfo1));411 412 for (const PacketFeedback& packet : packets)413 OnSentPacket(packet);414 415 rtcp::TransportFeedback feedback;416 feedback.SetBase(packets[0].sequence_number,417 packets[0].arrival_time_ms * 1000);418 419 for (const PacketFeedback& packet : packets) {420 EXPECT_TRUE(feedback.AddReceivedPacket(packet.sequence_number,421 packet.arrival_time_ms * 1000));422 }423 424 feedback.Build();425 426 clock_.AdvanceTimeMilliseconds(kFeedbackTimeoutMs - 1);427 PacketFeedback later_packet(kFeedbackTimeoutMs + 140,428 kFeedbackTimeoutMs + 240, 5, 1500,429 kPacingInfo1);430 OnSentPacket(later_packet);431 432 controller_->OnTransportFeedback(feedback);433 ComparePacketFeedbackVectors(packets,434 controller_->GetTransportFeedbackVector());435 }436 }437 438 347 // Bandwidth estimation is updated when feedbacks are received. 439 348 // Feedbacks which show an increasing delay cause the estimation to be reduced. -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/jsepsessiondescription_unittest.cc
r235230 r240320 61 61 desc->AddContent(cricket::CN_VIDEO, MediaProtocolType::kRtp, video.release()); 62 62 63 EXPECT_TRUE(desc->AddTransportInfo(cricket::TransportInfo(63 desc->AddTransportInfo(cricket::TransportInfo( 64 64 cricket::CN_AUDIO, 65 65 cricket::TransportDescription( 66 66 std::vector<std::string>(), kCandidateUfragVoice, kCandidatePwdVoice, 67 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, NULL))) );68 EXPECT_TRUE(desc->AddTransportInfo(cricket::TransportInfo(67 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, NULL))); 68 desc->AddTransportInfo(cricket::TransportInfo( 69 69 cricket::CN_VIDEO, 70 70 cricket::TransportDescription( 71 71 std::vector<std::string>(), kCandidateUfragVideo, kCandidatePwdVideo, 72 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, NULL))) );72 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, NULL))); 73 73 return desc; 74 74 } -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/mediasession.cc
r239136 r240320 1800 1800 transport_desc_factory_->CreateOffer(transport_options, current_tdesc, 1801 1801 ice_credentials)); 1802 bool ret = 1803 (new_tdesc.get() != NULL && 1804 offer_desc->AddTransportInfo(TransportInfo(content_name, *new_tdesc))); 1805 if (!ret) { 1802 if (!new_tdesc) { 1806 1803 RTC_LOG(LS_ERROR) << "Failed to AddTransportOffer, content name=" 1807 1804 << content_name; 1808 1805 } 1809 return ret; 1806 offer_desc->AddTransportInfo(TransportInfo(content_name, *new_tdesc)); 1807 return true; 1810 1808 } 1811 1809 … … 1832 1830 const TransportDescription& transport_desc, 1833 1831 SessionDescription* answer_desc) const { 1834 if (!answer_desc->AddTransportInfo( 1835 TransportInfo(content_name, transport_desc))) { 1836 RTC_LOG(LS_ERROR) << "Failed to AddTransportAnswer, content name=" 1837 << content_name; 1838 return false; 1839 } 1832 answer_desc->AddTransportInfo(TransportInfo(content_name, transport_desc)); 1840 1833 return true; 1841 1834 } -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/mediasession_unittest.cc
r239136 r240320 427 427 if (has_current_desc) { 428 428 current_desc.reset(new SessionDescription()); 429 EXPECT_TRUE(current_desc->AddTransportInfo(TransportInfo(429 current_desc->AddTransportInfo(TransportInfo( 430 430 "audio", 431 TransportDescription(current_audio_ufrag, current_audio_pwd))) );432 EXPECT_TRUE(current_desc->AddTransportInfo(TransportInfo(431 TransportDescription(current_audio_ufrag, current_audio_pwd))); 432 current_desc->AddTransportInfo(TransportInfo( 433 433 "video", 434 TransportDescription(current_video_ufrag, current_video_pwd))) );435 EXPECT_TRUE(current_desc->AddTransportInfo(TransportInfo(436 "data", TransportDescription(current_data_ufrag, current_data_pwd))) );434 TransportDescription(current_video_ufrag, current_video_pwd))); 435 current_desc->AddTransportInfo(TransportInfo( 436 "data", TransportDescription(current_data_ufrag, current_data_pwd))); 437 437 } 438 438 if (offer) { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection.cc
r240053 r240320 648 648 } 649 649 return DataMessageType::kControl; 650 } 651 652 // Find a new MID that is not already in |used_mids|, then add it to |used_mids| 653 // and return a reference to it. 654 // Generated MIDs should be no more than 3 bytes long to take up less space in 655 // the RTP packet. 656 const std::string& AllocateMid(std::set<std::string>* used_mids) { 657 RTC_DCHECK(used_mids); 658 // We're boring: just generate MIDs 0, 1, 2, ... 659 size_t i = 0; 660 std::set<std::string>::iterator it; 661 bool inserted; 662 do { 663 std::string mid = rtc::ToString(i++); 664 auto insert_result = used_mids->insert(mid); 665 it = insert_result.first; 666 inserted = insert_result.second; 667 } while (!inserted); 668 return *it; 650 669 } 651 670 … … 2232 2251 } 2233 2252 2253 // The SDP parser used to populate these values by default for the 'content 2254 // name' if an a=mid line was absent. 2255 static absl::string_view GetDefaultMidForPlanB(cricket::MediaType media_type) { 2256 switch (media_type) { 2257 case cricket::MEDIA_TYPE_AUDIO: 2258 return cricket::CN_AUDIO; 2259 case cricket::MEDIA_TYPE_VIDEO: 2260 return cricket::CN_VIDEO; 2261 case cricket::MEDIA_TYPE_DATA: 2262 return cricket::CN_DATA; 2263 } 2264 RTC_NOTREACHED(); 2265 return ""; 2266 } 2267 2268 void PeerConnection::FillInMissingRemoteMids( 2269 cricket::SessionDescription* remote_description) { 2270 RTC_DCHECK(remote_description); 2271 const cricket::ContentInfos& local_contents = 2272 (local_description() ? local_description()->description()->contents() 2273 : cricket::ContentInfos()); 2274 std::set<std::string> used_mids = seen_mids_; 2275 for (size_t i = 0; i < remote_description->contents().size(); ++i) { 2276 cricket::ContentInfo& content = remote_description->contents()[i]; 2277 if (!content.name.empty()) { 2278 continue; 2279 } 2280 absl::string_view new_mid; 2281 absl::string_view source_explanation; 2282 if (IsUnifiedPlan()) { 2283 if (i < local_contents.size()) { 2284 new_mid = local_contents[i].name; 2285 source_explanation = "from the matching local media section"; 2286 } else { 2287 new_mid = AllocateMid(&used_mids); 2288 source_explanation = "generated just now"; 2289 } 2290 } else { 2291 new_mid = GetDefaultMidForPlanB(content.media_description()->type()); 2292 source_explanation = "to match pre-existing behavior"; 2293 } 2294 content.name = std::string(new_mid); 2295 remote_description->transport_infos()[i].content_name = 2296 std::string(new_mid); 2297 RTC_LOG(LS_INFO) << "SetRemoteDescription: Remote media section at i=" << i 2298 << " is missing an a=mid line. Filling in the value '" 2299 << new_mid << "' " << source_explanation << "."; 2300 } 2301 } 2302 2234 2303 void PeerConnection::SetRemoteDescription( 2235 2304 SetSessionDescriptionObserver* observer, … … 2271 2340 ReportSdpFormatReceived(*desc); 2272 2341 } 2342 2343 // Handle remote descriptions missing a=mid lines for interop with legacy end 2344 // points. 2345 FillInMissingRemoteMids(desc->description()); 2273 2346 2274 2347 RTCError error = ValidateSessionDescription(desc.get(), cricket::CS_REMOTE); … … 2457 2530 RtpTransceiverDirection local_direction = 2458 2531 RtpTransceiverDirectionReversed(media_desc->direction()); 2459 // From the WebRTC specification, steps 2.2.8.5/6 of section 4.4.1.6 "Set 2460 // the RTCSessionDescription: If direction is sendrecv or recvonly, and 2461 // transceiver's current direction is neither sendrecv nor recvonly, 2462 // process the addition of a remote track for the media description. 2463 std::vector<std::string> stream_ids; 2464 if (!media_desc->streams().empty()) { 2465 // The remote description has signaled the stream IDs. 2466 stream_ids = media_desc->streams()[0].stream_ids(); 2467 } 2468 if (RtpTransceiverDirectionHasRecv(local_direction) && 2469 (!transceiver->fired_direction() || 2470 !RtpTransceiverDirectionHasRecv(*transceiver->fired_direction()))) { 2471 RTC_LOG(LS_INFO) << "Processing the addition of a new track for MID=" 2472 << content->name << " (added to " 2473 << GetStreamIdsString(stream_ids) << ")."; 2474 2475 std::vector<rtc::scoped_refptr<MediaStreamInterface>> media_streams; 2476 for (const std::string& stream_id : stream_ids) { 2477 rtc::scoped_refptr<MediaStreamInterface> stream = 2478 remote_streams_->find(stream_id); 2479 if (!stream) { 2480 stream = MediaStreamProxy::Create(rtc::Thread::Current(), 2481 MediaStream::Create(stream_id)); 2482 remote_streams_->AddStream(stream); 2483 added_streams.push_back(stream); 2484 } 2485 media_streams.push_back(stream); 2532 // Roughly the same as steps 2.2.8.6 of section 4.4.1.6 "Set the 2533 // RTCSessionDescription: Set the associated remote streams given 2534 // transceiver.[[Receiver]], msids, addList, and removeList". 2535 // https://w3c.github.io/webrtc-pc/#set-the-rtcsessiondescription 2536 if (RtpTransceiverDirectionHasRecv(local_direction)) { 2537 std::vector<std::string> stream_ids; 2538 if (!media_desc->streams().empty()) { 2539 // The remote description has signaled the stream IDs. 2540 stream_ids = media_desc->streams()[0].stream_ids(); 2486 2541 } 2487 // Special case: "a=msid" missing, use random stream ID. 2488 if (media_streams.empty() && 2489 !(remote_description()->description()->msid_signaling() & 2490 cricket::kMsidSignalingMediaSection)) { 2491 if (!missing_msid_default_stream_) { 2492 missing_msid_default_stream_ = MediaStreamProxy::Create( 2493 rtc::Thread::Current(), 2494 MediaStream::Create(rtc::CreateRandomUuid())); 2495 added_streams.push_back(missing_msid_default_stream_); 2496 } 2497 media_streams.push_back(missing_msid_default_stream_); 2542 RTC_LOG(LS_INFO) << "Processing the MSIDs for MID=" << content->name 2543 << " (" << GetStreamIdsString(stream_ids) << ")."; 2544 SetAssociatedRemoteStreams(transceiver->internal()->receiver_internal(), 2545 stream_ids, &added_streams, 2546 &removed_streams); 2547 // From the WebRTC specification, steps 2.2.8.5/6 of section 4.4.1.6 2548 // "Set the RTCSessionDescription: If direction is sendrecv or recvonly, 2549 // and transceiver's current direction is neither sendrecv nor recvonly, 2550 // process the addition of a remote track for the media description. 2551 if (!transceiver->fired_direction() || 2552 !RtpTransceiverDirectionHasRecv(*transceiver->fired_direction())) { 2553 RTC_LOG(LS_INFO) 2554 << "Processing the addition of a remote track for MID=" 2555 << content->name << "."; 2556 now_receiving_transceivers.push_back(transceiver); 2498 2557 } 2499 // This will add the remote track to the streams.2500 // TODO(hbos): When we remove remote_streams(), use set_stream_ids()2501 // instead. https://crbug.com/webrtc/94802502 transceiver->internal()->receiver_internal()->SetStreams(media_streams);2503 now_receiving_transceivers.push_back(transceiver);2504 2558 } 2505 2559 // 2.2.8.1.7: If direction is "sendonly" or "inactive", and transceiver's … … 2644 2698 } 2645 2699 2700 void PeerConnection::SetAssociatedRemoteStreams( 2701 rtc::scoped_refptr<RtpReceiverInternal> receiver, 2702 const std::vector<std::string>& stream_ids, 2703 std::vector<rtc::scoped_refptr<MediaStreamInterface>>* added_streams, 2704 std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams) { 2705 std::vector<rtc::scoped_refptr<MediaStreamInterface>> media_streams; 2706 for (const std::string& stream_id : stream_ids) { 2707 rtc::scoped_refptr<MediaStreamInterface> stream = 2708 remote_streams_->find(stream_id); 2709 if (!stream) { 2710 stream = MediaStreamProxy::Create(rtc::Thread::Current(), 2711 MediaStream::Create(stream_id)); 2712 remote_streams_->AddStream(stream); 2713 added_streams->push_back(stream); 2714 } 2715 media_streams.push_back(stream); 2716 } 2717 // Special case: "a=msid" missing, use random stream ID. 2718 if (media_streams.empty() && 2719 !(remote_description()->description()->msid_signaling() & 2720 cricket::kMsidSignalingMediaSection)) { 2721 if (!missing_msid_default_stream_) { 2722 missing_msid_default_stream_ = MediaStreamProxy::Create( 2723 rtc::Thread::Current(), MediaStream::Create(rtc::CreateRandomUuid())); 2724 added_streams->push_back(missing_msid_default_stream_); 2725 } 2726 media_streams.push_back(missing_msid_default_stream_); 2727 } 2728 std::vector<rtc::scoped_refptr<MediaStreamInterface>> previous_streams = 2729 receiver->streams(); 2730 // SetStreams() will add/remove the receiver's track to/from the streams. This 2731 // differs from the spec - the spec uses an "addList" and "removeList" to 2732 // update the stream-track relationships in a later step. We do this earlier, 2733 // changing the order of things, but the end-result is the same. 2734 // TODO(hbos): When we remove remote_streams(), use set_stream_ids() 2735 // instead. https://crbug.com/webrtc/9480 2736 receiver->SetStreams(media_streams); 2737 RemoveRemoteStreamsIfEmpty(previous_streams, removed_streams); 2738 } 2739 2646 2740 void PeerConnection::ProcessRemovalOfRemoteTrack( 2647 2741 rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>> … … 2652 2746 RTC_LOG(LS_INFO) << "Processing the removal of a track for MID=" 2653 2747 << *transceiver->mid(); 2654 std::vector<rtc::scoped_refptr<MediaStreamInterface>> media_streams =2748 std::vector<rtc::scoped_refptr<MediaStreamInterface>> previous_streams = 2655 2749 transceiver->internal()->receiver_internal()->streams(); 2656 2750 // This will remove the remote track from the streams. 2657 2751 transceiver->internal()->receiver_internal()->set_stream_ids({}); 2658 2752 remove_list->push_back(transceiver); 2659 // Remove any streams that no longer have tracks. 2660 // TODO(https://crbug.com/webrtc/9480): When we use stream IDs instead 2661 // of streams, see if the stream was removed by checking if this was the 2662 // last receiver with that stream ID. 2663 for (const auto& stream : media_streams) { 2664 if (stream->GetAudioTracks().empty() && stream->GetVideoTracks().empty()) { 2665 remote_streams_->RemoveStream(stream); 2666 removed_streams->push_back(stream); 2753 RemoveRemoteStreamsIfEmpty(previous_streams, removed_streams); 2754 } 2755 2756 void PeerConnection::RemoveRemoteStreamsIfEmpty( 2757 const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& remote_streams, 2758 std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams) { 2759 // TODO(https://crbug.com/webrtc/9480): When we use stream IDs instead of 2760 // streams, see if the stream was removed by checking if this was the last 2761 // receiver with that stream ID. 2762 for (auto remote_stream : remote_streams) { 2763 if (remote_stream->GetAudioTracks().empty() && 2764 remote_stream->GetVideoTracks().empty()) { 2765 remote_streams_->RemoveStream(remote_stream); 2766 removed_streams->push_back(remote_stream); 2667 2767 } 2668 2768 } … … 3907 4007 video_media_description_options, 3908 4008 offer_answer_options.num_simulcast_layers); 3909 }3910 3911 // Find a new MID that is not already in |used_mids|, then add it to |used_mids|3912 // and return a reference to it.3913 // Generated MIDs should be no more than 3 bytes long to take up less space in3914 // the RTP packet.3915 static const std::string& AllocateMid(std::set<std::string>* used_mids) {3916 RTC_DCHECK(used_mids);3917 // We're boring: just generate MIDs 0, 1, 2, ...3918 size_t i = 0;3919 std::set<std::string>::iterator it;3920 bool inserted;3921 do {3922 std::string mid = rtc::ToString(i++);3923 auto insert_result = used_mids->insert(mid);3924 it = insert_result.first;3925 inserted = insert_result.second;3926 } while (!inserted);3927 return *it;3928 4009 } 3929 4010 … … 6087 6168 } 6088 6169 6170 static RTCError ValidateMids(const cricket::SessionDescription& description) { 6171 std::set<std::string> mids; 6172 for (const cricket::ContentInfo& content : description.contents()) { 6173 if (content.name.empty()) { 6174 LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER, 6175 "A media section is missing a MID attribute."); 6176 } 6177 if (!mids.insert(content.name).second) { 6178 LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER, 6179 "Duplicate a=mid value '" + content.name + "'."); 6180 } 6181 } 6182 return RTCError::OK(); 6183 } 6184 6089 6185 RTCError PeerConnection::ValidateSessionDescription( 6090 6186 const SessionDescriptionInterface* sdesc, … … 6104 6200 RTCErrorType::INVALID_STATE, 6105 6201 "Called in wrong state: " + GetSignalingStateString(signaling_state())); 6202 } 6203 6204 RTCError error = ValidateMids(*sdesc->description()); 6205 if (!error.ok()) { 6206 return error; 6106 6207 } 6107 6208 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection.h
r239396 r240320 473 473 const SessionDescriptionInterface* sdesc) const; 474 474 475 // Runs the algorithm **set the associated remote streams** specified in 476 // https://w3c.github.io/webrtc-pc/#set-associated-remote-streams. 477 void SetAssociatedRemoteStreams( 478 rtc::scoped_refptr<RtpReceiverInternal> receiver, 479 const std::vector<std::string>& stream_ids, 480 std::vector<rtc::scoped_refptr<MediaStreamInterface>>* added_streams, 481 std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams); 482 475 483 // Runs the algorithm **process the removal of a remote track** specified in 476 484 // the WebRTC specification. … … 487 495 std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams); 488 496 497 void RemoveRemoteStreamsIfEmpty( 498 const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& 499 remote_streams, 500 std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams); 501 489 502 void OnNegotiationNeeded(); 490 503 … … 649 662 return configuration_.sdp_semantics == SdpSemantics::kUnifiedPlan; 650 663 } 664 665 // The offer/answer machinery assumes the media section MID is present and 666 // unique. To support legacy end points that do not supply a=mid lines, this 667 // method will modify the session description to add MIDs generated according 668 // to the SDP semantics. 669 void FillInMissingRemoteMids(cricket::SessionDescription* remote_description); 651 670 652 671 // Is there an RtpSender of the given type? -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection_jsep_unittest.cc
r239136 r240320 1605 1605 } 1606 1606 1607 // Removes the RTP header extension associated with the given URI from the media 1608 // description. 1609 static void RemoveRtpHeaderExtensionByUri( 1610 MediaContentDescription* media_description, 1611 absl::string_view uri) { 1612 std::vector<RtpExtension> header_extensions = 1613 media_description->rtp_header_extensions(); 1614 header_extensions.erase(std::remove_if( 1615 header_extensions.begin(), header_extensions.end(), 1616 [uri](const RtpExtension& extension) { return extension.uri == uri; })); 1617 media_description->set_rtp_header_extensions(header_extensions); 1618 } 1619 1620 // Transforms a session description to emulate a legacy endpoint which does not 1621 // support a=mid, BUNDLE, and the MID header extension. 1622 static void ClearMids(SessionDescriptionInterface* sdesc) { 1623 cricket::SessionDescription* desc = sdesc->description(); 1624 desc->RemoveGroupByName(cricket::GROUP_TYPE_BUNDLE); 1625 cricket::ContentInfo* audio_content = cricket::GetFirstAudioContent(desc); 1626 if (audio_content) { 1627 desc->GetTransportInfoByName(audio_content->name)->content_name = ""; 1628 audio_content->name = ""; 1629 RemoveRtpHeaderExtensionByUri(audio_content->media_description(), 1630 RtpExtension::kMidUri); 1631 } 1632 cricket::ContentInfo* video_content = cricket::GetFirstVideoContent(desc); 1633 if (video_content) { 1634 desc->GetTransportInfoByName(video_content->name)->content_name = ""; 1635 video_content->name = ""; 1636 RemoveRtpHeaderExtensionByUri(video_content->media_description(), 1637 RtpExtension::kMidUri); 1638 } 1639 } 1640 1641 // Test that negotiation works with legacy endpoints which do not support a=mid. 1642 TEST_F(PeerConnectionJsepTest, LegacyNoMidAudioOnlyOffer) { 1643 auto caller = CreatePeerConnection(); 1644 caller->AddAudioTrack("audio"); 1645 auto callee = CreatePeerConnection(); 1646 callee->AddAudioTrack("audio"); 1647 1648 auto offer = caller->CreateOffer(); 1649 ClearMids(offer.get()); 1650 1651 ASSERT_TRUE(callee->SetRemoteDescription(std::move(offer))); 1652 EXPECT_TRUE(callee->SetLocalDescription(callee->CreateAnswer())); 1653 } 1654 TEST_F(PeerConnectionJsepTest, LegacyNoMidAudioVideoOffer) { 1655 auto caller = CreatePeerConnection(); 1656 caller->AddAudioTrack("audio"); 1657 caller->AddVideoTrack("video"); 1658 auto callee = CreatePeerConnection(); 1659 callee->AddAudioTrack("audio"); 1660 callee->AddVideoTrack("video"); 1661 1662 auto offer = caller->CreateOffer(); 1663 ClearMids(offer.get()); 1664 1665 ASSERT_TRUE(callee->SetRemoteDescription(std::move(offer))); 1666 EXPECT_TRUE(callee->SetLocalDescription(callee->CreateAnswer())); 1667 } 1668 TEST_F(PeerConnectionJsepTest, LegacyNoMidAudioOnlyAnswer) { 1669 auto caller = CreatePeerConnection(); 1670 caller->AddAudioTrack("audio"); 1671 auto callee = CreatePeerConnection(); 1672 callee->AddAudioTrack("audio"); 1673 1674 ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal())); 1675 1676 auto answer = callee->CreateAnswer(); 1677 ClearMids(answer.get()); 1678 1679 EXPECT_TRUE(caller->SetRemoteDescription(std::move(answer))); 1680 } 1681 TEST_F(PeerConnectionJsepTest, LegacyNoMidAudioVideoAnswer) { 1682 auto caller = CreatePeerConnection(); 1683 caller->AddAudioTrack("audio"); 1684 caller->AddVideoTrack("video"); 1685 auto callee = CreatePeerConnection(); 1686 callee->AddAudioTrack("audio"); 1687 callee->AddVideoTrack("video"); 1688 1689 ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal())); 1690 1691 auto answer = callee->CreateAnswer(); 1692 ClearMids(answer.get()); 1693 1694 ASSERT_TRUE(caller->SetRemoteDescription(std::move(answer))); 1695 } 1696 1697 // Test that SetLocalDescription fails if a=mid lines are missing. 1698 TEST_F(PeerConnectionJsepTest, SetLocalDescriptionFailsMissingMid) { 1699 auto caller = CreatePeerConnection(); 1700 caller->AddAudioTrack("audio"); 1701 1702 auto offer = caller->CreateOffer(); 1703 ClearMids(offer.get()); 1704 1705 std::string error; 1706 ASSERT_FALSE(caller->SetLocalDescription(std::move(offer), &error)); 1707 EXPECT_EQ( 1708 "Failed to set local offer sdp: A media section is missing a MID " 1709 "attribute.", 1710 error); 1711 } 1712 1607 1713 } // namespace webrtc -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection_media_unittest.cc
r238967 r240320 1085 1085 } 1086 1086 1087 // Test that SetRemoteDescription returns an error if there are two m= sections 1088 // with the same MID value. 1089 TEST_P(PeerConnectionMediaTest, SetRemoteDescriptionFailsWithDuplicateMids) { 1090 auto caller = CreatePeerConnectionWithAudioVideo(); 1091 auto callee = CreatePeerConnectionWithAudioVideo(); 1092 1093 auto offer = caller->CreateOffer(); 1094 RenameContent(offer->description(), cricket::MEDIA_TYPE_AUDIO, "same"); 1095 RenameContent(offer->description(), cricket::MEDIA_TYPE_VIDEO, "same"); 1096 1097 std::string error; 1098 EXPECT_FALSE(callee->SetRemoteDescription(std::move(offer), &error)); 1099 EXPECT_EQ(error, 1100 "Failed to set remote offer sdp: Duplicate a=mid value 'same'."); 1101 } 1102 1087 1103 TEST_P(PeerConnectionMediaTest, 1088 1104 CombinedAudioVideoBweConfigPropagatedToMediaEngine) { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/peerconnection_rtp_unittest.cc
r238967 r240320 456 456 } 457 457 458 TEST_F(PeerConnectionRtpTestUnifiedPlan, ChangeMsidWhileReceiving) { 459 auto caller = CreatePeerConnection(); 460 caller->AddAudioTrack("audio_track", {"stream1"}); 461 auto callee = CreatePeerConnection(); 462 ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOffer())); 463 464 ASSERT_EQ(1u, callee->observer()->on_track_transceivers_.size()); 465 auto transceiver = callee->observer()->on_track_transceivers_[0]; 466 ASSERT_EQ(1u, transceiver->receiver()->streams().size()); 467 EXPECT_EQ("stream1", transceiver->receiver()->streams()[0]->id()); 468 469 ASSERT_TRUE(callee->SetLocalDescription(callee->CreateAnswer())); 470 471 // Change the stream ID in the offer. 472 // TODO(https://crbug.com/webrtc/10129): When RtpSenderInterface::SetStreams 473 // is supported, this can use that instead of munging the SDP. 474 auto offer = caller->CreateOffer(); 475 auto contents = offer->description()->contents(); 476 ASSERT_EQ(1u, contents.size()); 477 auto& stream_params = contents[0].media_description()->mutable_streams(); 478 ASSERT_EQ(1u, stream_params.size()); 479 stream_params[0].set_stream_ids({"stream2"}); 480 ASSERT_TRUE(callee->SetRemoteDescription(std::move(offer))); 481 ASSERT_EQ(1u, transceiver->receiver()->streams().size()); 482 EXPECT_EQ("stream2", transceiver->receiver()->streams()[0]->id()); 483 } 484 458 485 // These tests examine the state of the peer connection as a result of 459 486 // performing SetRemoteDescription(). -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/sessiondescription.cc
r238967 r240320 197 197 } 198 198 199 bool SessionDescription::AddTransportInfo(const TransportInfo& transport_info) { 200 if (GetTransportInfoByName(transport_info.content_name) != NULL) { 201 return false; 202 } 199 void SessionDescription::AddTransportInfo(const TransportInfo& transport_info) { 203 200 transport_infos_.push_back(transport_info); 204 return true;205 201 } 206 202 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/sessiondescription.h
r238967 r240320 448 448 } 449 449 // Adds a TransportInfo to this description. 450 // Returns false if a TransportInfo with the same name already exists. 451 bool AddTransportInfo(const TransportInfo& transport_info); 450 void AddTransportInfo(const TransportInfo& transport_info); 452 451 bool RemoveTransportInfoByName(const std::string& name); 453 452 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/webrtcsdp.cc
r238967 r240320 2364 2364 webrtc::SdpParseError* error) { 2365 2365 C* media_desc = new C(); 2366 switch (media_type) {2367 case cricket::MEDIA_TYPE_AUDIO:2368 *content_name = cricket::CN_AUDIO;2369 break;2370 case cricket::MEDIA_TYPE_VIDEO:2371 *content_name = cricket::CN_VIDEO;2372 break;2373 case cricket::MEDIA_TYPE_DATA:2374 *content_name = cricket::CN_DATA;2375 break;2376 default:2377 RTC_NOTREACHED();2378 break;2379 }2380 2366 if (!ParseContent(message, media_type, mline_index, protocol, payload_types, 2381 2367 pos, content_name, bundle_only, msid_signaling, media_desc, … … 2560 2546 content_rejected, bundle_only, content.release()); 2561 2547 // Create TransportInfo with the media level "ice-pwd" and "ice-ufrag". 2562 TransportInfo transport_info(content_name, transport); 2563 2564 if (!desc->AddTransportInfo(transport_info)) { 2565 rtc::StringBuilder description; 2566 description << "Failed to AddTransportInfo with content name: " 2567 << content_name; 2568 return ParseFailed("", description.str(), error); 2569 } 2548 desc->AddTransportInfo(TransportInfo(content_name, transport)); 2570 2549 } 2571 2550 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/pc/webrtcsdp_unittest.cc
r239396 r240320 26 26 #include "rtc_base/stringencode.h" 27 27 #include "rtc_base/stringutils.h" 28 #include "test/gmock.h" 29 #include "test/gtest.h" 28 30 29 31 #ifdef WEBRTC_ANDROID … … 35 37 using cricket::AudioContentDescription; 36 38 using cricket::Candidate; 39 using cricket::ContentGroup; 37 40 using cricket::ContentInfo; 38 41 using cricket::CryptoParams; 39 using cricket::ContentGroup;40 42 using cricket::DataCodec; 41 43 using cricket::DataContentDescription; … … 44 46 using cricket::kFecSsrcGroupSemantics; 45 47 using cricket::LOCAL_PORT_TYPE; 48 using cricket::MediaProtocolType; 46 49 using cricket::RELAY_PORT_TYPE; 47 50 using cricket::SessionDescription; 48 using cricket::MediaProtocolType;49 51 using cricket::StreamParams; 50 52 using cricket::STUN_PORT_TYPE; … … 53 55 using cricket::VideoCodec; 54 56 using cricket::VideoContentDescription; 57 using ::testing::ElementsAre; 58 using ::testing::Field; 55 59 using webrtc::IceCandidateCollection; 56 60 using webrtc::IceCandidateInterface; … … 916 920 917 921 // TransportInfo 918 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(919 kAudioContentName, TransportDescription(kUfragVoice, kPwdVoice))) );920 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(921 kVideoContentName, TransportDescription(kUfragVideo, kPwdVideo))) );922 desc_.AddTransportInfo(TransportInfo( 923 kAudioContentName, TransportDescription(kUfragVoice, kPwdVoice))); 924 desc_.AddTransportInfo(TransportInfo( 925 kVideoContentName, TransportDescription(kUfragVideo, kPwdVideo))); 922 926 923 927 // v4 host … … 1113 1117 audio_desc_2->AddStream(audio_track_2); 1114 1118 desc_.AddContent(kAudioContentName2, MediaProtocolType::kRtp, audio_desc_2); 1115 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(1116 kAudioContentName2, TransportDescription(kUfragVoice2, kPwdVoice2))) );1119 desc_.AddTransportInfo(TransportInfo( 1120 kAudioContentName2, TransportDescription(kUfragVoice2, kPwdVoice2))); 1117 1121 // Video track 2, in stream 2. 1118 1122 VideoContentDescription* video_desc_2 = CreateVideoContentDescription(); … … 1124 1128 video_desc_2->AddStream(video_track_2); 1125 1129 desc_.AddContent(kVideoContentName2, MediaProtocolType::kRtp, video_desc_2); 1126 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(1127 kVideoContentName2, TransportDescription(kUfragVideo2, kPwdVideo2))) );1130 desc_.AddTransportInfo(TransportInfo( 1131 kVideoContentName2, TransportDescription(kUfragVideo2, kPwdVideo2))); 1128 1132 1129 1133 // Video track 3, in stream 2. … … 1136 1140 video_desc_3->AddStream(video_track_3); 1137 1141 desc_.AddContent(kVideoContentName3, MediaProtocolType::kRtp, video_desc_3); 1138 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(1139 kVideoContentName3, TransportDescription(kUfragVideo3, kPwdVideo3))) );1142 desc_.AddTransportInfo(TransportInfo( 1143 kVideoContentName3, TransportDescription(kUfragVideo3, kPwdVideo3))); 1140 1144 desc_.set_msid_signaling(cricket::kMsidSignalingMediaSection); 1141 1145 … … 1180 1184 audio_desc_2->AddStream(audio_track_2); 1181 1185 desc_.AddContent(kAudioContentName2, MediaProtocolType::kRtp, audio_desc_2); 1182 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(1183 kAudioContentName2, TransportDescription(kUfragVoice2, kPwdVoice2))) );1186 desc_.AddTransportInfo(TransportInfo( 1187 kAudioContentName2, TransportDescription(kUfragVoice2, kPwdVoice2))); 1184 1188 1185 1189 // Audio track 3 has no stream ids. … … 1192 1196 audio_desc_3->AddStream(audio_track_3); 1193 1197 desc_.AddContent(kAudioContentName3, MediaProtocolType::kRtp, audio_desc_3); 1194 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(1195 kAudioContentName3, TransportDescription(kUfragVoice3, kPwdVoice3))) );1198 desc_.AddTransportInfo(TransportInfo( 1199 kAudioContentName3, TransportDescription(kUfragVoice3, kPwdVoice3))); 1196 1200 desc_.set_msid_signaling(msid_signaling); 1197 1201 ASSERT_TRUE(jdesc_.Initialize(desc_.Copy(), jdesc_.session_id(), … … 1465 1469 const_cast<SessionDescription*>(jdesc->description()); 1466 1470 desc->RemoveTransportInfoByName(content_name); 1467 EXPECT_TRUE(desc->AddTransportInfo(transport_info));1471 desc->AddTransportInfo(transport_info); 1468 1472 for (size_t i = 0; i < jdesc_.number_of_mediasections(); ++i) { 1469 1473 const IceCandidateCollection* cc = jdesc_.candidates(i); … … 1504 1508 desc_.RemoveTransportInfoByName(kVideoContentName); 1505 1509 rtc::SSLFingerprint fingerprint(rtc::DIGEST_SHA_1, kIdentityDigest); 1506 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(1510 desc_.AddTransportInfo(TransportInfo( 1507 1511 kAudioContentName, 1508 1512 TransportDescription(std::vector<std::string>(), kUfragVoice, kPwdVoice, 1509 1513 cricket::ICEMODE_FULL, 1510 cricket::CONNECTIONROLE_NONE, &fingerprint))) );1511 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(1514 cricket::CONNECTIONROLE_NONE, &fingerprint))); 1515 desc_.AddTransportInfo(TransportInfo( 1512 1516 kVideoContentName, 1513 1517 TransportDescription(std::vector<std::string>(), kUfragVideo, kPwdVideo, 1514 1518 cricket::ICEMODE_FULL, 1515 cricket::CONNECTIONROLE_NONE, &fingerprint))) );1519 cricket::CONNECTIONROLE_NONE, &fingerprint))); 1516 1520 } 1517 1521 … … 1630 1634 desc_.AddContent(kDataContentName, MediaProtocolType::kSctp, 1631 1635 data.release()); 1632 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(1633 kDataContentName, TransportDescription(kUfragData, kPwdData))) );1636 desc_.AddTransportInfo(TransportInfo( 1637 kDataContentName, TransportDescription(kUfragData, kPwdData))); 1634 1638 } 1635 1639 … … 1650 1654 data_desc_->set_protocol(cricket::kMediaProtocolSavpf); 1651 1655 desc_.AddContent(kDataContentName, MediaProtocolType::kRtp, data.release()); 1652 EXPECT_TRUE(desc_.AddTransportInfo(TransportInfo(1653 kDataContentName, TransportDescription(kUfragData, kPwdData))) );1656 desc_.AddTransportInfo(TransportInfo( 1657 kDataContentName, TransportDescription(kUfragData, kPwdData))); 1654 1658 } 1655 1659 … … 2301 2305 EXPECT_TRUE(SdpDeserialize(kSdpNoRtpmapString, &jdesc)); 2302 2306 cricket::AudioContentDescription* audio = 2303 jdesc.description() 2304 ->GetContentDescriptionByName(cricket::CN_AUDIO) 2305 ->as_audio(); 2307 cricket::GetFirstAudioContentDescription(jdesc.description()); 2306 2308 AudioCodecs ref_codecs; 2307 2309 // The codecs in the AudioContentDescription should be in the same order as … … 2326 2328 EXPECT_TRUE(SdpDeserialize(kSdpNoRtpmapString, &jdesc)); 2327 2329 cricket::AudioContentDescription* audio = 2328 jdesc.description() 2329 ->GetContentDescriptionByName(cricket::CN_AUDIO) 2330 ->as_audio(); 2330 cricket::GetFirstAudioContentDescription(jdesc.description()); 2331 2331 2332 2332 cricket::AudioCodec g729 = audio->codecs()[0]; … … 2925 2925 // Verify 2926 2926 cricket::AudioContentDescription* audio = 2927 jdesc.description() 2928 ->GetContentDescriptionByName(cricket::CN_AUDIO) 2929 ->as_audio(); 2927 cricket::GetFirstAudioContentDescription(jdesc.description()); 2930 2928 EXPECT_TRUE(audio->conference_mode()); 2931 2929 2932 2930 cricket::VideoContentDescription* video = 2933 jdesc.description() 2934 ->GetContentDescriptionByName(cricket::CN_VIDEO) 2935 ->as_video(); 2931 cricket::GetFirstVideoContentDescription(jdesc.description()); 2936 2932 EXPECT_TRUE(video->conference_mode()); 2937 2933 } … … 2948 2944 // Verify. 2949 2945 cricket::AudioContentDescription* audio = 2950 jdesc.description() 2951 ->GetContentDescriptionByName(cricket::CN_AUDIO) 2952 ->as_audio(); 2946 cricket::GetFirstAudioContentDescription(jdesc.description()); 2953 2947 EXPECT_TRUE(audio->conference_mode()); 2954 2948 2955 2949 cricket::VideoContentDescription* video = 2956 jdesc.description() 2957 ->GetContentDescriptionByName(cricket::CN_VIDEO) 2958 ->as_video(); 2950 cricket::GetFirstVideoContentDescription(jdesc.description()); 2959 2951 EXPECT_TRUE(video->conference_mode()); 2960 2952 } … … 3910 3902 EXPECT_TRUE(SdpDeserialize(sdp, &jsep_desc)); 3911 3903 } 3904 3905 // Test that the content name is empty if the media section does not have an 3906 // a=mid line. 3907 TEST_F(WebRtcSdpTest, ParseNoMid) { 3908 std::string sdp = kSdpString; 3909 Replace("a=mid:audio_content_name\r\n", "", &sdp); 3910 Replace("a=mid:video_content_name\r\n", "", &sdp); 3911 3912 JsepSessionDescription output(kDummyType); 3913 SdpParseError error; 3914 ASSERT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error)); 3915 3916 EXPECT_THAT(output.description()->contents(), 3917 ElementsAre(Field("name", &cricket::ContentInfo::name, ""), 3918 Field("name", &cricket::ContentInfo::name, ""))); 3919 } -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/system_wrappers/include/metrics.h
r238967 r240320 134 134 // which is already sparse, and remove the boundary argument from the macro. 135 135 #define RTC_HISTOGRAM_ENUMERATION_SPARSE(name, sample, boundary) \ 136 RTC_HISTOGRAM_COMMON_BLOCK (\136 RTC_HISTOGRAM_COMMON_BLOCK_SLOW( \ 137 137 name, sample, \ 138 138 webrtc::metrics::SparseHistogramFactoryGetEnumeration(name, boundary)) … … 149 149 // |boundary| should be above the max enumerator sample. 150 150 #define RTC_HISTOGRAM_ENUMERATION(name, sample, boundary) \ 151 RTC_HISTOGRAM_COMMON_BLOCK (\151 RTC_HISTOGRAM_COMMON_BLOCK_SLOW( \ 152 152 name, sample, \ 153 153 webrtc::metrics::HistogramFactoryGetEnumeration(name, boundary)) … … 176 176 } while (0) 177 177 178 // Deprecated.179 178 // The histogram is constructed/found for each call. 180 179 // May be used for histograms with infrequent updates.` -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/video/BUILD.gn
r238967 r240320 182 182 "../modules/video_coding", 183 183 "../modules/video_coding:video_coding_utility", 184 "../modules/video_coding:webrtc_vp9_helpers", 184 185 "../rtc_base:checks", 185 186 "../rtc_base:criticalsection",
Note: See TracChangeset
for help on using the changeset viewer.