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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 // initialization. | 701 // initialization. |
702 cricket::VideoFormat format( | 702 cricket::VideoFormat format( |
703 1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420); | 703 1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420); |
704 EXPECT_TRUE(channel->SetSendStreamFormat(ssrcs[0], format)); | 704 EXPECT_TRUE(channel->SetSendStreamFormat(ssrcs[0], format)); |
705 ASSERT_EQ(1u, encoder_factory.encoders().size()); | 705 ASSERT_EQ(1u, encoder_factory.encoders().size()); |
706 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0]; | 706 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0]; |
707 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType); | 707 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType); |
708 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams); | 708 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams); |
709 } | 709 } |
710 | 710 |
711 // Test external codec with be added to the end of the supported codec list. | 711 // Test that external codecs are added to the end of the supported codec list. |
712 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { | 712 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { |
713 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; | 713 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; |
714 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264"); | 714 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecUnknown, |
| 715 "FakeExternalCodec"); |
715 engine_.SetExternalEncoderFactory(&encoder_factory); | 716 engine_.SetExternalEncoderFactory(&encoder_factory); |
716 engine_.Init(); | 717 engine_.Init(); |
717 | 718 |
718 std::vector<cricket::VideoCodec> codecs(engine_.codecs()); | 719 std::vector<cricket::VideoCodec> codecs(engine_.codecs()); |
719 ASSERT_GE(codecs.size(), 2u); | 720 ASSERT_GE(codecs.size(), 2u); |
720 cricket::VideoCodec internal_codec = codecs.front(); | 721 cricket::VideoCodec internal_codec = codecs.front(); |
721 cricket::VideoCodec external_codec = codecs.back(); | 722 cricket::VideoCodec external_codec = codecs.back(); |
722 | 723 |
723 // The external codec will appear at last. | 724 // The external codec will appear at last. |
724 EXPECT_EQ("VP8", internal_codec.name); | 725 EXPECT_EQ("VP8", internal_codec.name); |
725 EXPECT_EQ("H264", external_codec.name); | 726 EXPECT_EQ("FakeExternalCodec", external_codec.name); |
726 } | 727 } |
727 | 728 |
728 TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) { | 729 TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) { |
729 cricket::FakeWebRtcVideoDecoderFactory decoder_factory; | 730 cricket::FakeWebRtcVideoDecoderFactory decoder_factory; |
730 decoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8); | 731 decoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8); |
731 cricket::VideoRecvParameters parameters; | 732 cricket::VideoRecvParameters parameters; |
732 parameters.codecs.push_back(kVp8Codec); | 733 parameters.codecs.push_back(kVp8Codec); |
733 | 734 |
734 rtc::scoped_ptr<VideoMediaChannel> channel( | 735 rtc::scoped_ptr<VideoMediaChannel> channel( |
735 SetUpForExternalDecoderFactory(&decoder_factory, parameters.codecs)); | 736 SetUpForExternalDecoderFactory(&decoder_factory, parameters.codecs)); |
(...skipping 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3201 // Ensures that the correct settings are applied to the codec when two temporal | 3202 // Ensures that the correct settings are applied to the codec when two temporal |
3202 // layer screencasting is enabled, and that the correct simulcast settings are | 3203 // layer screencasting is enabled, and that the correct simulcast settings are |
3203 // reapplied when disabling screencasting. | 3204 // reapplied when disabling screencasting. |
3204 TEST_F(WebRtcVideoChannel2SimulcastTest, | 3205 TEST_F(WebRtcVideoChannel2SimulcastTest, |
3205 DISABLED_TwoTemporalLayerScreencastSettings) { | 3206 DISABLED_TwoTemporalLayerScreencastSettings) { |
3206 // TODO(pbos): Implement. | 3207 // TODO(pbos): Implement. |
3207 FAIL() << "Not implemented."; | 3208 FAIL() << "Not implemented."; |
3208 } | 3209 } |
3209 | 3210 |
3210 } // namespace cricket | 3211 } // namespace cricket |
OLD | NEW |