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

Unified Diff: webrtc/test/frame_generator.cc

Issue 2383493005: Revert of Let ViEEncoder handle resolution changes. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « webrtc/test/frame_generator.h ('k') | webrtc/test/frame_generator_capturer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/frame_generator.cc
diff --git a/webrtc/test/frame_generator.cc b/webrtc/test/frame_generator.cc
index b83b1be9ad3209abe9ee3df378a968e7a0f0df42..27935e4b26be0a1575547012e6955e3c1d52fe11 100644
--- a/webrtc/test/frame_generator.cc
+++ b/webrtc/test/frame_generator.cc
@@ -26,14 +26,8 @@
class ChromaGenerator : public FrameGenerator {
public:
- ChromaGenerator(size_t width, size_t height) : angle_(0.0) {
- ChangeResolution(width, height);
- }
-
- void ChangeResolution(size_t width, size_t height) override {
- rtc::CritScope lock(&crit_);
- width_ = width;
- height_ = height;
+ ChromaGenerator(size_t width, size_t height)
+ : angle_(0.0), width_(width), height_(height) {
RTC_CHECK(width_ > 0);
RTC_CHECK(height_ > 0);
half_width_ = (width_ + 1) / 2;
@@ -42,7 +36,6 @@
}
VideoFrame* NextFrame() override {
- rtc::CritScope lock(&crit_);
angle_ += 30.0;
uint8_t u = fabs(sin(angle_)) * 0xFF;
uint8_t v = fabs(cos(angle_)) * 0xFF;
@@ -62,14 +55,13 @@
}
private:
- rtc::CriticalSection crit_;
- double angle_ GUARDED_BY(&crit_);
- size_t width_ GUARDED_BY(&crit_);
- size_t height_ GUARDED_BY(&crit_);
- size_t half_width_ GUARDED_BY(&crit_);
- size_t y_size_ GUARDED_BY(&crit_);
- size_t uv_size_ GUARDED_BY(&crit_);
- std::unique_ptr<VideoFrame> frame_ GUARDED_BY(&crit_);
+ double angle_;
+ size_t width_;
+ size_t height_;
+ size_t half_width_;
+ size_t y_size_;
+ size_t uv_size_;
+ std::unique_ptr<VideoFrame> frame_;
};
class YuvFileGenerator : public FrameGenerator {
« no previous file with comments | « webrtc/test/frame_generator.h ('k') | webrtc/test/frame_generator_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698