Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: talk/media/webrtc/webrtcvideoengine2_unittest.cc

Issue 1306813009: H.264 video codec support using OpenH264/FFmpeg (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase with master (and remove temporary debug prints) Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 // initialization. 707 // initialization.
708 cricket::VideoFormat format( 708 cricket::VideoFormat format(
709 1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420); 709 1280, 720, cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420);
710 EXPECT_TRUE(channel->SetSendStreamFormat(ssrcs[0], format)); 710 EXPECT_TRUE(channel->SetSendStreamFormat(ssrcs[0], format));
711 ASSERT_EQ(1u, encoder_factory.encoders().size()); 711 ASSERT_EQ(1u, encoder_factory.encoders().size());
712 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0]; 712 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0];
713 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType); 713 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType);
714 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams); 714 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams);
715 } 715 }
716 716
717 // Test external codec with be added to the end of the supported codec list. 717 // Test that external codecs are added to the end of the supported codec list.
718 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { 718 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) {
719 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; 719 cricket::FakeWebRtcVideoEncoderFactory encoder_factory;
720 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264"); 720 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecUnknown,
721 "FakeExternalCodec");
721 engine_.SetExternalEncoderFactory(&encoder_factory); 722 engine_.SetExternalEncoderFactory(&encoder_factory);
722 engine_.Init(); 723 engine_.Init();
723 724
724 std::vector<cricket::VideoCodec> codecs(engine_.codecs()); 725 std::vector<cricket::VideoCodec> codecs(engine_.codecs());
725 ASSERT_GE(codecs.size(), 2u); 726 ASSERT_GE(codecs.size(), 2u);
726 cricket::VideoCodec internal_codec = codecs.front(); 727 cricket::VideoCodec internal_codec = codecs.front();
727 cricket::VideoCodec external_codec = codecs.back(); 728 cricket::VideoCodec external_codec = codecs.back();
728 729
729 // The external codec will appear at last. 730 // The external codec will appear at last.
730 EXPECT_EQ("VP8", internal_codec.name); 731 EXPECT_EQ("VP8", internal_codec.name);
731 EXPECT_EQ("H264", external_codec.name); 732 EXPECT_EQ("FakeExternalCodec", external_codec.name);
732 } 733 }
733 734
734 TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) { 735 TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) {
735 cricket::FakeWebRtcVideoDecoderFactory decoder_factory; 736 cricket::FakeWebRtcVideoDecoderFactory decoder_factory;
736 decoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8); 737 decoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8);
737 cricket::VideoRecvParameters parameters; 738 cricket::VideoRecvParameters parameters;
738 parameters.codecs.push_back(kVp8Codec); 739 parameters.codecs.push_back(kVp8Codec);
739 740
740 rtc::scoped_ptr<VideoMediaChannel> channel( 741 rtc::scoped_ptr<VideoMediaChannel> channel(
741 SetUpForExternalDecoderFactory(&decoder_factory, parameters.codecs)); 742 SetUpForExternalDecoderFactory(&decoder_factory, parameters.codecs));
(...skipping 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after
3402 // Ensures that the correct settings are applied to the codec when two temporal 3403 // Ensures that the correct settings are applied to the codec when two temporal
3403 // layer screencasting is enabled, and that the correct simulcast settings are 3404 // layer screencasting is enabled, and that the correct simulcast settings are
3404 // reapplied when disabling screencasting. 3405 // reapplied when disabling screencasting.
3405 TEST_F(WebRtcVideoChannel2SimulcastTest, 3406 TEST_F(WebRtcVideoChannel2SimulcastTest,
3406 DISABLED_TwoTemporalLayerScreencastSettings) { 3407 DISABLED_TwoTemporalLayerScreencastSettings) {
3407 // TODO(pbos): Implement. 3408 // TODO(pbos): Implement.
3408 FAIL() << "Not implemented."; 3409 FAIL() << "Not implemented.";
3409 } 3410 }
3410 3411
3411 } // namespace cricket 3412 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698