OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 auto packet = last ? std::move(last_packet) | 387 auto packet = last ? std::move(last_packet) |
388 : rtc::MakeUnique<RtpPacketToSend>(*rtp_header); | 388 : rtc::MakeUnique<RtpPacketToSend>(*rtp_header); |
389 if (!packetizer->NextPacket(packet.get())) | 389 if (!packetizer->NextPacket(packet.get())) |
390 return false; | 390 return false; |
391 RTC_DCHECK_LE(packet->payload_size(), | 391 RTC_DCHECK_LE(packet->payload_size(), |
392 last ? max_data_payload_length - last_packet_reduction_len | 392 last ? max_data_payload_length - last_packet_reduction_len |
393 : max_data_payload_length); | 393 : max_data_payload_length); |
394 if (!rtp_sender_->AssignSequenceNumber(packet.get())) | 394 if (!rtp_sender_->AssignSequenceNumber(packet.get())) |
395 return false; | 395 return false; |
396 | 396 |
| 397 bool protect_packet = (packetizer->GetProtectionType() == kProtectedPacket); |
397 // Put packetization finish timestamp into extension. | 398 // Put packetization finish timestamp into extension. |
398 if (last && is_timing_frame) { | 399 if (last && is_timing_frame) { |
399 packet->set_packetization_finish_time_ms(clock_->TimeInMilliseconds()); | 400 packet->set_packetization_finish_time_ms(clock_->TimeInMilliseconds()); |
| 401 // TODO(ilnik): Due to webrtc:7859, packets with timing extensions are not |
| 402 // protected by FEC. It reduces FEC efficiency a bit. When FEC is moved |
| 403 // below the pacer, it can be re-enabled for these packets. |
| 404 // NOTE: Any RTP stream processor in the network, modifying 'network' |
| 405 // timestamps in the timing frames extension have to be an end-point for |
| 406 // FEC, otherwise recovered by FEC packets will be corrupted. |
| 407 protect_packet = false; |
400 } | 408 } |
401 | 409 |
402 const bool protect_packet = | |
403 (packetizer->GetProtectionType() == kProtectedPacket); | |
404 if (flexfec_enabled()) { | 410 if (flexfec_enabled()) { |
405 // TODO(brandtr): Remove the FlexFEC code path when FlexfecSender | 411 // TODO(brandtr): Remove the FlexFEC code path when FlexfecSender |
406 // is wired up to PacedSender instead. | 412 // is wired up to PacedSender instead. |
407 SendVideoPacketWithFlexfec(std::move(packet), storage, protect_packet); | 413 SendVideoPacketWithFlexfec(std::move(packet), storage, protect_packet); |
408 } else if (red_enabled) { | 414 } else if (red_enabled) { |
409 SendVideoPacketAsRedMaybeWithUlpfec(std::move(packet), storage, | 415 SendVideoPacketAsRedMaybeWithUlpfec(std::move(packet), storage, |
410 protect_packet); | 416 protect_packet); |
411 } else { | 417 } else { |
412 SendVideoPacket(std::move(packet), storage); | 418 SendVideoPacket(std::move(packet), storage); |
413 } | 419 } |
(...skipping 29 matching lines...) Expand all Loading... |
443 rtc::CritScope cs(&crit_); | 449 rtc::CritScope cs(&crit_); |
444 return retransmission_settings_; | 450 return retransmission_settings_; |
445 } | 451 } |
446 | 452 |
447 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { | 453 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { |
448 rtc::CritScope cs(&crit_); | 454 rtc::CritScope cs(&crit_); |
449 retransmission_settings_ = settings; | 455 retransmission_settings_ = settings; |
450 } | 456 } |
451 | 457 |
452 } // namespace webrtc | 458 } // namespace webrtc |
OLD | NEW |