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 9f18f3dfa8f8876e1b1d615bd54114171c4e51fd..96bf954d1e09b9c101f5fb14a37904ce3a518a49 100644 |
--- a/webrtc/video/video_capture_input_unittest.cc |
+++ b/webrtc/video/video_capture_input_unittest.cc |
@@ -16,6 +16,7 @@ |
#include "webrtc/base/event.h" |
#include "webrtc/base/scoped_ptr.h" |
#include "webrtc/modules/utility/include/mock/mock_process_thread.h" |
+#include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h" |
#include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
#include "webrtc/system_wrappers/include/ref_count.h" |
#include "webrtc/system_wrappers/include/scoped_vector.h" |
@@ -48,21 +49,26 @@ VideoFrame* CreateVideoFrame(uint8_t length); |
class VideoCaptureInputTest : public ::testing::Test { |
protected: |
VideoCaptureInputTest() |
- : mock_process_thread_(new NiceMock<MockProcessThread>), |
- mock_frame_callback_(new NiceMock<MockVideoCaptureCallback>), |
+ : vcm_(VideoCodingModule::Create(Clock::GetRealTimeClock(), |
+ nullptr, |
+ nullptr)), |
output_frame_event_(false, false), |
stats_proxy_(Clock::GetRealTimeClock(), |
webrtc::VideoSendStream::Config(nullptr), |
webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo) {} |
virtual void SetUp() { |
- EXPECT_CALL(*mock_frame_callback_, DeliverFrame(_)) |
+ EXPECT_CALL(mock_frame_callback_, DeliverFrame(_)) |
.WillRepeatedly( |
WithArg<0>(Invoke(this, &VideoCaptureInputTest::AddOutputFrame))); |
+ VideoSendStream::Config config(nullptr); |
+ config.encoder_settings.encoder = &mock_encoder_; |
+ config.encoder_settings.payload_type = 42; |
input_.reset(new internal::VideoCaptureInput( |
- mock_process_thread_.get(), mock_frame_callback_.get(), nullptr, |
- &stats_proxy_, nullptr, nullptr)); |
+ &mock_process_thread_, &mock_frame_callback_, vcm_.get(), nullptr, |
+ config, &stats_proxy_, nullptr)); |
+ input_->TriggerSetSendCodec(VideoCodec()); |
} |
virtual void TearDown() { |
@@ -87,8 +93,10 @@ class VideoCaptureInputTest : public ::testing::Test { |
EXPECT_TRUE(output_frame_event_.Wait(FRAME_TIMEOUT_MS)); |
} |
- rtc::scoped_ptr<MockProcessThread> mock_process_thread_; |
- rtc::scoped_ptr<MockVideoCaptureCallback> mock_frame_callback_; |
+ NiceMock<MockProcessThread> mock_process_thread_; |
+ NiceMock<MockVideoCaptureCallback> mock_frame_callback_; |
+ rtc::scoped_ptr<VideoCodingModule> vcm_; |
+ NiceMock<MockVideoEncoder> mock_encoder_; |
// Used to send input capture frames to VideoCaptureInput. |
rtc::scoped_ptr<internal::VideoCaptureInput> input_; |