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

Side by Side Diff: webrtc/video_engine/vie_encoder.cc

Issue 1226143013: Merge methods for configuring NACK/FEC/hybrid. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove distinction between send and receive NACK. Allow disabling receive-side. Created 5 years, 5 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 DCHECK(send_payload_router_ != NULL); 602 DCHECK(send_payload_router_ != NULL);
603 603
604 if (fec_enabled_ == fec && nack_enabled_ == nack) { 604 if (fec_enabled_ == fec && nack_enabled_ == nack) {
605 // No change needed, we're already in correct state. 605 // No change needed, we're already in correct state.
606 return 0; 606 return 0;
607 } 607 }
608 fec_enabled_ = fec; 608 fec_enabled_ = fec;
609 nack_enabled_ = nack; 609 nack_enabled_ = nack;
610 610
611 // Set Video Protection for VCM. 611 // Set Video Protection for VCM.
612 if (fec_enabled_ && nack_enabled_) { 612 VCMVideoProtection protection_mode;
613 vcm_->SetVideoProtection(webrtc::kProtectionNackFEC, true); 613 if (fec_enabled_) {
614 protection_mode =
615 nack_enabled_ ? webrtc::kProtectionNackFEC : kProtectionFEC;
614 } else { 616 } else {
615 vcm_->SetVideoProtection(webrtc::kProtectionFEC, fec_enabled_); 617 protection_mode = nack_enabled_ ? kProtectionNack : kProtectionNone;
616 vcm_->SetVideoProtection(webrtc::kProtectionNackSender, nack_enabled_);
617 vcm_->SetVideoProtection(webrtc::kProtectionNackFEC, false);
618 } 618 }
619 vcm_->SetVideoProtection(protection_mode, true);
619 620
620 if (fec_enabled_ || nack_enabled_) { 621 if (fec_enabled_ || nack_enabled_) {
621 // The send codec must be registered to set correct MTU. 622 // The send codec must be registered to set correct MTU.
622 webrtc::VideoCodec codec; 623 webrtc::VideoCodec codec;
623 if (vcm_->SendCodec(&codec) == 0) { 624 if (vcm_->SendCodec(&codec) == 0) {
624 uint32_t current_bitrate_bps = 0; 625 uint32_t current_bitrate_bps = 0;
625 if (vcm_->Bitrate(&current_bitrate_bps) != 0) { 626 if (vcm_->Bitrate(&current_bitrate_bps) != 0) {
626 LOG_F(LS_WARNING) << 627 LOG_F(LS_WARNING) <<
627 "Failed to get the current encoder target bitrate."; 628 "Failed to get the current encoder target bitrate.";
628 } 629 }
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 } 863 }
863 864
864 int32_t QMVideoSettingsCallback::SetVideoQMSettings( 865 int32_t QMVideoSettingsCallback::SetVideoQMSettings(
865 const uint32_t frame_rate, 866 const uint32_t frame_rate,
866 const uint32_t width, 867 const uint32_t width,
867 const uint32_t height) { 868 const uint32_t height) {
868 return vpm_->SetTargetResolution(width, height, frame_rate); 869 return vpm_->SetTargetResolution(width, height, frame_rate);
869 } 870 }
870 871
871 } // namespace webrtc 872 } // namespace webrtc
OLDNEW
« webrtc/video/video_send_stream.cc ('K') | « webrtc/video_engine/vie_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698