diff options
author | mallinath@webrtc.org <mallinath@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-01-11 01:26:23 +0000 |
---|---|---|
committer | mallinath@webrtc.org <mallinath@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-01-11 01:26:23 +0000 |
commit | 3e7165a8379ea0fd37ca04af1a95dff0568c8775 (patch) | |
tree | b77d5216b8c33aa373ab4ec2713964c34cf7de7a /media/base/videoengine_unittest.h | |
parent | 849bc5c7da2849d7065c063dec016775e1a5db10 (diff) | |
download | talk-3e7165a8379ea0fd37ca04af1a95dff0568c8775.tar.gz |
Update talk to 59410372.
R=jiayl@webrtc.org, wu@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/6929004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@5367 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'media/base/videoengine_unittest.h')
-rw-r--r-- | media/base/videoengine_unittest.h | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/media/base/videoengine_unittest.h b/media/base/videoengine_unittest.h index d9266f2..2ffd14b 100644 --- a/media/base/videoengine_unittest.h +++ b/media/base/videoengine_unittest.h @@ -893,8 +893,11 @@ class VideoMediaChannelTest : public testing::Test, talk_base::scoped_ptr<cricket::FakeVideoCapturer> capturer( new cricket::FakeVideoCapturer); capturer->SetScreencast(true); - cricket::VideoFormat format(1024, 768, - cricket::VideoFormat::FpsToInterval(5), 0); + const int kTestWidth = 160; + const int kTestHeight = 120; + cricket::VideoFormat format(kTestWidth, kTestHeight, + cricket::VideoFormat::FpsToInterval(5), + cricket::FOURCC_I420); EXPECT_EQ(cricket::CS_RUNNING, capturer->Start(format)); EXPECT_TRUE(channel_->AddSendStream( cricket::StreamParams::CreateLegacy(5678))); @@ -902,8 +905,10 @@ class VideoMediaChannelTest : public testing::Test, EXPECT_TRUE(channel_->AddRecvStream( cricket::StreamParams::CreateLegacy(5678))); EXPECT_TRUE(channel_->SetRenderer(5678, &renderer1)); - EXPECT_TRUE(capturer->CaptureCustomFrame(1024, 768, cricket::FOURCC_I420)); - EXPECT_FRAME_ON_RENDERER_WAIT(renderer1, 1, 1024, 768, kTimeout); + EXPECT_TRUE(capturer->CaptureCustomFrame( + kTestWidth, kTestHeight, cricket::FOURCC_I420)); + EXPECT_FRAME_ON_RENDERER_WAIT( + renderer1, 1, kTestWidth, kTestHeight, kTimeout); // Get stats, and make sure they are correct for two senders. cricket::VideoMediaInfo info; @@ -917,8 +922,8 @@ class VideoMediaChannelTest : public testing::Test, EXPECT_EQ(DefaultCodec().height, info.senders[0].frame_height); EXPECT_EQ(1U, info.senders[1].ssrcs().size()); EXPECT_EQ(5678U, info.senders[1].ssrcs()[0]); - EXPECT_EQ(1024, info.senders[1].frame_width); - EXPECT_EQ(768, info.senders[1].frame_height); + EXPECT_EQ(kTestWidth, info.senders[1].frame_width); + EXPECT_EQ(kTestHeight, info.senders[1].frame_height); // The capturer must be unregistered here as it runs out of it's scope next. EXPECT_TRUE(channel_->SetCapturer(5678, NULL)); } @@ -1221,9 +1226,11 @@ class VideoMediaChannelTest : public testing::Test, // Tests that we can add and remove capturers and frames are sent out properly void AddRemoveCapturer() { - const cricket::VideoCodec codec(DefaultCodec()); + cricket::VideoCodec codec = DefaultCodec(); + codec.width = 320; + codec.height = 240; const int time_between_send = TimeBetweenSend(codec); - EXPECT_TRUE(SetDefaultCodec()); + EXPECT_TRUE(SetOneCodec(codec)); EXPECT_TRUE(SetSend(true)); EXPECT_TRUE(channel_->SetRender(true)); EXPECT_EQ(0, renderer_.num_rendered_frames()); @@ -1232,8 +1239,9 @@ class VideoMediaChannelTest : public testing::Test, talk_base::scoped_ptr<cricket::FakeVideoCapturer> capturer( new cricket::FakeVideoCapturer); capturer->SetScreencast(true); - cricket::VideoFormat format(1024, 768, - cricket::VideoFormat::FpsToInterval(30), 0); + cricket::VideoFormat format(480, 360, + cricket::VideoFormat::FpsToInterval(30), + cricket::FOURCC_I420); EXPECT_EQ(cricket::CS_RUNNING, capturer->Start(format)); // All capturers start generating frames with the same timestamp. ViE does // not allow the same timestamp to be used. Capture one frame before @@ -1305,11 +1313,6 @@ class VideoMediaChannelTest : public testing::Test, void AddRemoveCapturerMultipleSources() { // WebRTC implementation will drop frames if pushed to quickly. Wait the // interval time to avoid that. - const cricket::VideoFormat send_format( - 1024, - 768, - cricket::VideoFormat::FpsToInterval(30), - 0); // WebRTC implementation will drop frames if pushed to quickly. Wait the // interval time to avoid that. // Set up the stream associated with the engine. @@ -1352,11 +1355,17 @@ class VideoMediaChannelTest : public testing::Test, EXPECT_TRUE(SetSend(true)); EXPECT_TRUE(channel_->SetRender(true)); // Test capturer associated with engine. - EXPECT_TRUE(capturer1->CaptureCustomFrame(1024, 768, cricket::FOURCC_I420)); - EXPECT_FRAME_ON_RENDERER_WAIT(renderer1, 1, 1024, 768, kTimeout); + const int kTestWidth = 160; + const int kTestHeight = 120; + EXPECT_TRUE(capturer1->CaptureCustomFrame( + kTestWidth, kTestHeight, cricket::FOURCC_I420)); + EXPECT_FRAME_ON_RENDERER_WAIT( + renderer1, 1, kTestWidth, kTestHeight, kTimeout); // Capture a frame with additional capturer2, frames should be received - EXPECT_TRUE(capturer2->CaptureCustomFrame(1024, 768, cricket::FOURCC_I420)); - EXPECT_FRAME_ON_RENDERER_WAIT(renderer2, 1, 1024, 768, kTimeout); + EXPECT_TRUE(capturer2->CaptureCustomFrame( + kTestWidth, kTestHeight, cricket::FOURCC_I420)); + EXPECT_FRAME_ON_RENDERER_WAIT( + renderer2, 1, kTestWidth, kTestHeight, kTimeout); // Successfully remove the capturer. EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); // Fail to re-remove the capturer. |