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

Unified Diff: webrtc/test/fake_encoder.h

Issue 2883963002: Periodically update codec bit/frame rate settings. (Closed)
Patch Set: cleanup Created 3 years, 7 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/test/fake_encoder.h
diff --git a/webrtc/test/fake_encoder.h b/webrtc/test/fake_encoder.h
index e3878ecd4a78daefae1807b418cc16174faee49f..06c19467151e4c03ed5cab2668b129839c01b78b 100644
--- a/webrtc/test/fake_encoder.h
+++ b/webrtc/test/fake_encoder.h
@@ -45,6 +45,7 @@ class FakeEncoder : public VideoEncoder {
int32_t SetRateAllocation(const BitrateAllocation& rate_allocation,
uint32_t framerate) override;
const char* ImplementationName() const override;
+ int GetConfiguredInputFramerate();
static const char* kImplementationName;
@@ -53,11 +54,16 @@ class FakeEncoder : public VideoEncoder {
VideoCodec config_ GUARDED_BY(crit_sect_);
EncodedImageCallback* callback_ GUARDED_BY(crit_sect_);
BitrateAllocation target_bitrate_ GUARDED_BY(crit_sect_);
+ int configured_input_framerate_ GUARDED_BY(crit_sect_);
int max_target_bitrate_kbps_ GUARDED_BY(crit_sect_);
- int64_t last_encode_time_ms_ GUARDED_BY(crit_sect_);
+ bool pending_keyframe_ GUARDED_BY(crit_sect_);
rtc::CriticalSection crit_sect_;
uint8_t encoded_buffer_[100000];
+
+ // Keeps a history a byte debts to be payed over a number of frames.
+ // The debt is acquired by keyframes overshooting the bitrate target.
+ std::deque<size_t> debt_bytes_;
};
class FakeH264Encoder : public FakeEncoder, public EncodedImageCallback {

Powered by Google App Engine
This is Rietveld 408576698