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

Unified Diff: webrtc/video/video_capture_input_unittest.cc

Issue 1569853002: Measure encoding time on encode callbacks. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 11 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/video/video_capture_input_unittest.cc
diff --git a/webrtc/video/video_capture_input_unittest.cc b/webrtc/video/video_capture_input_unittest.cc
index 3fe6e3aeebe6a5d3f45f28636f32329814c18f8b..aa3bda0c989af1d879f4ed8dad2d1e7c38283e34 100644
--- a/webrtc/video/video_capture_input_unittest.cc
+++ b/webrtc/video/video_capture_input_unittest.cc
@@ -47,28 +47,23 @@ VideoFrame* CreateVideoFrame(uint8_t length);
class VideoCaptureInputTest : public ::testing::Test {
protected:
VideoCaptureInputTest()
- : mock_process_thread_(new NiceMock<MockProcessThread>),
- mock_frame_callback_(new NiceMock<MockVideoCaptureCallback>),
- output_frame_event_(false, false),
- stats_proxy_(Clock::GetRealTimeClock(),
+ : stats_proxy_(Clock::GetRealTimeClock(),
webrtc::VideoSendStream::Config(nullptr),
- webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo) {}
+ webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo),
+ mock_frame_callback_(new NiceMock<MockVideoCaptureCallback>),
+ output_frame_event_(false, false) {}
virtual void SetUp() {
EXPECT_CALL(*mock_frame_callback_, DeliverFrame(_))
.WillRepeatedly(
WithArg<0>(Invoke(this, &VideoCaptureInputTest::AddOutputFrame)));
- input_.reset(new internal::VideoCaptureInput(
- mock_process_thread_.get(), mock_frame_callback_.get(), nullptr,
- &stats_proxy_, nullptr, nullptr));
- }
-
- virtual void TearDown() {
- // VideoCaptureInput accesses |mock_process_thread_| in destructor and
- // should
- // be deleted first.
- input_.reset();
+ overuse_detector_.reset(
+ new OveruseFrameDetector(Clock::GetRealTimeClock(), CpuOveruseOptions(),
+ nullptr, nullptr, &stats_proxy_));
+ input_.reset(new internal::VideoCaptureInput(mock_frame_callback_.get(),
+ nullptr, &stats_proxy_,
+ overuse_detector_.get()));
}
void AddInputFrame(VideoFrame* frame) {
@@ -86,9 +81,12 @@ class VideoCaptureInputTest : public ::testing::Test {
EXPECT_TRUE(output_frame_event_.Wait(FRAME_TIMEOUT_MS));
}
- rtc::scoped_ptr<MockProcessThread> mock_process_thread_;
+ SendStatisticsProxy stats_proxy_;
+
rtc::scoped_ptr<MockVideoCaptureCallback> mock_frame_callback_;
+ rtc::scoped_ptr<OveruseFrameDetector> overuse_detector_;
+
// Used to send input capture frames to VideoCaptureInput.
rtc::scoped_ptr<internal::VideoCaptureInput> input_;
@@ -104,7 +102,6 @@ class VideoCaptureInputTest : public ::testing::Test {
// The pointers of Y plane buffers of output frames. This is used to verify
// the frame are swapped and not copied.
std::vector<const uint8_t*> output_frame_ybuffers_;
- SendStatisticsProxy stats_proxy_;
};
TEST_F(VideoCaptureInputTest, DoesNotRetainHandleNorCopyBuffer) {

Powered by Google App Engine
This is Rietveld 408576698