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

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: (Alphabetical sorting in common_video.gyp deps) 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
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | webrtc/build/common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 // initialization. 709 // 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 EXPECT_TRUE(channel->SetSendStreamFormat(ssrcs[0], format));
713 ASSERT_EQ(1u, encoder_factory.encoders().size()); 713 ASSERT_EQ(1u, encoder_factory.encoders().size());
714 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0]; 714 FakeWebRtcVideoEncoder* encoder = encoder_factory.encoders()[0];
715 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType); 715 EXPECT_EQ(webrtc::kVideoCodecH264, encoder->GetCodecSettings().codecType);
716 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams); 716 EXPECT_EQ(1u, encoder->GetCodecSettings().numberOfSimulcastStreams);
717 } 717 }
718 718
719 // Test external codec with be added to the end of the supported codec list. 719 // Test that external codecs are added to the end of the supported codec list.
720 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { 720 TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) {
721 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; 721 cricket::FakeWebRtcVideoEncoderFactory encoder_factory;
722 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264"); 722 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecUnknown,
723 "FakeExternalCodec");
723 engine_.SetExternalEncoderFactory(&encoder_factory); 724 engine_.SetExternalEncoderFactory(&encoder_factory);
724 engine_.Init(); 725 engine_.Init();
725 726
726 std::vector<cricket::VideoCodec> codecs(engine_.codecs()); 727 std::vector<cricket::VideoCodec> codecs(engine_.codecs());
727 ASSERT_GE(codecs.size(), 2u); 728 ASSERT_GE(codecs.size(), 2u);
728 cricket::VideoCodec internal_codec = codecs.front(); 729 cricket::VideoCodec internal_codec = codecs.front();
729 cricket::VideoCodec external_codec = codecs.back(); 730 cricket::VideoCodec external_codec = codecs.back();
730 731
731 // The external codec will appear at last. 732 // The external codec will appear at last.
732 EXPECT_EQ("VP8", internal_codec.name); 733 EXPECT_EQ("VP8", internal_codec.name);
733 EXPECT_EQ("H264", external_codec.name); 734 EXPECT_EQ("FakeExternalCodec", external_codec.name);
734 } 735 }
735 736
736 TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) { 737 TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) {
737 cricket::FakeWebRtcVideoDecoderFactory decoder_factory; 738 cricket::FakeWebRtcVideoDecoderFactory decoder_factory;
738 decoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8); 739 decoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8);
739 cricket::VideoRecvParameters parameters; 740 cricket::VideoRecvParameters parameters;
740 parameters.codecs.push_back(kVp8Codec); 741 parameters.codecs.push_back(kVp8Codec);
741 742
742 rtc::scoped_ptr<VideoMediaChannel> channel( 743 rtc::scoped_ptr<VideoMediaChannel> channel(
743 SetUpForExternalDecoderFactory(&decoder_factory, parameters.codecs)); 744 SetUpForExternalDecoderFactory(&decoder_factory, parameters.codecs));
(...skipping 2657 matching lines...) Expand 10 before | Expand all | Expand 10 after
3401 // reapplied when disabling screencasting. 3402 // reapplied when disabling screencasting.
3402 TEST_F(WebRtcVideoChannel2SimulcastTest, 3403 TEST_F(WebRtcVideoChannel2SimulcastTest,
3403 DISABLED_TwoTemporalLayerScreencastSettings) { 3404 DISABLED_TwoTemporalLayerScreencastSettings) {
3404 // TODO(pbos): Implement. 3405 // TODO(pbos): Implement.
3405 FAIL() << "Not implemented."; 3406 FAIL() << "Not implemented.";
3406 } 3407 }
3407 3408
3408 } // namespace cricket 3409 } // namespace cricket
3409 3410
3410 #endif // HAVE_WEBRTC_VIDEO 3411 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | webrtc/build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698