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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 // initialization. | 660 // initialization. |
661 cricket::VideoFormat format( | 661 cricket::VideoFormat format( |
662 1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420); | 662 1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420); |
663 EXPECT_TRUE(channel->SetSendStreamFormat(ssrcs[0], format)); | 663 EXPECT_TRUE(channel->SetSendStreamFormat(ssrcs[0], format)); |
664 ASSERT_EQ(1u, encoder_factory.encoders().size()); | 664 ASSERT_EQ(1u, encoder_factory.encoders().size()); |
665 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0]; | 665 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0]; |
666 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType); | 666 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType); |
667 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams); | 667 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams); |
668 } | 668 } |
669 | 669 |
670 // Test external codec with be added to the end of the supported codec list. | 670 // Test that external codecs are added to the end of the supported codec list. |
671 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { | 671 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { |
672 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; | 672 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; |
673 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264"); | 673 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecUnknown, |
| 674 "FakeExternalCodec"); |
674 engine_.SetExternalEncoderFactory(&encoder_factory); | 675 engine_.SetExternalEncoderFactory(&encoder_factory); |
675 engine_.Init(); | 676 engine_.Init(); |
676 | 677 |
677 std::vector<cricket::VideoCodec> codecs(engine_.codecs()); | 678 std::vector<cricket::VideoCodec> codecs(engine_.codecs()); |
678 ASSERT_GE(codecs.size(), 2u); | 679 ASSERT_GE(codecs.size(), 2u); |
679 cricket::VideoCodec internal_codec = codecs.front(); | 680 cricket::VideoCodec internal_codec = codecs.front(); |
680 cricket::VideoCodec external_codec = codecs.back(); | 681 cricket::VideoCodec external_codec = codecs.back(); |
681 | 682 |
682 // The external codec will appear at last. | 683 // The external codec will appear at last. |
683 EXPECT_EQ("VP8", internal_codec.name); | 684 EXPECT_EQ("VP8", internal_codec.name); |
684 EXPECT_EQ("H264", external_codec.name); | 685 EXPECT_EQ("FakeExternalCodec", external_codec.name); |
685 } | 686 } |
686 | 687 |
687 TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) { | 688 TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) { |
688 cricket::FakeWebRtcVideoDecoderFactory decoder_factory; | 689 cricket::FakeWebRtcVideoDecoderFactory decoder_factory; |
689 decoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8); | 690 decoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8); |
690 std::vector<cricket::VideoCodec> codecs; | 691 std::vector<cricket::VideoCodec> codecs; |
691 codecs.push_back(kVp8Codec); | 692 codecs.push_back(kVp8Codec); |
692 | 693 |
693 rtc::scoped_ptr<VideoMediaChannel> channel( | 694 rtc::scoped_ptr<VideoMediaChannel> channel( |
694 SetUpForExternalDecoderFactory(&decoder_factory, codecs)); | 695 SetUpForExternalDecoderFactory(&decoder_factory, codecs)); |
(...skipping 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3180 // Ensures that the correct settings are applied to the codec when two temporal | 3181 // Ensures that the correct settings are applied to the codec when two temporal |
3181 // layer screencasting is enabled, and that the correct simulcast settings are | 3182 // layer screencasting is enabled, and that the correct simulcast settings are |
3182 // reapplied when disabling screencasting. | 3183 // reapplied when disabling screencasting. |
3183 TEST_F(WebRtcVideoChannel2SimulcastTest, | 3184 TEST_F(WebRtcVideoChannel2SimulcastTest, |
3184 DISABLED_TwoTemporalLayerScreencastSettings) { | 3185 DISABLED_TwoTemporalLayerScreencastSettings) { |
3185 // TODO(pbos): Implement. | 3186 // TODO(pbos): Implement. |
3186 FAIL() << "Not implemented."; | 3187 FAIL() << "Not implemented."; |
3187 } | 3188 } |
3188 | 3189 |
3189 } // namespace cricket | 3190 } // namespace cricket |
OLD | NEW |