From 06ad81fd58a09c5a0419039b0f0271a1dab95e9a Mon Sep 17 00:00:00 2001 From: "mikhal@webrtc.org" Date: Tue, 23 Aug 2011 16:03:59 +0000 Subject: [PATCH] video_coding: changing the UpdateMethod function (protection settings). Review URL: http://webrtc-codereview.appspot.com/126002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@423 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/source/media_opt_util.cc | 42 ++++--------------- .../video_coding/main/source/media_opt_util.h | 3 +- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/src/modules/video_coding/main/source/media_opt_util.cc b/src/modules/video_coding/main/source/media_opt_util.cc index da516ba23..03cbf7790 100644 --- a/src/modules/video_coding/main/source/media_opt_util.cc +++ b/src/modules/video_coding/main/source/media_opt_util.cc @@ -844,42 +844,14 @@ VCMLossProtectionLogic::UpdateMethod(VCMProtectionMethod *newMethod /*=NULL */) _currentParameters.codecWidth = _codecWidth; _currentParameters.codecHeight = _codecHeight; - if (newMethod == NULL) + // Update to new method, if not NULL + if (newMethod != NULL) { - VCMProtectionMethod *method; - ListItem *item; - for (item = _availableMethods.First(); item != NULL; - item = _availableMethods.Next(item)) - { - method = static_cast (item->GetItem()); - if (method != NULL) - { - if (method->Type() == kFEC) - { - _selectedMethod = method; - } - if (method->Type() == kNACK) - { - _selectedMethod = method; - } - if (method->Type() == kNackFec) - { - _selectedMethod = method; - } - method->UpdateParameters(&_currentParameters); - } - } - if (_selectedMethod != NULL && _selectedMethod->Type() != kFEC) - { - _selectedMethod = method; - } - } - else - { - _selectedMethod = newMethod; - _selectedMethod->UpdateParameters(&_currentParameters); - } - return true; + _selectedMethod = newMethod; + _selectedMethod->UpdateParameters(&_currentParameters); + return true; + } + return false; } VCMProtectionMethod* diff --git a/src/modules/video_coding/main/source/media_opt_util.h b/src/modules/video_coding/main/source/media_opt_util.h index ce74e67bf..212dc7763 100644 --- a/src/modules/video_coding/main/source/media_opt_util.h +++ b/src/modules/video_coding/main/source/media_opt_util.h @@ -339,8 +339,7 @@ public: _fecRateDelta = fecRateDelta; } // Update the protection methods with the current VCMProtectionParameters - // and choose the best method available. The update involves computing the - // robustness settings for the protection method. + // and set the requested protection settings. // // Input: // - newMethod : If not NULL, this method will be selected.