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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc))); | 637 channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc))); |
638 ASSERT_EQ(1u, encoder_factory.encoders().size()); | 638 ASSERT_EQ(1u, encoder_factory.encoders().size()); |
639 EXPECT_EQ(webrtc::kVideoCodecH264, | 639 EXPECT_EQ(webrtc::kVideoCodecH264, |
640 encoder_factory.encoders()[0]->GetCodecSettings().codecType); | 640 encoder_factory.encoders()[0]->GetCodecSettings().codecType); |
641 | 641 |
642 channel.reset(); | 642 channel.reset(); |
643 // Make sure DestroyVideoEncoder was called on the factory. | 643 // Make sure DestroyVideoEncoder was called on the factory. |
644 ASSERT_EQ(0u, encoder_factory.encoders().size()); | 644 ASSERT_EQ(0u, encoder_factory.encoders().size()); |
645 } | 645 } |
646 | 646 |
| 647 TEST_F(WebRtcVideoEngine2Test, SimulcastDisabledForH264) { |
| 648 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; |
| 649 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264"); |
| 650 std::vector<cricket::VideoCodec> codecs; |
| 651 codecs.push_back(kH264Codec); |
| 652 |
| 653 rtc::scoped_ptr<VideoMediaChannel> channel( |
| 654 SetUpForExternalEncoderFactory(&encoder_factory, codecs)); |
| 655 |
| 656 const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs3); |
| 657 EXPECT_TRUE( |
| 658 channel->AddSendStream(cricket::CreateSimStreamParams("cname", ssrcs))); |
| 659 // Set the stream to 720p. This should trigger a "real" encoder |
| 660 // initialization. |
| 661 cricket::VideoFormat format( |
| 662 1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420); |
| 663 EXPECT_TRUE(channel->SetSendStreamFormat(ssrcs[0], format)); |
| 664 ASSERT_EQ(1u, encoder_factory.encoders().size()); |
| 665 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0]; |
| 666 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType); |
| 667 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams); |
| 668 } |
| 669 |
647 // Test external codec with be added to the end of the supported codec list. | 670 // Test external codec with be added to the end of the supported codec list. |
648 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { | 671 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { |
649 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; | 672 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; |
650 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264"); | 673 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264"); |
651 engine_.SetExternalEncoderFactory(&encoder_factory); | 674 engine_.SetExternalEncoderFactory(&encoder_factory); |
652 engine_.Init(); | 675 engine_.Init(); |
653 | 676 |
654 std::vector<cricket::VideoCodec> codecs(engine_.codecs()); | 677 std::vector<cricket::VideoCodec> codecs(engine_.codecs()); |
655 ASSERT_GE(codecs.size(), 2u); | 678 ASSERT_GE(codecs.size(), 2u); |
656 cricket::VideoCodec internal_codec = codecs.front(); | 679 cricket::VideoCodec internal_codec = codecs.front(); |
(...skipping 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3142 // Ensures that the correct settings are applied to the codec when two temporal | 3165 // Ensures that the correct settings are applied to the codec when two temporal |
3143 // layer screencasting is enabled, and that the correct simulcast settings are | 3166 // layer screencasting is enabled, and that the correct simulcast settings are |
3144 // reapplied when disabling screencasting. | 3167 // reapplied when disabling screencasting. |
3145 TEST_F(WebRtcVideoChannel2SimulcastTest, | 3168 TEST_F(WebRtcVideoChannel2SimulcastTest, |
3146 DISABLED_TwoTemporalLayerScreencastSettings) { | 3169 DISABLED_TwoTemporalLayerScreencastSettings) { |
3147 // TODO(pbos): Implement. | 3170 // TODO(pbos): Implement. |
3148 FAIL() << "Not implemented."; | 3171 FAIL() << "Not implemented."; |
3149 } | 3172 } |
3150 | 3173 |
3151 } // namespace cricket | 3174 } // namespace cricket |
OLD | NEW |