OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/modules/video_coding/utility/quality_scaler.h" | 11 #include "webrtc/modules/video_coding/utility/quality_scaler.h" |
12 | 12 |
13 #include <memory> | 13 #include <memory> |
14 | 14 |
15 #include "webrtc/base/event.h" | 15 #include "webrtc/rtc_base/event.h" |
16 #include "webrtc/base/task_queue.h" | 16 #include "webrtc/rtc_base/task_queue.h" |
17 #include "webrtc/test/gmock.h" | 17 #include "webrtc/test/gmock.h" |
18 #include "webrtc/test/gtest.h" | 18 #include "webrtc/test/gtest.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 namespace { | 21 namespace { |
22 static const int kFramerate = 30; | 22 static const int kFramerate = 30; |
23 static const int kLowQp = 15; | 23 static const int kLowQp = 15; |
24 static const int kLowQpThreshold = 18; | 24 static const int kLowQpThreshold = 18; |
25 static const int kHighQp = 40; | 25 static const int kHighQp = 40; |
26 static const size_t kDefaultTimeoutMs = 150; | 26 static const size_t kDefaultTimeoutMs = 150; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 for (int i = 0; i < kFramerate; ++i) { | 193 for (int i = 0; i < kFramerate; ++i) { |
194 qs_->ReportQP(kLowQp); | 194 qs_->ReportQP(kLowQp); |
195 } | 195 } |
196 }); | 196 }); |
197 EXPECT_TRUE(observer_->event.Wait(kDefaultTimeoutMs)); | 197 EXPECT_TRUE(observer_->event.Wait(kDefaultTimeoutMs)); |
198 EXPECT_EQ(0, observer_->adapt_down_events_); | 198 EXPECT_EQ(0, observer_->adapt_down_events_); |
199 EXPECT_EQ(1, observer_->adapt_up_events_); | 199 EXPECT_EQ(1, observer_->adapt_up_events_); |
200 } | 200 } |
201 } // namespace webrtc | 201 } // namespace webrtc |
202 #undef DO_SYNC | 202 #undef DO_SYNC |
OLD | NEW |