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

Unified Diff: webrtc/modules/video_coding/protection_bitrate_calculator.cc

Issue 2070343002: Remove ViEncoder::Pause / Start (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove from header file. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/protection_bitrate_calculator.cc
diff --git a/webrtc/modules/video_coding/protection_bitrate_calculator.cc b/webrtc/modules/video_coding/protection_bitrate_calculator.cc
index c92c3c445ca8834868d7bebf81fdb1813ab84ab9..55853290431a12abee720a6a1fefe327562f6c04 100644
--- a/webrtc/modules/video_coding/protection_bitrate_calculator.cc
+++ b/webrtc/modules/video_coding/protection_bitrate_calculator.cc
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include <webrtc/modules/video_coding/protection_bitrate_calculator.h>
+#include "webrtc/modules/video_coding/protection_bitrate_calculator.h"
namespace webrtc {
@@ -33,7 +33,8 @@ ProtectionBitrateCalculator::ProtectionBitrateCalculator(
protection_callback_(protection_callback),
loss_prot_logic_(new media_optimization::VCMLossProtectionLogic(
clock_->TimeInMilliseconds())),
- max_payload_size_(1460) {}
+ max_payload_size_(1460),
+ last_encoder_target_rate_(0) {}
ProtectionBitrateCalculator::~ProtectionBitrateCalculator(void) {
loss_prot_logic_->Release();
@@ -93,6 +94,7 @@ uint32_t ProtectionBitrateCalculator::SetTargetRates(
loss_prot_logic_->UpdateFilteredLossPr(packet_loss_enc);
if (loss_prot_logic_->SelectedType() == media_optimization::kNone) {
+ last_encoder_target_rate_ = estimated_bitrate_bps;
return estimated_bitrate_bps;
}
@@ -154,7 +156,15 @@ uint32_t ProtectionBitrateCalculator::SetTargetRates(
protection_overhead_rate = 0.5;
// Source coding rate: total rate - protection overhead.
- return estimated_bitrate_bps * (1.0 - protection_overhead_rate);
+ CritScope lock(&crit_sect_);
+ last_encoder_target_rate_ =
+ estimated_bitrate_bps * (1.0 - protection_overhead_rate);
+ return last_encoder_target_rate_;
+}
+
+uint32_t ProtectionBitrateCalculator::GetEncoderTargetRate() const {
+ CritScope lock(&crit_sect_);
+ return last_encoder_target_rate_;
}
void ProtectionBitrateCalculator::SetProtectionMethod(bool enable_fec,

Powered by Google App Engine
This is Rietveld 408576698