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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1377 // TODO(solenberg): Tests call this function on a network thread, libjingle | 1377 // TODO(solenberg): Tests call this function on a network thread, libjingle |
1378 // calls on the worker thread. We should move towards always using a network | 1378 // calls on the worker thread. We should move towards always using a network |
1379 // thread. Then this check can be enabled. | 1379 // thread. Then this check can be enabled. |
1380 // RTC_DCHECK_CALLED_SEQUENTIALLY(&configuration_sequence_checker_); | 1380 // RTC_DCHECK_CALLED_SEQUENTIALLY(&configuration_sequence_checker_); |
1381 if (RtpHeaderParser::IsRtcp(packet, length)) | 1381 if (RtpHeaderParser::IsRtcp(packet, length)) |
1382 return DeliverRtcp(media_type, packet, length); | 1382 return DeliverRtcp(media_type, packet, length); |
1383 | 1383 |
1384 return DeliverRtp(media_type, packet, length, packet_time); | 1384 return DeliverRtp(media_type, packet, length, packet_time); |
1385 } | 1385 } |
1386 | 1386 |
1387 // TODO(brandtr): Update this member function when we support protecting | |
1388 // audio packets with FlexFEC. | |
1389 void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) { | 1387 void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) { |
1390 ReadLockScoped read_lock(*receive_crit_); | |
1391 rtc::Optional<RtpPacketReceived> parsed_packet = | 1388 rtc::Optional<RtpPacketReceived> parsed_packet = |
1392 ParseRtpPacket(packet, length, nullptr); | 1389 ParseRtpPacket(packet, length, nullptr); |
1393 if (!parsed_packet) | 1390 if (!parsed_packet) |
1394 return; | 1391 return; |
1395 | 1392 |
1396 parsed_packet->set_recovered(true); | 1393 parsed_packet->set_recovered(true); |
1397 | 1394 |
1395 ReadLockScoped read_lock(*receive_crit_); | |
1396 auto it = receive_rtp_config_.find(parsed_packet->Ssrc()); | |
1397 if (it == receive_rtp_config_.end()) { | |
brandtr
2017/08/21 11:05:31
This logic is now duplicated between Call::Deliver
nisse-webrtc
2017/08/21 11:54:24
If that makes things simpler, sure. Longer term, I
brandtr
2017/08/22 13:14:23
I'll leave it as is, because it will not be simple
| |
1398 LOG(LS_ERROR) << "receive_rtp_config_ lookup failed for ssrc " | |
1399 << parsed_packet->Ssrc(); | |
1400 // Destruction of the receive stream, including deregistering from the | |
1401 // RtpDemuxer, is not protected by the |receive_crit_| lock. But | |
1402 // deregistering in the |receive_rtp_config_| map is protected by that lock. | |
1403 // So by not passing the packet on to demuxing in this case, we prevent | |
1404 // incoming packets to be passed on via the demuxer to a receive stream | |
1405 // which is being torned down. | |
1406 return; | |
1407 } | |
1408 parsed_packet->IdentifyExtensions(it->second.extensions); | |
1409 | |
1410 // TODO(brandtr): Update here when we support protecting audio packets too. | |
1398 video_receiver_controller_.OnRtpPacket(*parsed_packet); | 1411 video_receiver_controller_.OnRtpPacket(*parsed_packet); |
1399 } | 1412 } |
1400 | 1413 |
1401 void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet, | 1414 void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet, |
1402 MediaType media_type) { | 1415 MediaType media_type) { |
1403 auto it = receive_rtp_config_.find(packet.Ssrc()); | 1416 auto it = receive_rtp_config_.find(packet.Ssrc()); |
1404 bool use_send_side_bwe = | 1417 bool use_send_side_bwe = |
1405 (it != receive_rtp_config_.end()) && it->second.use_send_side_bwe; | 1418 (it != receive_rtp_config_.end()) && it->second.use_send_side_bwe; |
1406 | 1419 |
1407 RTPHeader header; | 1420 RTPHeader header; |
(...skipping 14 matching lines...) Expand all Loading... | |
1422 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { | 1435 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { |
1423 receive_side_cc_.OnReceivedPacket( | 1436 receive_side_cc_.OnReceivedPacket( |
1424 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), | 1437 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), |
1425 header); | 1438 header); |
1426 } | 1439 } |
1427 } | 1440 } |
1428 | 1441 |
1429 } // namespace internal | 1442 } // namespace internal |
1430 | 1443 |
1431 } // namespace webrtc | 1444 } // namespace webrtc |
OLD | NEW |