diff options
Diffstat (limited to 'webrtc/video/video_send_stream_tests.cc')
-rw-r--r-- | webrtc/video/video_send_stream_tests.cc | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc index e21474dfb8..72fab4bc23 100644 --- a/webrtc/video/video_send_stream_tests.cc +++ b/webrtc/video/video_send_stream_tests.cc @@ -266,35 +266,6 @@ class FakeReceiveStatistics : public NullReceiveStatistics { StatisticianMap stats_map_; }; -TEST_F(VideoSendStreamTest, SwapsI420VideoFrames) { - static const size_t kWidth = 320; - static const size_t kHeight = 240; - - test::NullTransport transport; - Call::Config call_config(&transport); - CreateSenderCall(call_config); - - CreateSendConfig(1); - CreateStreams(); - send_stream_->Start(); - - I420VideoFrame frame; - const int stride_uv = (kWidth + 1) / 2; - frame.CreateEmptyFrame(kWidth, kHeight, kWidth, stride_uv, stride_uv); - uint8_t* old_y_buffer = frame.buffer(kYPlane); - // Initialize memory to avoid DrMemory errors. - const int half_height = (kHeight + 1) / 2; - memset(frame.buffer(kYPlane), 0, kWidth * kHeight); - memset(frame.buffer(kUPlane), 0, stride_uv * half_height); - memset(frame.buffer(kVPlane), 0, stride_uv * half_height); - - send_stream_->Input()->SwapFrame(&frame); - - EXPECT_NE(frame.buffer(kYPlane), old_y_buffer); - - DestroyStreams(); -} - TEST_F(VideoSendStreamTest, SupportsFec) { class FecObserver : public test::SendTest { public: @@ -1044,15 +1015,13 @@ TEST_F(VideoSendStreamTest, CapturesTextureAndI420VideoFrames) { new webrtc::RefCountImpl<FakeNativeHandle>(); input_frames.push_back(new I420VideoFrame(handle1, width, height, 1, 1)); input_frames.push_back(new I420VideoFrame(handle2, width, height, 2, 2)); - input_frames.push_back(CreateI420VideoFrame(width, height, 1)); - input_frames.push_back(CreateI420VideoFrame(width, height, 2)); - input_frames.push_back(new I420VideoFrame(handle3, width, height, 3, 3)); + input_frames.push_back(CreateI420VideoFrame(width, height, 3)); + input_frames.push_back(CreateI420VideoFrame(width, height, 4)); + input_frames.push_back(new I420VideoFrame(handle3, width, height, 5, 5)); send_stream_->Start(); for (size_t i = 0; i < input_frames.size(); i++) { - // Make a copy of the input frame because the buffer will be swapped. - rtc::scoped_ptr<I420VideoFrame> frame(input_frames[i]->CloneFrame()); - send_stream_->Input()->SwapFrame(frame.get()); + send_stream_->Input()->IncomingCapturedFrame(*input_frames[i]); // Do not send the next frame too fast, so the frame dropper won't drop it. if (i < input_frames.size() - 1) SleepMs(1000 / encoder_config_.streams[0].max_framerate); @@ -1082,6 +1051,7 @@ void ExpectEqualTextureFrames(const I420VideoFrame& frame1, EXPECT_EQ(frame1.native_handle(), frame2.native_handle()); EXPECT_EQ(frame1.width(), frame2.width()); EXPECT_EQ(frame1.height(), frame2.height()); + EXPECT_EQ(frame1.render_time_ms(), frame2.render_time_ms()); } void ExpectEqualBufferFrames(const I420VideoFrame& frame1, @@ -1091,7 +1061,7 @@ void ExpectEqualBufferFrames(const I420VideoFrame& frame1, EXPECT_EQ(frame1.stride(kYPlane), frame2.stride(kYPlane)); EXPECT_EQ(frame1.stride(kUPlane), frame2.stride(kUPlane)); EXPECT_EQ(frame1.stride(kVPlane), frame2.stride(kVPlane)); - EXPECT_EQ(frame1.ntp_time_ms(), frame2.ntp_time_ms()); + EXPECT_EQ(frame1.render_time_ms(), frame2.render_time_ms()); ASSERT_EQ(frame1.allocated_size(kYPlane), frame2.allocated_size(kYPlane)); EXPECT_EQ(0, memcmp(frame1.buffer(kYPlane), @@ -1134,7 +1104,6 @@ I420VideoFrame* CreateI420VideoFrame(int width, int height, uint8_t data) { width / 2, width / 2); frame->set_timestamp(data); - frame->set_ntp_time_ms(data); frame->set_render_time_ms(data); return frame; } |