Refactor MediaOptimization protection methods.

Makes MediaOptimization::EnableProtectionMethod significantly less
confusing. Also removing some dead methods in VideoSender.

BUG=
R=mflodman@webrtc.org
TBR=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42339004

Cr-Commit-Position: refs/heads/master@{#8693}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8693 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org
2015-03-12 10:39:24 +00:00
parent 119c12f6ef
commit cade82c56f
9 changed files with 50 additions and 191 deletions

View File

@ -321,15 +321,11 @@ uint32_t MediaOptimization::SetTargetRates(
void MediaOptimization::EnableProtectionMethod(bool enable,
VCMProtectionMethodEnum method) {
CriticalSectionScoped lock(crit_sect_.get());
bool updated = false;
if (enable) {
updated = loss_prot_logic_->SetMethod(method);
} else {
loss_prot_logic_->RemoveMethod(method);
}
if (updated) {
loss_prot_logic_->UpdateMethod();
}
if (!enable && loss_prot_logic_->SelectedType() != method)
return;
if (!enable)
method = kNone;
loss_prot_logic_->SetMethod(method);
}
uint32_t MediaOptimization::InputFrameRate() {