OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 217 |
218 state_observer_.reset(new StateObserver(source_)); | 218 state_observer_.reset(new StateObserver(source_)); |
219 source_->RegisterObserver(state_observer_.get()); | 219 source_->RegisterObserver(state_observer_.get()); |
220 source_->AddSink(&renderer_); | 220 source_->AddSink(&renderer_); |
221 | 221 |
222 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), | 222 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
223 kMaxWaitMs); | 223 kMaxWaitMs); |
224 | 224 |
225 cricket::VideoRenderer* frameinput = source_->FrameInput(); | 225 cricket::VideoRenderer* frameinput = source_->FrameInput(); |
226 cricket::WebRtcVideoFrame test_frame; | 226 cricket::WebRtcVideoFrame test_frame; |
227 frameinput->SetSize(1280, 720, 0); | |
228 frameinput->RenderFrame(&test_frame); | 227 frameinput->RenderFrame(&test_frame); |
229 EXPECT_EQ(1, renderer_.num_rendered_frames()); | 228 EXPECT_EQ(1, renderer_.num_rendered_frames()); |
230 | 229 |
231 source_->GetVideoCapturer()->Stop(); | 230 source_->GetVideoCapturer()->Stop(); |
232 EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), | 231 EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), |
233 kMaxWaitMs); | 232 kMaxWaitMs); |
234 } | 233 } |
235 | 234 |
236 // Test that a VideoSource transition to kEnded if the capture device | 235 // Test that a VideoSource transition to kEnded if the capture device |
237 // fails. | 236 // fails. |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 FakeConstraints constraints; | 542 FakeConstraints constraints; |
544 constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5); | 543 constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5); |
545 | 544 |
546 CreateVideoSource(&constraints); | 545 CreateVideoSource(&constraints); |
547 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), | 546 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
548 kMaxWaitMs); | 547 kMaxWaitMs); |
549 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); | 548 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); |
550 ASSERT_TRUE(format != NULL); | 549 ASSERT_TRUE(format != NULL); |
551 EXPECT_EQ(30, format->framerate()); | 550 EXPECT_EQ(30, format->framerate()); |
552 } | 551 } |
553 | |
OLD | NEW |