| Index: webrtc/test/frame_generator.cc
|
| diff --git a/webrtc/test/frame_generator.cc b/webrtc/test/frame_generator.cc
|
| index 27935e4b26be0a1575547012e6955e3c1d52fe11..327327343db560ce95fc7f468a3e3fdfe81ef62a 100644
|
| --- a/webrtc/test/frame_generator.cc
|
| +++ b/webrtc/test/frame_generator.cc
|
| @@ -26,8 +26,14 @@ namespace {
|
|
|
| class ChromaGenerator : public FrameGenerator {
|
| public:
|
| - ChromaGenerator(size_t width, size_t height)
|
| - : angle_(0.0), width_(width), height_(height) {
|
| + 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;
|
| RTC_CHECK(width_ > 0);
|
| RTC_CHECK(height_ > 0);
|
| half_width_ = (width_ + 1) / 2;
|
| @@ -36,6 +42,7 @@ class ChromaGenerator : public FrameGenerator {
|
| }
|
|
|
| VideoFrame* NextFrame() override {
|
| + rtc::CritScope lock(&crit_);
|
| angle_ += 30.0;
|
| uint8_t u = fabs(sin(angle_)) * 0xFF;
|
| uint8_t v = fabs(cos(angle_)) * 0xFF;
|
| @@ -55,6 +62,7 @@ class ChromaGenerator : public FrameGenerator {
|
| }
|
|
|
| private:
|
| + rtc::CriticalSection crit_;
|
| double angle_;
|
| size_t width_;
|
| size_t height_;
|
|
|