Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1032)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc

Issue 2947133002: Fix timing frames and FEC conflict (Closed)
Patch Set: Modify VideoSendStream test for video timing extension Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 =
398 (packetizer->GetProtectionType() == kProtectedPacket);
397 // Put packetization finish timestamp into extension. 399 // Put packetization finish timestamp into extension.
398 if (last && is_timing_frame) { 400 if (last && is_timing_frame) {
399 packet->set_packetization_finish_time_ms(clock_->TimeInMilliseconds()); 401 packet->set_packetization_finish_time_ms(clock_->TimeInMilliseconds());
402 // TODO(ilnik): Due to webrtc:7859, packets with timing extensions are not
403 // protected by FEC. It reduces FEC efficiency a bit. When FEC is moved
404 // below the pacer, it can be re-enabled for these packets.
405 // NOTE: Any RTP stream processor in the network, modifying 'network'
406 // timestamps in the timing frames extension have to be an end-point for
407 // FEC, otherwise recovered by FEC packets will be corrupted.
408 protect_packet = false;
400 } 409 }
401 410
402 const bool protect_packet =
403 (packetizer->GetProtectionType() == kProtectedPacket);
404 if (flexfec_enabled()) { 411 if (flexfec_enabled()) {
405 // TODO(brandtr): Remove the FlexFEC code path when FlexfecSender 412 // TODO(brandtr): Remove the FlexFEC code path when FlexfecSender
406 // is wired up to PacedSender instead. 413 // is wired up to PacedSender instead.
407 SendVideoPacketWithFlexfec(std::move(packet), storage, protect_packet); 414 SendVideoPacketWithFlexfec(std::move(packet), storage, protect_packet);
408 } else if (red_enabled) { 415 } else if (red_enabled) {
409 SendVideoPacketAsRedMaybeWithUlpfec(std::move(packet), storage, 416 SendVideoPacketAsRedMaybeWithUlpfec(std::move(packet), storage,
410 protect_packet); 417 protect_packet);
411 } else { 418 } else {
412 SendVideoPacket(std::move(packet), storage); 419 SendVideoPacket(std::move(packet), storage);
413 } 420 }
(...skipping 29 matching lines...) Expand all
443 rtc::CritScope cs(&crit_); 450 rtc::CritScope cs(&crit_);
444 return retransmission_settings_; 451 return retransmission_settings_;
445 } 452 }
446 453
447 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { 454 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) {
448 rtc::CritScope cs(&crit_); 455 rtc::CritScope cs(&crit_);
449 retransmission_settings_ = settings; 456 retransmission_settings_ = settings;
450 } 457 }
451 458
452 } // namespace webrtc 459 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698