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/test/fake_encoder.cc

Issue 2489843002: Revert of Extract bitrate allocation of spatial/temporal layers out of codec impl. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « webrtc/test/fake_encoder.h ('k') | webrtc/video/end_to_end_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/fake_encoder.cc
diff --git a/webrtc/test/fake_encoder.cc b/webrtc/test/fake_encoder.cc
index 26ce0c66083bbaf56f65df68c94be64388e93dfd..f518ce39192adaca53f2541768b4a7a05648f2bf 100644
--- a/webrtc/test/fake_encoder.cc
+++ b/webrtc/test/fake_encoder.cc
@@ -23,6 +23,7 @@
FakeEncoder::FakeEncoder(Clock* clock)
: clock_(clock),
callback_(NULL),
+ target_bitrate_kbps_(0),
max_target_bitrate_kbps_(-1),
last_encode_time_ms_(0) {
// Generate some arbitrary not-all-zero data
@@ -42,7 +43,7 @@
int32_t number_of_cores,
size_t max_payload_size) {
config_ = *config;
- target_bitrate_.SetBitrate(0, 0, config_.startBitrate * 1000);
+ target_bitrate_kbps_ = config_.startBitrate;
return 0;
}
@@ -64,8 +65,8 @@
time_since_last_encode_ms = 3 * 1000 / config_.maxFramerate;
}
- size_t bits_available = static_cast<size_t>(target_bitrate_.get_sum_kbps() *
- time_since_last_encode_ms);
+ size_t bits_available =
+ static_cast<size_t>(target_bitrate_kbps_ * time_since_last_encode_ms);
size_t min_bits = static_cast<size_t>(
config_.simulcastStream[0].minBitrate * time_since_last_encode_ms);
if (bits_available < min_bits)
@@ -132,9 +133,8 @@
return 0;
}
-int32_t FakeEncoder::SetRateAllocation(const BitrateAllocation& rate_allocation,
- uint32_t framerate) {
- target_bitrate_ = rate_allocation;
+int32_t FakeEncoder::SetRates(uint32_t new_target_bitrate, uint32_t framerate) {
+ target_bitrate_kbps_ = new_target_bitrate;
return 0;
}
« no previous file with comments | « webrtc/test/fake_encoder.h ('k') | webrtc/video/end_to_end_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698