OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264"); | 698 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264"); |
699 std::vector<cricket::VideoCodec> codecs; | 699 std::vector<cricket::VideoCodec> codecs; |
700 codecs.push_back(kH264Codec); | 700 codecs.push_back(kH264Codec); |
701 | 701 |
702 rtc::scoped_ptr<VideoMediaChannel> channel( | 702 rtc::scoped_ptr<VideoMediaChannel> channel( |
703 SetUpForExternalEncoderFactory(&encoder_factory, codecs)); | 703 SetUpForExternalEncoderFactory(&encoder_factory, codecs)); |
704 | 704 |
705 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3); | 705 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3); |
706 EXPECT_TRUE( | 706 EXPECT_TRUE( |
707 channel->AddSendStream(cricket::CreateSimStreamParams("cname", ssrcs))); | 707 channel->AddSendStream(cricket::CreateSimStreamParams("cname", ssrcs))); |
708 // Set the stream to 720p. This should trigger a "real" encoder | 708 |
709 // initialization. | 709 // Send a frame of 720p. This should trigger a "real" encoder initialization. |
710 cricket::VideoFormat format( | 710 cricket::VideoFormat format( |
711 1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420); | 711 1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420); |
712 EXPECT_TRUE(channel->SetSendStreamFormat(ssrcs[0], format)); | 712 cricket::FakeVideoCapturer capturer; |
| 713 EXPECT_TRUE(channel->SetCapturer(ssrcs[0], &capturer)); |
| 714 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(format)); |
| 715 EXPECT_TRUE(capturer.CaptureFrame()); |
| 716 |
713 ASSERT_EQ(1u, encoder_factory.encoders().size()); | 717 ASSERT_EQ(1u, encoder_factory.encoders().size()); |
714 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0]; | 718 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0]; |
715 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType); | 719 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType); |
716 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams); | 720 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams); |
| 721 EXPECT_TRUE(channel->SetCapturer(ssrcs[0], nullptr)); |
717 } | 722 } |
718 | 723 |
719 // Test that external codecs are added to the end of the supported codec list. | 724 // Test that external codecs are added to the end of the supported codec list. |
720 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { | 725 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { |
721 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; | 726 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; |
722 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecUnknown, | 727 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecUnknown, |
723 "FakeExternalCodec"); | 728 "FakeExternalCodec"); |
724 engine_.SetExternalEncoderFactory(&encoder_factory); | 729 engine_.SetExternalEncoderFactory(&encoder_factory); |
725 engine_.Init(); | 730 engine_.Init(); |
726 | 731 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 WEBRTC_DISABLED_BASE_TEST(AdaptDropAllFrames); | 835 WEBRTC_DISABLED_BASE_TEST(AdaptDropAllFrames); |
831 // TODO(juberti): Understand why we get decode errors on this test. | 836 // TODO(juberti): Understand why we get decode errors on this test. |
832 WEBRTC_DISABLED_BASE_TEST(AdaptFramerate); | 837 WEBRTC_DISABLED_BASE_TEST(AdaptFramerate); |
833 | 838 |
834 WEBRTC_BASE_TEST(SendsLowerResolutionOnSmallerFrames); | 839 WEBRTC_BASE_TEST(SendsLowerResolutionOnSmallerFrames); |
835 | 840 |
836 WEBRTC_BASE_TEST(MuteStream); | 841 WEBRTC_BASE_TEST(MuteStream); |
837 | 842 |
838 WEBRTC_BASE_TEST(MultipleSendStreams); | 843 WEBRTC_BASE_TEST(MultipleSendStreams); |
839 | 844 |
840 WEBRTC_BASE_TEST(SetSendStreamFormat0x0); | |
841 | |
842 // TODO(zhurunz): Fix the flakey test. | |
843 WEBRTC_DISABLED_BASE_TEST(SetSendStreamFormat); | |
844 | |
845 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Vga) { | 845 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Vga) { |
846 SendAndReceive(cricket::VideoCodec(100, "VP8", 640, 400, 30, 0)); | 846 SendAndReceive(cricket::VideoCodec(100, "VP8", 640, 400, 30, 0)); |
847 } | 847 } |
848 | 848 |
849 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Qvga) { | 849 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Qvga) { |
850 SendAndReceive(cricket::VideoCodec(100, "VP8", 320, 200, 30, 0)); | 850 SendAndReceive(cricket::VideoCodec(100, "VP8", 320, 200, 30, 0)); |
851 } | 851 } |
852 | 852 |
853 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8SvcQqvga) { | 853 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8SvcQqvga) { |
854 SendAndReceive(cricket::VideoCodec(100, "VP8", 160, 100, 30, 0)); | 854 SendAndReceive(cricket::VideoCodec(100, "VP8", 160, 100, 30, 0)); |
(...skipping 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3097 // Test that we normalize send codec format size in simulcast. | 3097 // Test that we normalize send codec format size in simulcast. |
3098 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3098 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
3099 cricket::VideoCodec codec(kVp8Codec270p); | 3099 cricket::VideoCodec codec(kVp8Codec270p); |
3100 codec.width += 1; | 3100 codec.width += 1; |
3101 codec.height += 1; | 3101 codec.height += 1; |
3102 VerifySimulcastSettings(codec, 2, 2); | 3102 VerifySimulcastSettings(codec, 2, 2); |
3103 } | 3103 } |
3104 } // namespace cricket | 3104 } // namespace cricket |
3105 | 3105 |
3106 #endif // HAVE_WEBRTC_VIDEO | 3106 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |