Enable SendAndReceive tests.
Also fixes a crash in ::SetCapturer which wasn't exposed by tests before. BUG=1788 R=wu@webrtc.org Review URL: https://webrtc-codereview.appspot.com/18019005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6765 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
		@@ -1402,7 +1402,8 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetCapturer(
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    talk_base::CritScope cs(&lock_);
 | 
					    talk_base::CritScope cs(&lock_);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (capturer == NULL && stream_ != NULL) {
 | 
					    if (capturer == NULL) {
 | 
				
			||||||
 | 
					      if (stream_ != NULL) {
 | 
				
			||||||
        LOG(LS_VERBOSE) << "Disabling capturer, sending black frame.";
 | 
					        LOG(LS_VERBOSE) << "Disabling capturer, sending black frame.";
 | 
				
			||||||
        webrtc::I420VideoFrame black_frame;
 | 
					        webrtc::I420VideoFrame black_frame;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1414,6 +1415,7 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetCapturer(
 | 
				
			|||||||
        SetWebRtcFrameToBlack(&black_frame);
 | 
					        SetWebRtcFrameToBlack(&black_frame);
 | 
				
			||||||
        SetDimensions(width, height);
 | 
					        SetDimensions(width, height);
 | 
				
			||||||
        stream_->Input()->SwapFrame(&black_frame);
 | 
					        stream_->Input()->SwapFrame(&black_frame);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      capturer_ = NULL;
 | 
					      capturer_ = NULL;
 | 
				
			||||||
      return true;
 | 
					      return true;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -542,6 +542,18 @@ WEBRTC_BASE_TEST(SetSendStreamFormat0x0);
 | 
				
			|||||||
// TODO(zhurunz): Fix the flakey test.
 | 
					// TODO(zhurunz): Fix the flakey test.
 | 
				
			||||||
WEBRTC_DISABLED_BASE_TEST(SetSendStreamFormat);
 | 
					WEBRTC_DISABLED_BASE_TEST(SetSendStreamFormat);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Vga) {
 | 
				
			||||||
 | 
					  SendAndReceive(cricket::VideoCodec(100, "VP8", 640, 400, 30, 0));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Qvga) {
 | 
				
			||||||
 | 
					  SendAndReceive(cricket::VideoCodec(100, "VP8", 320, 200, 30, 0));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8SvcQqvga) {
 | 
				
			||||||
 | 
					  SendAndReceive(cricket::VideoCodec(100, "VP8", 160, 100, 30, 0));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST_F(WebRtcVideoChannel2BaseTest, TwoStreamsSendAndReceive) {
 | 
					TEST_F(WebRtcVideoChannel2BaseTest, TwoStreamsSendAndReceive) {
 | 
				
			||||||
  Base::TwoStreamsSendAndReceive(kVp8Codec);
 | 
					  Base::TwoStreamsSendAndReceive(kVp8Codec);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -550,6 +562,32 @@ TEST_F(WebRtcVideoChannel2BaseTest, TwoStreamsReUseFirstStream) {
 | 
				
			|||||||
  Base::TwoStreamsReUseFirstStream(kVp8Codec);
 | 
					  Base::TwoStreamsReUseFirstStream(kVp8Codec);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WEBRTC_BASE_TEST(SendManyResizeOnce);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// TODO(pbos): Enable and figure out why this fails (or should work).
 | 
				
			||||||
 | 
					TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_SendVp8HdAndReceiveAdaptedVp8Vga) {
 | 
				
			||||||
 | 
					  EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL));
 | 
				
			||||||
 | 
					  EXPECT_TRUE(channel_->SetRenderer(kDefaultReceiveSsrc, &renderer_));
 | 
				
			||||||
 | 
					  channel_->UpdateAspectRatio(1280, 720);
 | 
				
			||||||
 | 
					  video_capturer_.reset(new cricket::FakeVideoCapturer);
 | 
				
			||||||
 | 
					  const std::vector<cricket::VideoFormat>* formats =
 | 
				
			||||||
 | 
					      video_capturer_->GetSupportedFormats();
 | 
				
			||||||
 | 
					  cricket::VideoFormat capture_format_hd = (*formats)[0];
 | 
				
			||||||
 | 
					  EXPECT_EQ(cricket::CS_RUNNING, video_capturer_->Start(capture_format_hd));
 | 
				
			||||||
 | 
					  EXPECT_TRUE(channel_->SetCapturer(kSsrc, video_capturer_.get()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Capture format HD -> adapt (OnOutputFormatRequest VGA) -> VGA.
 | 
				
			||||||
 | 
					  cricket::VideoCodec codec(100, "VP8", 1280, 720, 30, 0);
 | 
				
			||||||
 | 
					  EXPECT_TRUE(SetOneCodec(codec));
 | 
				
			||||||
 | 
					  codec.width /= 2;
 | 
				
			||||||
 | 
					  codec.height /= 2;
 | 
				
			||||||
 | 
					  EXPECT_TRUE(SetSend(true));
 | 
				
			||||||
 | 
					  EXPECT_TRUE(channel_->SetRender(true));
 | 
				
			||||||
 | 
					  EXPECT_EQ(0, renderer_.num_rendered_frames());
 | 
				
			||||||
 | 
					  EXPECT_TRUE(SendFrame());
 | 
				
			||||||
 | 
					  EXPECT_FRAME_WAIT(1, codec.width, codec.height, kTimeout);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test {
 | 
					class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test {
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
  virtual void SetUp() OVERRIDE {
 | 
					  virtual void SetUp() OVERRIDE {
 | 
				
			||||||
@@ -1494,26 +1532,6 @@ TEST_F(WebRtcVideoChannel2Test, SetSend) {
 | 
				
			|||||||
      << "Send stream created after SetSend(true) not sending initially.";
 | 
					      << "Send stream created after SetSend(true) not sending initially.";
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST_F(WebRtcVideoChannel2Test, DISABLED_SendAndReceiveVp8Vga) {
 | 
					 | 
				
			||||||
  FAIL() << "Not implemented.";  // TODO(pbos): Implement.
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TEST_F(WebRtcVideoChannel2Test, DISABLED_SendAndReceiveVp8Qvga) {
 | 
					 | 
				
			||||||
  FAIL() << "Not implemented.";  // TODO(pbos): Implement.
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TEST_F(WebRtcVideoChannel2Test, DISABLED_SendAndReceiveH264SvcQqvga) {
 | 
					 | 
				
			||||||
  FAIL() << "Not implemented.";  // TODO(pbos): Implement.
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TEST_F(WebRtcVideoChannel2Test, DISABLED_SendManyResizeOnce) {
 | 
					 | 
				
			||||||
  FAIL() << "Not implemented.";  // TODO(pbos): Implement.
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TEST_F(WebRtcVideoChannel2Test, DISABLED_SendVp8HdAndReceiveAdaptedVp8Vga) {
 | 
					 | 
				
			||||||
  FAIL() << "Not implemented.";  // TODO(pbos): Implement.
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TEST_F(WebRtcVideoChannel2Test, DISABLED_TestSetDscpOptions) {
 | 
					TEST_F(WebRtcVideoChannel2Test, DISABLED_TestSetDscpOptions) {
 | 
				
			||||||
  FAIL() << "Not implemented.";  // TODO(pbos): Implement.
 | 
					  FAIL() << "Not implemented.";  // TODO(pbos): Implement.
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user