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

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

Issue 1327933002: Full impl of NnChannel::SetSendParameters and NnChannel::SetRecvParameters (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Got rid of SetChannelOptions Created 5 years, 3 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 ASSERT_FALSE(extensions.empty()); 276 ASSERT_FALSE(extensions.empty());
277 for (size_t i = 0; i < extensions.size(); ++i) { 277 for (size_t i = 0; i < extensions.size(); ++i) {
278 if (extensions[i].uri == kRtpVideoRotationHeaderExtension) { 278 if (extensions[i].uri == kRtpVideoRotationHeaderExtension) {
279 EXPECT_EQ(kRtpVideoRotationHeaderExtensionDefaultId, extensions[i].id); 279 EXPECT_EQ(kRtpVideoRotationHeaderExtensionDefaultId, extensions[i].id);
280 return; 280 return;
281 } 281 }
282 } 282 }
283 FAIL() << "Video Rotation extension not in header-extension list."; 283 FAIL() << "Video Rotation extension not in header-extension list.";
284 } 284 }
285 285
286 /* TODO(solenberg): !!!!!
286 TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeCapturer) { 287 TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeCapturer) {
287 // Allocate the capturer first to prevent early destruction before channel's 288 // Allocate the capturer first to prevent early destruction before channel's
288 // dtor is called. 289 // dtor is called.
289 cricket::FakeVideoCapturer capturer; 290 cricket::FakeVideoCapturer capturer;
290 291
291 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; 292 cricket::FakeWebRtcVideoEncoderFactory encoder_factory;
292 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8"); 293 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8");
293 std::vector<cricket::VideoCodec> codecs; 294 std::vector<cricket::VideoCodec> codecs;
294 codecs.push_back(kVp8Codec); 295 codecs.push_back(kVp8Codec);
295 296
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 EXPECT_TRUE(channel->SetSendRtpHeaderExtensions(extensions)); 340 EXPECT_TRUE(channel->SetSendRtpHeaderExtensions(extensions));
340 341
341 // Verify capturer has turned off applying rotation. 342 // Verify capturer has turned off applying rotation.
342 EXPECT_FALSE(capturer.GetApplyRotation()); 343 EXPECT_FALSE(capturer.GetApplyRotation());
343 344
344 // Verify removing header extension turns on applying rotation. 345 // Verify removing header extension turns on applying rotation.
345 extensions.clear(); 346 extensions.clear();
346 EXPECT_TRUE(channel->SetSendRtpHeaderExtensions(extensions)); 347 EXPECT_TRUE(channel->SetSendRtpHeaderExtensions(extensions));
347 EXPECT_TRUE(capturer.GetApplyRotation()); 348 EXPECT_TRUE(capturer.GetApplyRotation());
348 } 349 }
349 350 */
350 TEST_F(WebRtcVideoEngine2Test, SetSendFailsBeforeSettingCodecs) { 351 TEST_F(WebRtcVideoEngine2Test, SetSendFailsBeforeSettingCodecs) {
351 engine_.Init(); 352 engine_.Init();
352 rtc::scoped_ptr<VideoMediaChannel> channel( 353 rtc::scoped_ptr<VideoMediaChannel> channel(
353 engine_.CreateChannel(cricket::VideoOptions(), NULL)); 354 engine_.CreateChannel(cricket::VideoOptions(), NULL));
354 355
355 EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123))); 356 EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123)));
356 357
357 EXPECT_FALSE(channel->SetSend(true)) 358 EXPECT_FALSE(channel->SetSend(true))
358 << "Channel should not start without codecs."; 359 << "Channel should not start without codecs.";
359 EXPECT_TRUE(channel->SetSend(false)) 360 EXPECT_TRUE(channel->SetSend(false))
360 << "Channel should be stoppable even without set codecs."; 361 << "Channel should be stoppable even without set codecs.";
361 } 362 }
362 363
363 TEST_F(WebRtcVideoEngine2Test, GetStatsWithoutSendCodecsSetDoesNotCrash) { 364 TEST_F(WebRtcVideoEngine2Test, GetStatsWithoutSendCodecsSetDoesNotCrash) {
364 engine_.Init(); 365 engine_.Init();
365 rtc::scoped_ptr<VideoMediaChannel> channel( 366 rtc::scoped_ptr<VideoMediaChannel> channel(
366 engine_.CreateChannel(cricket::VideoOptions(), NULL)); 367 engine_.CreateChannel(cricket::VideoOptions(), NULL));
367 EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123))); 368 EXPECT_TRUE(channel->AddSendStream(StreamParams::CreateLegacy(123)));
368 VideoMediaInfo info; 369 VideoMediaInfo info;
369 channel->GetStats(&info); 370 channel->GetStats(&info);
370 } 371 }
371 372
373 /* TODO(solenberg): !!!!!
372 TEST_F(WebRtcVideoEngine2Test, UseExternalFactoryForVp8WhenSupported) { 374 TEST_F(WebRtcVideoEngine2Test, UseExternalFactoryForVp8WhenSupported) {
373 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; 375 cricket::FakeWebRtcVideoEncoderFactory encoder_factory;
374 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8"); 376 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8");
375 std::vector<cricket::VideoCodec> codecs; 377 std::vector<cricket::VideoCodec> codecs;
376 codecs.push_back(kVp8Codec); 378 codecs.push_back(kVp8Codec);
377 379
378 rtc::scoped_ptr<VideoMediaChannel> channel( 380 rtc::scoped_ptr<VideoMediaChannel> channel(
379 SetUpForExternalEncoderFactory(&encoder_factory, codecs)); 381 SetUpForExternalEncoderFactory(&encoder_factory, codecs));
380 382
381 EXPECT_TRUE( 383 EXPECT_TRUE(
(...skipping 16 matching lines...) Expand all
398 400
399 // Setting codecs of the same type should not reallocate any encoders 401 // Setting codecs of the same type should not reallocate any encoders
400 // (expecting a no-op). 402 // (expecting a no-op).
401 EXPECT_TRUE(channel->SetSendCodecs(codecs)); 403 EXPECT_TRUE(channel->SetSendCodecs(codecs));
402 EXPECT_EQ(num_created_encoders, encoder_factory.GetNumCreatedEncoders()); 404 EXPECT_EQ(num_created_encoders, encoder_factory.GetNumCreatedEncoders());
403 405
404 // Remove stream previously added to free the external encoder instance. 406 // Remove stream previously added to free the external encoder instance.
405 EXPECT_TRUE(channel->RemoveSendStream(kSsrc)); 407 EXPECT_TRUE(channel->RemoveSendStream(kSsrc));
406 EXPECT_EQ(0u, encoder_factory.encoders().size()); 408 EXPECT_EQ(0u, encoder_factory.encoders().size());
407 } 409 }
408 410 */
409 TEST_F(WebRtcVideoEngine2Test, CanConstructDecoderForVp9EncoderFactory) { 411 TEST_F(WebRtcVideoEngine2Test, CanConstructDecoderForVp9EncoderFactory) {
410 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; 412 cricket::FakeWebRtcVideoEncoderFactory encoder_factory;
411 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP9, "VP9"); 413 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP9, "VP9");
412 std::vector<cricket::VideoCodec> codecs; 414 std::vector<cricket::VideoCodec> codecs;
413 codecs.push_back(kVp9Codec); 415 codecs.push_back(kVp9Codec);
414 416
415 rtc::scoped_ptr<VideoMediaChannel> channel( 417 rtc::scoped_ptr<VideoMediaChannel> channel(
416 SetUpForExternalEncoderFactory(&encoder_factory, codecs)); 418 SetUpForExternalEncoderFactory(&encoder_factory, codecs));
417 419
418 EXPECT_TRUE( 420 EXPECT_TRUE(
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 } 486 }
485 487
486 VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalEncoderFactory( 488 VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalEncoderFactory(
487 cricket::WebRtcVideoEncoderFactory* encoder_factory, 489 cricket::WebRtcVideoEncoderFactory* encoder_factory,
488 const std::vector<VideoCodec>& codecs) { 490 const std::vector<VideoCodec>& codecs) {
489 engine_.SetExternalEncoderFactory(encoder_factory); 491 engine_.SetExternalEncoderFactory(encoder_factory);
490 engine_.Init(); 492 engine_.Init();
491 493
492 VideoMediaChannel* channel = 494 VideoMediaChannel* channel =
493 engine_.CreateChannel(cricket::VideoOptions(), NULL); 495 engine_.CreateChannel(cricket::VideoOptions(), NULL);
496 /* TODO(solenberg): !!!!! SetParameters with only codecs?
494 EXPECT_TRUE(channel->SetSendCodecs(codecs)); 497 EXPECT_TRUE(channel->SetSendCodecs(codecs));
495 498 */
496 return channel; 499 return channel;
497 } 500 }
498 501
499 VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalDecoderFactory( 502 VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalDecoderFactory(
500 cricket::WebRtcVideoDecoderFactory* decoder_factory, 503 cricket::WebRtcVideoDecoderFactory* decoder_factory,
501 const std::vector<VideoCodec>& codecs) { 504 const std::vector<VideoCodec>& codecs) {
502 engine_.SetExternalDecoderFactory(decoder_factory); 505 engine_.SetExternalDecoderFactory(decoder_factory);
503 engine_.Init(); 506 engine_.Init();
504 507
505 VideoMediaChannel* channel = 508 VideoMediaChannel* channel =
506 engine_.CreateChannel(cricket::VideoOptions(), NULL); 509 engine_.CreateChannel(cricket::VideoOptions(), NULL);
510 /* TODO(solenberg): !!!!! SetParameters with only codecs?
507 EXPECT_TRUE(channel->SetRecvCodecs(codecs)); 511 EXPECT_TRUE(channel->SetRecvCodecs(codecs));
508 512 */
509 return channel; 513 return channel;
510 } 514 }
511 515
512 TEST_F(WebRtcVideoEngine2Test, UsesSimulcastAdapterForVp8Factories) { 516 TEST_F(WebRtcVideoEngine2Test, UsesSimulcastAdapterForVp8Factories) {
513 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; 517 cricket::FakeWebRtcVideoEncoderFactory encoder_factory;
514 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8"); 518 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8");
515 std::vector<cricket::VideoCodec> codecs; 519 std::vector<cricket::VideoCodec> codecs;
516 codecs.push_back(kVp8Codec); 520 codecs.push_back(kVp8Codec);
517 521
518 rtc::scoped_ptr<VideoMediaChannel> channel( 522 rtc::scoped_ptr<VideoMediaChannel> channel(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 561
558 rtc::scoped_ptr<VideoMediaChannel> channel( 562 rtc::scoped_ptr<VideoMediaChannel> channel(
559 SetUpForExternalEncoderFactory(&encoder_factory, codecs)); 563 SetUpForExternalEncoderFactory(&encoder_factory, codecs));
560 564
561 EXPECT_TRUE( 565 EXPECT_TRUE(
562 channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc))); 566 channel->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc)));
563 ASSERT_EQ(1u, encoder_factory.encoders().size()); 567 ASSERT_EQ(1u, encoder_factory.encoders().size());
564 568
565 codecs.clear(); 569 codecs.clear();
566 codecs.push_back(kVp8Codec); 570 codecs.push_back(kVp8Codec);
571 /* TODO(solenberg): !!!!!
567 EXPECT_TRUE(channel->SetSendCodecs(codecs)); 572 EXPECT_TRUE(channel->SetSendCodecs(codecs));
568 573 */
569 ASSERT_EQ(0u, encoder_factory.encoders().size()); 574 ASSERT_EQ(0u, encoder_factory.encoders().size());
570 } 575 }
571 576
572 TEST_F(WebRtcVideoEngine2Test, 577 TEST_F(WebRtcVideoEngine2Test,
573 DontUseExternalEncoderFactoryForUnsupportedCodecs) { 578 DontUseExternalEncoderFactoryForUnsupportedCodecs) {
574 cricket::FakeWebRtcVideoEncoderFactory encoder_factory; 579 cricket::FakeWebRtcVideoEncoderFactory encoder_factory;
575 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264"); 580 encoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecH264, "H264");
576 std::vector<cricket::VideoCodec> codecs; 581 std::vector<cricket::VideoCodec> codecs;
577 codecs.push_back(kVp8Codec); 582 codecs.push_back(kVp8Codec);
578 583
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 codecs.push_back(kVp8Codec); 696 codecs.push_back(kVp8Codec);
692 697
693 rtc::scoped_ptr<VideoMediaChannel> channel( 698 rtc::scoped_ptr<VideoMediaChannel> channel(
694 SetUpForExternalDecoderFactory(&decoder_factory, codecs)); 699 SetUpForExternalDecoderFactory(&decoder_factory, codecs));
695 700
696 EXPECT_TRUE( 701 EXPECT_TRUE(
697 channel->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc))); 702 channel->AddRecvStream(cricket::StreamParams::CreateLegacy(kSsrc)));
698 ASSERT_EQ(1u, decoder_factory.decoders().size()); 703 ASSERT_EQ(1u, decoder_factory.decoders().size());
699 704
700 // Setting codecs of the same type should not reallocate the decoder. 705 // Setting codecs of the same type should not reallocate the decoder.
706 /* TODO(solenberg): !!!!!
701 EXPECT_TRUE(channel->SetRecvCodecs(codecs)); 707 EXPECT_TRUE(channel->SetRecvCodecs(codecs));
708 */
702 EXPECT_EQ(1, decoder_factory.GetNumCreatedDecoders()); 709 EXPECT_EQ(1, decoder_factory.GetNumCreatedDecoders());
703 710
704 // Remove stream previously added to free the external decoder instance. 711 // Remove stream previously added to free the external decoder instance.
705 EXPECT_TRUE(channel->RemoveRecvStream(kSsrc)); 712 EXPECT_TRUE(channel->RemoveRecvStream(kSsrc));
706 EXPECT_EQ(0u, decoder_factory.decoders().size()); 713 EXPECT_EQ(0u, decoder_factory.decoders().size());
707 } 714 }
708 715
709 // Verifies that we can set up decoders that are not internally supported. 716 // Verifies that we can set up decoders that are not internally supported.
710 TEST_F(WebRtcVideoEngine2Test, RegisterExternalH264DecoderIfSupported) { 717 TEST_F(WebRtcVideoEngine2Test, RegisterExternalH264DecoderIfSupported) {
711 // TODO(pbos): Do not assume that encoder/decoder support is symmetric. We 718 // TODO(pbos): Do not assume that encoder/decoder support is symmetric. We
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test, 864 class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test,
858 public WebRtcCallFactory { 865 public WebRtcCallFactory {
859 public: 866 public:
860 WebRtcVideoChannel2Test() : fake_call_(NULL), last_ssrc_(0) {} 867 WebRtcVideoChannel2Test() : fake_call_(NULL), last_ssrc_(0) {}
861 void SetUp() override { 868 void SetUp() override {
862 engine_.SetCallFactory(this); 869 engine_.SetCallFactory(this);
863 engine_.Init(); 870 engine_.Init();
864 channel_.reset(engine_.CreateChannel(cricket::VideoOptions(), NULL)); 871 channel_.reset(engine_.CreateChannel(cricket::VideoOptions(), NULL));
865 ASSERT_TRUE(fake_call_ != NULL) << "Call not created through factory."; 872 ASSERT_TRUE(fake_call_ != NULL) << "Call not created through factory.";
866 last_ssrc_ = 123; 873 last_ssrc_ = 123;
874 /* TODO(solenberg): !!!!!
867 ASSERT_TRUE(channel_->SetSendCodecs(engine_.codecs())); 875 ASSERT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
876 */
868 } 877 }
869 878
870 protected: 879 protected:
871 virtual std::vector<cricket::VideoCodec> GetCodecs() { 880 virtual std::vector<cricket::VideoCodec> GetCodecs() {
872 return engine_.codecs(); 881 return engine_.codecs();
873 } 882 }
874 883
875 webrtc::Call* CreateCall(const webrtc::Call::Config& config) override { 884 webrtc::Call* CreateCall(const webrtc::Call::Config& config) override {
876 DCHECK(fake_call_ == NULL); 885 DCHECK(fake_call_ == NULL);
877 fake_call_ = new FakeCall(config); 886 fake_call_ = new FakeCall(config);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 int expected_min_bitrate_bps, 921 int expected_min_bitrate_bps,
913 const char* start_bitrate_kbps, 922 const char* start_bitrate_kbps,
914 int expected_start_bitrate_bps, 923 int expected_start_bitrate_bps,
915 const char* max_bitrate_kbps, 924 const char* max_bitrate_kbps,
916 int expected_max_bitrate_bps) { 925 int expected_max_bitrate_bps) {
917 std::vector<VideoCodec> codecs; 926 std::vector<VideoCodec> codecs;
918 codecs.push_back(kVp8Codec); 927 codecs.push_back(kVp8Codec);
919 codecs[0].params[kCodecParamMinBitrate] = min_bitrate_kbps; 928 codecs[0].params[kCodecParamMinBitrate] = min_bitrate_kbps;
920 codecs[0].params[kCodecParamStartBitrate] = start_bitrate_kbps; 929 codecs[0].params[kCodecParamStartBitrate] = start_bitrate_kbps;
921 codecs[0].params[kCodecParamMaxBitrate] = max_bitrate_kbps; 930 codecs[0].params[kCodecParamMaxBitrate] = max_bitrate_kbps;
931 /* TODO(solenberg): !!!!!
922 EXPECT_TRUE(channel_->SetSendCodecs(codecs)); 932 EXPECT_TRUE(channel_->SetSendCodecs(codecs));
923 933 */
924 EXPECT_EQ(expected_min_bitrate_bps, 934 EXPECT_EQ(expected_min_bitrate_bps,
925 fake_call_->GetConfig().bitrate_config.min_bitrate_bps); 935 fake_call_->GetConfig().bitrate_config.min_bitrate_bps);
926 EXPECT_EQ(expected_start_bitrate_bps, 936 EXPECT_EQ(expected_start_bitrate_bps,
927 fake_call_->GetConfig().bitrate_config.start_bitrate_bps); 937 fake_call_->GetConfig().bitrate_config.start_bitrate_bps);
928 EXPECT_EQ(expected_max_bitrate_bps, 938 EXPECT_EQ(expected_max_bitrate_bps,
929 fake_call_->GetConfig().bitrate_config.max_bitrate_bps); 939 fake_call_->GetConfig().bitrate_config.max_bitrate_bps);
930 } 940 }
931 941
932 void TestSetSendRtpHeaderExtensions(const std::string& cricket_ext, 942 void TestSetSendRtpHeaderExtensions(const std::string& cricket_ext,
933 const std::string& webrtc_ext) { 943 const std::string& webrtc_ext) {
934 FakeCall* call = fake_call_; 944 FakeCall* call = fake_call_;
935 // Enable extension. 945 // Enable extension.
936 const int id = 1; 946 const int id = 1;
937 std::vector<cricket::RtpHeaderExtension> extensions; 947 std::vector<cricket::RtpHeaderExtension> extensions;
938 extensions.push_back(cricket::RtpHeaderExtension(cricket_ext, id)); 948 extensions.push_back(cricket::RtpHeaderExtension(cricket_ext, id));
949 /* TODO(solenberg): !!!!!
939 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions)); 950 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions));
940
941 FakeVideoSendStream* send_stream = 951 FakeVideoSendStream* send_stream =
942 AddSendStream(cricket::StreamParams::CreateLegacy(123)); 952 AddSendStream(cricket::StreamParams::CreateLegacy(123));
943 953
944 // Verify the send extension id. 954 // Verify the send extension id.
945 ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size()); 955 ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size());
946 EXPECT_EQ(id, send_stream->GetConfig().rtp.extensions[0].id); 956 EXPECT_EQ(id, send_stream->GetConfig().rtp.extensions[0].id);
947 EXPECT_EQ(webrtc_ext, send_stream->GetConfig().rtp.extensions[0].name); 957 EXPECT_EQ(webrtc_ext, send_stream->GetConfig().rtp.extensions[0].name);
948 // Verify call with same set of extensions returns true. 958 // Verify call with same set of extensions returns true.
949 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions)); 959 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions));
950 // Verify that SetSendRtpHeaderExtensions doesn't implicitly add them for 960 // Verify that SetSendRtpHeaderExtensions doesn't implicitly add them for
951 // receivers. 961 // receivers.
952 EXPECT_TRUE(AddRecvStream(cricket::StreamParams::CreateLegacy(123)) 962 EXPECT_TRUE(AddRecvStream(cricket::StreamParams::CreateLegacy(123))
953 ->GetConfig() 963 ->GetConfig()
954 .rtp.extensions.empty()); 964 .rtp.extensions.empty());
955 965
956 // Verify that existing RTP header extensions can be removed. 966 // Verify that existing RTP header extensions can be removed.
957 std::vector<cricket::RtpHeaderExtension> empty_extensions; 967 std::vector<cricket::RtpHeaderExtension> empty_extensions;
958 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(empty_extensions)); 968 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(empty_extensions));
959 ASSERT_EQ(1u, call->GetVideoSendStreams().size()); 969 ASSERT_EQ(1u, call->GetVideoSendStreams().size());
960 send_stream = call->GetVideoSendStreams()[0]; 970 send_stream = call->GetVideoSendStreams()[0];
961 EXPECT_TRUE(send_stream->GetConfig().rtp.extensions.empty()); 971 EXPECT_TRUE(send_stream->GetConfig().rtp.extensions.empty());
962 972
963 // Verify that adding receive RTP header extensions adds them for existing 973 // Verify that adding receive RTP header extensions adds them for existing
964 // streams. 974 // streams.
965 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions)); 975 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions));
966 send_stream = call->GetVideoSendStreams()[0]; 976 send_stream = call->GetVideoSendStreams()[0];
967 ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size()); 977 ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size());
968 EXPECT_EQ(id, send_stream->GetConfig().rtp.extensions[0].id); 978 EXPECT_EQ(id, send_stream->GetConfig().rtp.extensions[0].id);
969 EXPECT_EQ(webrtc_ext, send_stream->GetConfig().rtp.extensions[0].name); 979 EXPECT_EQ(webrtc_ext, send_stream->GetConfig().rtp.extensions[0].name);
980 */
970 } 981 }
971 982
972 void TestSetRecvRtpHeaderExtensions(const std::string& cricket_ext, 983 void TestSetRecvRtpHeaderExtensions(const std::string& cricket_ext,
973 const std::string& webrtc_ext) { 984 const std::string& webrtc_ext) {
974 FakeCall* call = fake_call_; 985 FakeCall* call = fake_call_;
975 // Enable extension. 986 // Enable extension.
976 const int id = 1; 987 const int id = 1;
977 std::vector<cricket::RtpHeaderExtension> extensions; 988 std::vector<cricket::RtpHeaderExtension> extensions;
978 extensions.push_back(cricket::RtpHeaderExtension(cricket_ext, id)); 989 extensions.push_back(cricket::RtpHeaderExtension(cricket_ext, id));
990 /* TODO(solenberg): !!!!!
979 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions)); 991 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions));
980 992
981 FakeVideoReceiveStream* recv_stream = 993 FakeVideoReceiveStream* recv_stream =
982 AddRecvStream(cricket::StreamParams::CreateLegacy(123)); 994 AddRecvStream(cricket::StreamParams::CreateLegacy(123));
983 995
984 // Verify the recv extension id. 996 // Verify the recv extension id.
985 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.extensions.size()); 997 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.extensions.size());
986 EXPECT_EQ(id, recv_stream->GetConfig().rtp.extensions[0].id); 998 EXPECT_EQ(id, recv_stream->GetConfig().rtp.extensions[0].id);
987 EXPECT_EQ(webrtc_ext, recv_stream->GetConfig().rtp.extensions[0].name); 999 EXPECT_EQ(webrtc_ext, recv_stream->GetConfig().rtp.extensions[0].name);
988 // Verify call with same set of extensions returns true. 1000 // Verify call with same set of extensions returns true.
(...skipping 12 matching lines...) Expand all
1001 recv_stream = call->GetVideoReceiveStreams()[0]; 1013 recv_stream = call->GetVideoReceiveStreams()[0];
1002 EXPECT_TRUE(recv_stream->GetConfig().rtp.extensions.empty()); 1014 EXPECT_TRUE(recv_stream->GetConfig().rtp.extensions.empty());
1003 1015
1004 // Verify that adding receive RTP header extensions adds them for existing 1016 // Verify that adding receive RTP header extensions adds them for existing
1005 // streams. 1017 // streams.
1006 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions)); 1018 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions));
1007 recv_stream = call->GetVideoReceiveStreams()[0]; 1019 recv_stream = call->GetVideoReceiveStreams()[0];
1008 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.extensions.size()); 1020 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.extensions.size());
1009 EXPECT_EQ(id, recv_stream->GetConfig().rtp.extensions[0].id); 1021 EXPECT_EQ(id, recv_stream->GetConfig().rtp.extensions[0].id);
1010 EXPECT_EQ(webrtc_ext, recv_stream->GetConfig().rtp.extensions[0].name); 1022 EXPECT_EQ(webrtc_ext, recv_stream->GetConfig().rtp.extensions[0].name);
1023 */
1011 } 1024 }
1012 1025
1013 void TestCpuAdaptation(bool enable_overuse, bool is_screenshare); 1026 void TestCpuAdaptation(bool enable_overuse, bool is_screenshare);
1014 void TestReceiverLocalSsrcConfiguration(bool receiver_first); 1027 void TestReceiverLocalSsrcConfiguration(bool receiver_first);
1015 void TestReceiveUnsignalledSsrcPacket(uint8_t payload_type, 1028 void TestReceiveUnsignalledSsrcPacket(uint8_t payload_type,
1016 bool expect_created_receive_stream); 1029 bool expect_created_receive_stream);
1017 1030
1018 FakeVideoSendStream* SetDenoisingOption(bool enabled) { 1031 FakeVideoSendStream* SetDenoisingOption(bool enabled) {
1019 VideoOptions options; 1032 VideoOptions options;
1020 options.video_noise_reduction.Set(enabled); 1033 options.video_noise_reduction.Set(enabled);
1034 /* TODO(solenberg): !!!!!
1021 channel_->SetOptions(options); 1035 channel_->SetOptions(options);
1036 */
1022 return fake_call_->GetVideoSendStreams().back(); 1037 return fake_call_->GetVideoSendStreams().back();
1023 } 1038 }
1024 1039
1025 FakeVideoSendStream* SetUpSimulcast(bool enabled) { 1040 FakeVideoSendStream* SetUpSimulcast(bool enabled) {
1026 last_ssrc_ += 3; 1041 last_ssrc_ += 3;
1027 if (enabled) { 1042 if (enabled) {
1028 std::vector<uint32_t> ssrcs; 1043 std::vector<uint32_t> ssrcs;
1029 ssrcs.push_back(last_ssrc_); 1044 ssrcs.push_back(last_ssrc_);
1030 ssrcs.push_back(last_ssrc_ + 1); 1045 ssrcs.push_back(last_ssrc_ + 1);
1031 ssrcs.push_back(last_ssrc_ + 2); 1046 ssrcs.push_back(last_ssrc_ + 2);
(...skipping 16 matching lines...) Expand all
1048 sp.sync_label = kSyncLabel; 1063 sp.sync_label = kSyncLabel;
1049 EXPECT_TRUE(channel_->AddRecvStream(sp)); 1064 EXPECT_TRUE(channel_->AddRecvStream(sp));
1050 1065
1051 EXPECT_EQ(1, fake_call_->GetVideoReceiveStreams().size()); 1066 EXPECT_EQ(1, fake_call_->GetVideoReceiveStreams().size());
1052 EXPECT_EQ(kSyncLabel, 1067 EXPECT_EQ(kSyncLabel,
1053 fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group) 1068 fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group)
1054 << "SyncGroup should be set based on sync_label"; 1069 << "SyncGroup should be set based on sync_label";
1055 } 1070 }
1056 1071
1057 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithSimAndRtx) { 1072 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithSimAndRtx) {
1073 /* TODO(solenberg): !!!!!
1058 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs())); 1074 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
1059 EXPECT_TRUE(channel_->SetSend(true)); 1075 EXPECT_TRUE(channel_->SetSend(true));
1060 cricket::VideoOptions options; 1076 cricket::VideoOptions options;
1061 options.conference_mode.Set(true); 1077 options.conference_mode.Set(true);
1062 EXPECT_TRUE(channel_->SetOptions(options)); 1078 EXPECT_TRUE(channel_->SetOptions(options));
1063 1079
1064 // Send side. 1080 // Send side.
1065 const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs1); 1081 const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs1);
1066 const std::vector<uint32> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); 1082 const std::vector<uint32> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
1067 FakeVideoSendStream* send_stream = AddSendStream( 1083 FakeVideoSendStream* send_stream = AddSendStream(
1068 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)); 1084 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
1069 1085
1070 ASSERT_EQ(rtx_ssrcs.size(), send_stream->GetConfig().rtp.rtx.ssrcs.size()); 1086 ASSERT_EQ(rtx_ssrcs.size(), send_stream->GetConfig().rtp.rtx.ssrcs.size());
1071 for (size_t i = 0; i < rtx_ssrcs.size(); ++i) 1087 for (size_t i = 0; i < rtx_ssrcs.size(); ++i)
1072 EXPECT_EQ(rtx_ssrcs[i], send_stream->GetConfig().rtp.rtx.ssrcs[i]); 1088 EXPECT_EQ(rtx_ssrcs[i], send_stream->GetConfig().rtp.rtx.ssrcs[i]);
1073 1089
1074 // Receiver side. 1090 // Receiver side.
1075 FakeVideoReceiveStream* recv_stream = AddRecvStream( 1091 FakeVideoReceiveStream* recv_stream = AddRecvStream(
1076 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)); 1092 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
1077 ASSERT_GT(recv_stream->GetConfig().rtp.rtx.size(), 0u) 1093 ASSERT_GT(recv_stream->GetConfig().rtp.rtx.size(), 0u)
1078 << "No SSRCs for RTX configured by AddRecvStream."; 1094 << "No SSRCs for RTX configured by AddRecvStream.";
1079 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size()) 1095 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size())
1080 << "This test only works with one receive codec. Please update the test."; 1096 << "This test only works with one receive codec. Please update the test.";
1081 EXPECT_EQ(rtx_ssrcs[0], 1097 EXPECT_EQ(rtx_ssrcs[0],
1082 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc); 1098 recv_stream->GetConfig().rtp.rtx.begin()->second.ssrc);
1083 // TODO(pbos): Make sure we set the RTX for correct payloads etc. 1099 // TODO(pbos): Make sure we set the RTX for correct payloads etc.
1100 */
1084 } 1101 }
1085 1102
1086 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithRtx) { 1103 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithRtx) {
1087 // Setup one channel with an associated RTX stream. 1104 // Setup one channel with an associated RTX stream.
1088 cricket::StreamParams params = 1105 cricket::StreamParams params =
1089 cricket::StreamParams::CreateLegacy(kSsrcs1[0]); 1106 cricket::StreamParams::CreateLegacy(kSsrcs1[0]);
1090 params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]); 1107 params.AddFidSsrc(kSsrcs1[0], kRtxSsrcs1[0]);
1091 FakeVideoReceiveStream* recv_stream = AddRecvStream(params); 1108 FakeVideoReceiveStream* recv_stream = AddRecvStream(params);
1092 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size()); 1109 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.rtx.size());
1093 EXPECT_EQ(kRtxSsrcs1[0], 1110 EXPECT_EQ(kRtxSsrcs1[0],
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 TEST_F(WebRtcVideoChannel2Test, SendVideoRotationHeaderExtensions) { 1153 TEST_F(WebRtcVideoChannel2Test, SendVideoRotationHeaderExtensions) {
1137 TestSetSendRtpHeaderExtensions(kRtpVideoRotationHeaderExtension, 1154 TestSetSendRtpHeaderExtensions(kRtpVideoRotationHeaderExtension,
1138 webrtc::RtpExtension::kVideoRotation); 1155 webrtc::RtpExtension::kVideoRotation);
1139 } 1156 }
1140 TEST_F(WebRtcVideoChannel2Test, RecvVideoRotationHeaderExtensions) { 1157 TEST_F(WebRtcVideoChannel2Test, RecvVideoRotationHeaderExtensions) {
1141 TestSetRecvRtpHeaderExtensions(kRtpVideoRotationHeaderExtension, 1158 TestSetRecvRtpHeaderExtensions(kRtpVideoRotationHeaderExtension,
1142 webrtc::RtpExtension::kVideoRotation); 1159 webrtc::RtpExtension::kVideoRotation);
1143 } 1160 }
1144 1161
1145 TEST_F(WebRtcVideoChannel2Test, IdenticalSendExtensionsDoesntRecreateStream) { 1162 TEST_F(WebRtcVideoChannel2Test, IdenticalSendExtensionsDoesntRecreateStream) {
1163 /* TODO(solenberg): !!!!!
1146 const int kTOffsetId = 1; 1164 const int kTOffsetId = 1;
1147 const int kAbsSendTimeId = 2; 1165 const int kAbsSendTimeId = 2;
1148 const int kVideoRotationId = 3; 1166 const int kVideoRotationId = 3;
1149 std::vector<cricket::RtpHeaderExtension> extensions; 1167 std::vector<cricket::RtpHeaderExtension> extensions;
1150 extensions.push_back(cricket::RtpHeaderExtension( 1168 extensions.push_back(cricket::RtpHeaderExtension(
1151 kRtpAbsoluteSenderTimeHeaderExtension, kAbsSendTimeId)); 1169 kRtpAbsoluteSenderTimeHeaderExtension, kAbsSendTimeId));
1152 extensions.push_back(cricket::RtpHeaderExtension( 1170 extensions.push_back(cricket::RtpHeaderExtension(
1153 kRtpTimestampOffsetHeaderExtension, kTOffsetId)); 1171 kRtpTimestampOffsetHeaderExtension, kTOffsetId));
1154 extensions.push_back(cricket::RtpHeaderExtension( 1172 extensions.push_back(cricket::RtpHeaderExtension(
1155 kRtpVideoRotationHeaderExtension, kVideoRotationId)); 1173 kRtpVideoRotationHeaderExtension, kVideoRotationId));
(...skipping 10 matching lines...) Expand all
1166 std::reverse(extensions.begin(), extensions.end()); 1184 std::reverse(extensions.begin(), extensions.end());
1167 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions)); 1185 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions));
1168 1186
1169 EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams()); 1187 EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
1170 1188
1171 // Setting different extensions should recreate the stream. 1189 // Setting different extensions should recreate the stream.
1172 extensions.resize(1); 1190 extensions.resize(1);
1173 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions)); 1191 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions));
1174 1192
1175 EXPECT_EQ(2, fake_call_->GetNumCreatedSendStreams()); 1193 EXPECT_EQ(2, fake_call_->GetNumCreatedSendStreams());
1194 */
1176 } 1195 }
1177 1196
1178 TEST_F(WebRtcVideoChannel2Test, IdenticalRecvExtensionsDoesntRecreateStream) { 1197 TEST_F(WebRtcVideoChannel2Test, IdenticalRecvExtensionsDoesntRecreateStream) {
1198 /* TODO(solenberg): !!!!!
1179 const int kTOffsetId = 1; 1199 const int kTOffsetId = 1;
1180 const int kAbsSendTimeId = 2; 1200 const int kAbsSendTimeId = 2;
1181 const int kVideoRotationId = 3; 1201 const int kVideoRotationId = 3;
1182 std::vector<cricket::RtpHeaderExtension> extensions; 1202 std::vector<cricket::RtpHeaderExtension> extensions;
1183 extensions.push_back(cricket::RtpHeaderExtension( 1203 extensions.push_back(cricket::RtpHeaderExtension(
1184 kRtpAbsoluteSenderTimeHeaderExtension, kAbsSendTimeId)); 1204 kRtpAbsoluteSenderTimeHeaderExtension, kAbsSendTimeId));
1185 extensions.push_back(cricket::RtpHeaderExtension( 1205 extensions.push_back(cricket::RtpHeaderExtension(
1186 kRtpTimestampOffsetHeaderExtension, kTOffsetId)); 1206 kRtpTimestampOffsetHeaderExtension, kTOffsetId));
1187 extensions.push_back(cricket::RtpHeaderExtension( 1207 extensions.push_back(cricket::RtpHeaderExtension(
1188 kRtpVideoRotationHeaderExtension, kVideoRotationId)); 1208 kRtpVideoRotationHeaderExtension, kVideoRotationId));
(...skipping 10 matching lines...) Expand all
1199 std::reverse(extensions.begin(), extensions.end()); 1219 std::reverse(extensions.begin(), extensions.end());
1200 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions)); 1220 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions));
1201 1221
1202 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams()); 1222 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
1203 1223
1204 // Setting different extensions should recreate the stream. 1224 // Setting different extensions should recreate the stream.
1205 extensions.resize(1); 1225 extensions.resize(1);
1206 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions)); 1226 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions));
1207 1227
1208 EXPECT_EQ(2, fake_call_->GetNumCreatedReceiveStreams()); 1228 EXPECT_EQ(2, fake_call_->GetNumCreatedReceiveStreams());
1229 */
1209 } 1230 }
1210 1231
1211 TEST_F(WebRtcVideoChannel2Test, 1232 TEST_F(WebRtcVideoChannel2Test,
1212 SetSendRtpHeaderExtensionsExcludeUnsupportedExtensions) { 1233 SetSendRtpHeaderExtensionsExcludeUnsupportedExtensions) {
1234 /* TODO(solenberg): !!!!!
1213 const int kUnsupportedId = 1; 1235 const int kUnsupportedId = 1;
1214 const int kTOffsetId = 2; 1236 const int kTOffsetId = 2;
1215 1237
1216 std::vector<cricket::RtpHeaderExtension> extensions; 1238 std::vector<cricket::RtpHeaderExtension> extensions;
1217 extensions.push_back( 1239 extensions.push_back(
1218 cricket::RtpHeaderExtension(kUnsupportedExtensionName, kUnsupportedId)); 1240 cricket::RtpHeaderExtension(kUnsupportedExtensionName, kUnsupportedId));
1219 extensions.push_back( 1241 extensions.push_back(
1220 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, kTOffsetId)); 1242 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, kTOffsetId));
1221 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions)); 1243 EXPECT_TRUE(channel_->SetSendRtpHeaderExtensions(extensions));
1222 FakeVideoSendStream* send_stream = 1244 FakeVideoSendStream* send_stream =
1223 AddSendStream(cricket::StreamParams::CreateLegacy(123)); 1245 AddSendStream(cricket::StreamParams::CreateLegacy(123));
1224 1246
1225 // Only timestamp offset extension is set to send stream, 1247 // Only timestamp offset extension is set to send stream,
1226 // unsupported rtp extension is ignored. 1248 // unsupported rtp extension is ignored.
1227 ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size()); 1249 ASSERT_EQ(1u, send_stream->GetConfig().rtp.extensions.size());
1228 EXPECT_STREQ(webrtc::RtpExtension::kTOffset, 1250 EXPECT_STREQ(webrtc::RtpExtension::kTOffset,
1229 send_stream->GetConfig().rtp.extensions[0].name.c_str()); 1251 send_stream->GetConfig().rtp.extensions[0].name.c_str());
1252 */
1230 } 1253 }
1231 1254
1232 TEST_F(WebRtcVideoChannel2Test, 1255 TEST_F(WebRtcVideoChannel2Test,
1233 SetRecvRtpHeaderExtensionsExcludeUnsupportedExtensions) { 1256 SetRecvRtpHeaderExtensionsExcludeUnsupportedExtensions) {
1257 /* TODO(solenberg): !!!!!
1234 const int kUnsupportedId = 1; 1258 const int kUnsupportedId = 1;
1235 const int kTOffsetId = 2; 1259 const int kTOffsetId = 2;
1236 1260
1237 std::vector<cricket::RtpHeaderExtension> extensions; 1261 std::vector<cricket::RtpHeaderExtension> extensions;
1238 extensions.push_back( 1262 extensions.push_back(
1239 cricket::RtpHeaderExtension(kUnsupportedExtensionName, kUnsupportedId)); 1263 cricket::RtpHeaderExtension(kUnsupportedExtensionName, kUnsupportedId));
1240 extensions.push_back( 1264 extensions.push_back(
1241 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, kTOffsetId)); 1265 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, kTOffsetId));
1242 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions)); 1266 EXPECT_TRUE(channel_->SetRecvRtpHeaderExtensions(extensions));
1243 FakeVideoReceiveStream* recv_stream = 1267 FakeVideoReceiveStream* recv_stream =
1244 AddRecvStream(cricket::StreamParams::CreateLegacy(123)); 1268 AddRecvStream(cricket::StreamParams::CreateLegacy(123));
1245 1269
1246 // Only timestamp offset extension is set to receive stream, 1270 // Only timestamp offset extension is set to receive stream,
1247 // unsupported rtp extension is ignored. 1271 // unsupported rtp extension is ignored.
1248 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.extensions.size()); 1272 ASSERT_EQ(1u, recv_stream->GetConfig().rtp.extensions.size());
1249 EXPECT_STREQ(webrtc::RtpExtension::kTOffset, 1273 EXPECT_STREQ(webrtc::RtpExtension::kTOffset,
1250 recv_stream->GetConfig().rtp.extensions[0].name.c_str()); 1274 recv_stream->GetConfig().rtp.extensions[0].name.c_str());
1275 */
1251 } 1276 }
1252 1277
1253 TEST_F(WebRtcVideoChannel2Test, SetSendRtpHeaderExtensionsRejectsIncorrectIds) { 1278 TEST_F(WebRtcVideoChannel2Test, SetSendRtpHeaderExtensionsRejectsIncorrectIds) {
1254 const int kIncorrectIds[] = {-2, -1, 0, 15, 16}; 1279 const int kIncorrectIds[] = {-2, -1, 0, 15, 16};
1255 for (size_t i = 0; i < arraysize(kIncorrectIds); ++i) { 1280 for (size_t i = 0; i < arraysize(kIncorrectIds); ++i) {
1256 std::vector<cricket::RtpHeaderExtension> extensions; 1281 std::vector<cricket::RtpHeaderExtension> extensions;
1257 extensions.push_back(cricket::RtpHeaderExtension( 1282 extensions.push_back(cricket::RtpHeaderExtension(
1258 webrtc::RtpExtension::kTOffset, kIncorrectIds[i])); 1283 webrtc::RtpExtension::kTOffset, kIncorrectIds[i]));
1284 /* TODO(solenberg): !!!!!
1259 EXPECT_FALSE(channel_->SetSendRtpHeaderExtensions(extensions)) 1285 EXPECT_FALSE(channel_->SetSendRtpHeaderExtensions(extensions))
1260 << "Bad extension id '" << kIncorrectIds[i] << "' accepted."; 1286 << "Bad extension id '" << kIncorrectIds[i] << "' accepted.";
1287 */
1261 } 1288 }
1262 } 1289 }
1263 1290
1264 TEST_F(WebRtcVideoChannel2Test, SetRecvRtpHeaderExtensionsRejectsIncorrectIds) { 1291 TEST_F(WebRtcVideoChannel2Test, SetRecvRtpHeaderExtensionsRejectsIncorrectIds) {
1265 const int kIncorrectIds[] = {-2, -1, 0, 15, 16}; 1292 const int kIncorrectIds[] = {-2, -1, 0, 15, 16};
1266 for (size_t i = 0; i < arraysize(kIncorrectIds); ++i) { 1293 for (size_t i = 0; i < arraysize(kIncorrectIds); ++i) {
1267 std::vector<cricket::RtpHeaderExtension> extensions; 1294 std::vector<cricket::RtpHeaderExtension> extensions;
1268 extensions.push_back(cricket::RtpHeaderExtension( 1295 extensions.push_back(cricket::RtpHeaderExtension(
1269 webrtc::RtpExtension::kTOffset, kIncorrectIds[i])); 1296 webrtc::RtpExtension::kTOffset, kIncorrectIds[i]));
1297 /* TODO(solenberg): !!!!!
1270 EXPECT_FALSE(channel_->SetRecvRtpHeaderExtensions(extensions)) 1298 EXPECT_FALSE(channel_->SetRecvRtpHeaderExtensions(extensions))
1271 << "Bad extension id '" << kIncorrectIds[i] << "' accepted."; 1299 << "Bad extension id '" << kIncorrectIds[i] << "' accepted.";
1300 */
1272 } 1301 }
1273 } 1302 }
1274 1303
1275 TEST_F(WebRtcVideoChannel2Test, SetSendRtpHeaderExtensionsRejectsDuplicateIds) { 1304 TEST_F(WebRtcVideoChannel2Test, SetSendRtpHeaderExtensionsRejectsDuplicateIds) {
1305 /* TODO(solenberg): !!!!!
1276 const int id = 1; 1306 const int id = 1;
1277 std::vector<cricket::RtpHeaderExtension> extensions; 1307 std::vector<cricket::RtpHeaderExtension> extensions;
1278 extensions.push_back( 1308 extensions.push_back(
1279 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, id)); 1309 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, id));
1280 extensions.push_back( 1310 extensions.push_back(
1281 cricket::RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, id)); 1311 cricket::RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, id));
1282 EXPECT_FALSE(channel_->SetSendRtpHeaderExtensions(extensions)); 1312 EXPECT_FALSE(channel_->SetSendRtpHeaderExtensions(extensions));
1283 1313
1284 // Duplicate entries are also not supported. 1314 // Duplicate entries are also not supported.
1285 extensions.clear(); 1315 extensions.clear();
1286 extensions.push_back( 1316 extensions.push_back(
1287 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, id)); 1317 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, id));
1288 extensions.push_back(extensions.back()); 1318 extensions.push_back(extensions.back());
1289 EXPECT_FALSE(channel_->SetSendRtpHeaderExtensions(extensions)); 1319 EXPECT_FALSE(channel_->SetSendRtpHeaderExtensions(extensions));
1320 */
1290 } 1321 }
1291 1322
1292 TEST_F(WebRtcVideoChannel2Test, SetRecvRtpHeaderExtensionsRejectsDuplicateIds) { 1323 TEST_F(WebRtcVideoChannel2Test, SetRecvRtpHeaderExtensionsRejectsDuplicateIds) {
1324 /* TODO(solenberg): !!!!!
1293 const int id = 1; 1325 const int id = 1;
1294 std::vector<cricket::RtpHeaderExtension> extensions; 1326 std::vector<cricket::RtpHeaderExtension> extensions;
1295 extensions.push_back( 1327 extensions.push_back(
1296 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, id)); 1328 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, id));
1297 extensions.push_back( 1329 extensions.push_back(
1298 cricket::RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, id)); 1330 cricket::RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, id));
1299 EXPECT_FALSE(channel_->SetRecvRtpHeaderExtensions(extensions)); 1331 EXPECT_FALSE(channel_->SetRecvRtpHeaderExtensions(extensions));
1300 1332
1301 // Duplicate entries are also not supported. 1333 // Duplicate entries are also not supported.
1302 extensions.clear(); 1334 extensions.clear();
1303 extensions.push_back( 1335 extensions.push_back(
1304 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, id)); 1336 cricket::RtpHeaderExtension(webrtc::RtpExtension::kTOffset, id));
1305 extensions.push_back(extensions.back()); 1337 extensions.push_back(extensions.back());
1306 EXPECT_FALSE(channel_->SetRecvRtpHeaderExtensions(extensions)); 1338 EXPECT_FALSE(channel_->SetRecvRtpHeaderExtensions(extensions));
1339 */
1307 } 1340 }
1308 1341
1309 TEST_F(WebRtcVideoChannel2Test, DISABLED_LeakyBucketTest) { 1342 TEST_F(WebRtcVideoChannel2Test, DISABLED_LeakyBucketTest) {
1310 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1343 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1311 } 1344 }
1312 1345
1313 TEST_F(WebRtcVideoChannel2Test, DISABLED_BufferedModeLatency) { 1346 TEST_F(WebRtcVideoChannel2Test, DISABLED_BufferedModeLatency) {
1314 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1347 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1315 } 1348 }
1316 1349
1317 TEST_F(WebRtcVideoChannel2Test, DISABLED_AdditiveVideoOptions) { 1350 TEST_F(WebRtcVideoChannel2Test, DISABLED_AdditiveVideoOptions) {
1318 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1351 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1319 } 1352 }
1320 1353
1321 TEST_F(WebRtcVideoChannel2Test, AddRecvStreamOnlyUsesOneReceiveStream) { 1354 TEST_F(WebRtcVideoChannel2Test, AddRecvStreamOnlyUsesOneReceiveStream) {
1322 EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1))); 1355 EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1)));
1323 EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); 1356 EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size());
1324 } 1357 }
1325 1358
1326 TEST_F(WebRtcVideoChannel2Test, RtcpIsCompoundByDefault) { 1359 TEST_F(WebRtcVideoChannel2Test, RtcpIsCompoundByDefault) {
1327 FakeVideoReceiveStream* stream = AddRecvStream(); 1360 FakeVideoReceiveStream* stream = AddRecvStream();
1328 EXPECT_EQ(webrtc::newapi::kRtcpCompound, stream->GetConfig().rtp.rtcp_mode); 1361 EXPECT_EQ(webrtc::newapi::kRtcpCompound, stream->GetConfig().rtp.rtcp_mode);
1329 } 1362 }
1330 1363
1331 TEST_F(WebRtcVideoChannel2Test, RembIsEnabledByDefault) { 1364 TEST_F(WebRtcVideoChannel2Test, RembIsEnabledByDefault) {
1332 FakeVideoReceiveStream* stream = AddRecvStream(); 1365 FakeVideoReceiveStream* stream = AddRecvStream();
1333 EXPECT_TRUE(stream->GetConfig().rtp.remb); 1366 EXPECT_TRUE(stream->GetConfig().rtp.remb);
1334 } 1367 }
1335 1368
1369 /* TODO(solenberg): !!!!!
1336 TEST_F(WebRtcVideoChannel2Test, RembCanBeEnabledAndDisabled) { 1370 TEST_F(WebRtcVideoChannel2Test, RembCanBeEnabledAndDisabled) {
1337 FakeVideoReceiveStream* stream = AddRecvStream(); 1371 FakeVideoReceiveStream* stream = AddRecvStream();
1338 EXPECT_TRUE(stream->GetConfig().rtp.remb); 1372 EXPECT_TRUE(stream->GetConfig().rtp.remb);
1339 1373
1340 // Verify that REMB is turned off when send(!) codecs without REMB are set. 1374 // Verify that REMB is turned off when send(!) codecs without REMB are set.
1341 std::vector<VideoCodec> codecs; 1375 std::vector<VideoCodec> codecs;
1342 codecs.push_back(kVp8Codec); 1376 codecs.push_back(kVp8Codec);
1343 EXPECT_TRUE(codecs[0].feedback_params.params().empty()); 1377 EXPECT_TRUE(codecs[0].feedback_params.params().empty());
1344 EXPECT_TRUE(channel_->SetSendCodecs(codecs)); 1378 EXPECT_TRUE(channel_->SetSendCodecs(codecs));
1345 stream = fake_call_->GetVideoReceiveStreams()[0]; 1379 stream = fake_call_->GetVideoReceiveStreams()[0];
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 EXPECT_EQ(0, send_stream->GetConfig().rtp.nack.rtp_history_ms); 1425 EXPECT_EQ(0, send_stream->GetConfig().rtp.nack.rtp_history_ms);
1392 1426
1393 // Verify that NACK is turned on when setting default codecs since the 1427 // Verify that NACK is turned on when setting default codecs since the
1394 // default codecs have NACK enabled. 1428 // default codecs have NACK enabled.
1395 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs())); 1429 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
1396 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; 1430 recv_stream = fake_call_->GetVideoReceiveStreams()[0];
1397 EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0); 1431 EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0);
1398 send_stream = fake_call_->GetVideoSendStreams()[0]; 1432 send_stream = fake_call_->GetVideoSendStreams()[0];
1399 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0); 1433 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0);
1400 } 1434 }
1435 */
1401 1436
1402 TEST_F(WebRtcVideoChannel2Test, DISABLED_VideoProtectionInterop) { 1437 TEST_F(WebRtcVideoChannel2Test, DISABLED_VideoProtectionInterop) {
1403 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1438 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1404 } 1439 }
1405 1440
1406 TEST_F(WebRtcVideoChannel2Test, DISABLED_VideoProtectionInteropReversed) { 1441 TEST_F(WebRtcVideoChannel2Test, DISABLED_VideoProtectionInteropReversed) {
1407 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1442 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1408 } 1443 }
1409 1444
1410 TEST_F(WebRtcVideoChannel2Test, DISABLED_HybridNackFecConference) { 1445 TEST_F(WebRtcVideoChannel2Test, DISABLED_HybridNackFecConference) {
(...skipping 17 matching lines...) Expand all
1428 } 1463 }
1429 1464
1430 TEST_F(WebRtcVideoChannel2Test, DISABLED_SetBandwidthFixed) { 1465 TEST_F(WebRtcVideoChannel2Test, DISABLED_SetBandwidthFixed) {
1431 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1466 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1432 } 1467 }
1433 1468
1434 TEST_F(WebRtcVideoChannel2Test, DISABLED_SetBandwidthInConference) { 1469 TEST_F(WebRtcVideoChannel2Test, DISABLED_SetBandwidthInConference) {
1435 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1470 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1436 } 1471 }
1437 1472
1473 /* TODO(solenberg): !!!!!
1438 TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { 1474 TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) {
1439 static const int kScreenshareMinBitrateKbps = 800; 1475 static const int kScreenshareMinBitrateKbps = 800;
1440 cricket::VideoCodec codec = kVp8Codec360p; 1476 cricket::VideoCodec codec = kVp8Codec360p;
1441 std::vector<cricket::VideoCodec> codecs; 1477 std::vector<cricket::VideoCodec> codecs;
1442 codecs.push_back(codec); 1478 codecs.push_back(codec);
1443 EXPECT_TRUE(channel_->SetSendCodecs(codecs)); 1479 EXPECT_TRUE(channel_->SetSendCodecs(codecs));
1444 VideoOptions options; 1480 VideoOptions options;
1445 options.screencast_min_bitrate.Set(kScreenshareMinBitrateKbps); 1481 options.screencast_min_bitrate.Set(kScreenshareMinBitrateKbps);
1446 channel_->SetOptions(options); 1482 channel_->SetOptions(options);
1447 1483
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 encoder_config = send_stream->GetEncoderConfig(); 1557 encoder_config = send_stream->GetEncoderConfig();
1522 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, 1558 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen,
1523 encoder_config.content_type); 1559 encoder_config.content_type);
1524 ASSERT_EQ(1u, encoder_config.streams.size()); 1560 ASSERT_EQ(1u, encoder_config.streams.size());
1525 ASSERT_EQ(1u, encoder_config.streams[0].temporal_layer_thresholds_bps.size()); 1561 ASSERT_EQ(1u, encoder_config.streams[0].temporal_layer_thresholds_bps.size());
1526 EXPECT_EQ(kConferenceScreencastTemporalBitrateBps, 1562 EXPECT_EQ(kConferenceScreencastTemporalBitrateBps,
1527 encoder_config.streams[0].temporal_layer_thresholds_bps[0]); 1563 encoder_config.streams[0].temporal_layer_thresholds_bps[0]);
1528 1564
1529 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); 1565 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
1530 } 1566 }
1567 */
1531 1568
1532 TEST_F(WebRtcVideoChannel2Test, DISABLED_SetSendSsrcAndCname) { 1569 TEST_F(WebRtcVideoChannel2Test, DISABLED_SetSendSsrcAndCname) {
1533 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1570 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1534 } 1571 }
1535 1572
1536 TEST_F(WebRtcVideoChannel2Test, 1573 TEST_F(WebRtcVideoChannel2Test,
1537 DISABLED_SetSendSsrcAfterCreatingReceiveChannel) { 1574 DISABLED_SetSendSsrcAfterCreatingReceiveChannel) {
1538 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1575 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1539 } 1576 }
1540 1577
1541 TEST_F(WebRtcVideoChannel2Test, SuspendBelowMinBitrateDisabledByDefault) { 1578 TEST_F(WebRtcVideoChannel2Test, SuspendBelowMinBitrateDisabledByDefault) {
1542 FakeVideoSendStream* stream = AddSendStream(); 1579 FakeVideoSendStream* stream = AddSendStream();
1543 EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate); 1580 EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate);
1544 } 1581 }
1545 1582
1583 /* TODO(solenberg): !!!!!
1546 TEST_F(WebRtcVideoChannel2Test, SetOptionsWithSuspendBelowMinBitrate) { 1584 TEST_F(WebRtcVideoChannel2Test, SetOptionsWithSuspendBelowMinBitrate) {
1547 VideoOptions options; 1585 VideoOptions options;
1548 options.suspend_below_min_bitrate.Set(true); 1586 options.suspend_below_min_bitrate.Set(true);
1549 channel_->SetOptions(options); 1587 channel_->SetOptions(options);
1550 1588
1551 FakeVideoSendStream* stream = AddSendStream(); 1589 FakeVideoSendStream* stream = AddSendStream();
1552 EXPECT_TRUE(stream->GetConfig().suspend_below_min_bitrate); 1590 EXPECT_TRUE(stream->GetConfig().suspend_below_min_bitrate);
1553 1591
1554 options.suspend_below_min_bitrate.Set(false); 1592 options.suspend_below_min_bitrate.Set(false);
1555 channel_->SetOptions(options); 1593 channel_->SetOptions(options);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 1660
1623 stream = SetDenoisingOption(true); 1661 stream = SetDenoisingOption(true);
1624 1662
1625 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; 1663 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
1626 EXPECT_FALSE(vp8_settings.denoisingOn); 1664 EXPECT_FALSE(vp8_settings.denoisingOn);
1627 EXPECT_FALSE(vp8_settings.automaticResizeOn); 1665 EXPECT_FALSE(vp8_settings.automaticResizeOn);
1628 EXPECT_FALSE(vp8_settings.frameDroppingOn); 1666 EXPECT_FALSE(vp8_settings.frameDroppingOn);
1629 1667
1630 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); 1668 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
1631 } 1669 }
1670 */
1632 1671
1633 class Vp9SettingsTest : public WebRtcVideoChannel2Test { 1672 class Vp9SettingsTest : public WebRtcVideoChannel2Test {
1634 public: 1673 public:
1635 Vp9SettingsTest() : WebRtcVideoChannel2Test() { 1674 Vp9SettingsTest() : WebRtcVideoChannel2Test() {
1636 encoder_factory_.AddSupportedVideoCodecType(webrtc::kVideoCodecVP9, "VP9"); 1675 encoder_factory_.AddSupportedVideoCodecType(webrtc::kVideoCodecVP9, "VP9");
1637 } 1676 }
1638 virtual ~Vp9SettingsTest() {} 1677 virtual ~Vp9SettingsTest() {}
1639 1678
1640 protected: 1679 protected:
1641 void SetUp() override { 1680 void SetUp() override {
1642 engine_.SetExternalEncoderFactory(&encoder_factory_); 1681 engine_.SetExternalEncoderFactory(&encoder_factory_);
1643 1682
1644 WebRtcVideoChannel2Test::SetUp(); 1683 WebRtcVideoChannel2Test::SetUp();
1645 } 1684 }
1646 1685
1647 void TearDown() override { 1686 void TearDown() override {
1648 // Remove references to encoder_factory_ since this will be destroyed 1687 // Remove references to encoder_factory_ since this will be destroyed
1649 // before channel_ and engine_. 1688 // before channel_ and engine_.
1689 /* TODO(solenberg): !!!!!
1650 ASSERT_TRUE(channel_->SetSendCodecs(engine_.codecs())); 1690 ASSERT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
1691 */
1651 } 1692 }
1652 1693
1653 cricket::FakeWebRtcVideoEncoderFactory encoder_factory_; 1694 cricket::FakeWebRtcVideoEncoderFactory encoder_factory_;
1654 }; 1695 };
1655 1696
1697 /* TODO(solenberg): !!!!!
1656 TEST_F(Vp9SettingsTest, VerifyVp9SpecificSettings) { 1698 TEST_F(Vp9SettingsTest, VerifyVp9SpecificSettings) {
1657 std::vector<cricket::VideoCodec> codecs; 1699 std::vector<cricket::VideoCodec> codecs;
1658 codecs.push_back(kVp9Codec); 1700 codecs.push_back(kVp9Codec);
1659 ASSERT_TRUE(channel_->SetSendCodecs(codecs)); 1701 ASSERT_TRUE(channel_->SetSendCodecs(codecs));
1660 1702
1661 FakeVideoSendStream* stream = SetUpSimulcast(false); 1703 FakeVideoSendStream* stream = SetUpSimulcast(false);
1662 1704
1663 cricket::FakeVideoCapturer capturer; 1705 cricket::FakeVideoCapturer capturer;
1664 capturer.SetScreencast(false); 1706 capturer.SetScreencast(false);
1665 EXPECT_EQ(cricket::CS_RUNNING, 1707 EXPECT_EQ(cricket::CS_RUNNING,
(...skipping 28 matching lines...) Expand all
1694 EXPECT_FALSE(vp9_settings.frameDroppingOn); 1736 EXPECT_FALSE(vp9_settings.frameDroppingOn);
1695 1737
1696 stream = SetDenoisingOption(false); 1738 stream = SetDenoisingOption(false);
1697 1739
1698 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; 1740 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
1699 EXPECT_FALSE(vp9_settings.denoisingOn); 1741 EXPECT_FALSE(vp9_settings.denoisingOn);
1700 EXPECT_FALSE(vp9_settings.frameDroppingOn); 1742 EXPECT_FALSE(vp9_settings.frameDroppingOn);
1701 1743
1702 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); 1744 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
1703 } 1745 }
1746 */
1704 1747
1705 TEST_F(WebRtcVideoChannel2Test, DISABLED_MultipleSendStreamsWithOneCapturer) { 1748 TEST_F(WebRtcVideoChannel2Test, DISABLED_MultipleSendStreamsWithOneCapturer) {
1706 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1749 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1707 } 1750 }
1708 1751
1709 TEST_F(WebRtcVideoChannel2Test, DISABLED_SendReceiveBitratesStats) { 1752 TEST_F(WebRtcVideoChannel2Test, DISABLED_SendReceiveBitratesStats) {
1710 FAIL() << "Not implemented."; // TODO(pbos): Implement. 1753 FAIL() << "Not implemented."; // TODO(pbos): Implement.
1711 } 1754 }
1712 1755
1713 TEST_F(WebRtcVideoChannel2Test, AdaptsOnOveruse) { 1756 TEST_F(WebRtcVideoChannel2Test, AdaptsOnOveruse) {
1714 TestCpuAdaptation(true, false); 1757 TestCpuAdaptation(true, false);
1715 } 1758 }
1716 1759
1717 TEST_F(WebRtcVideoChannel2Test, DoesNotAdaptOnOveruseWhenDisabled) { 1760 TEST_F(WebRtcVideoChannel2Test, DoesNotAdaptOnOveruseWhenDisabled) {
1718 TestCpuAdaptation(false, false); 1761 TestCpuAdaptation(false, false);
1719 } 1762 }
1720 1763
1721 TEST_F(WebRtcVideoChannel2Test, DoesNotAdaptOnOveruseWhenScreensharing) { 1764 TEST_F(WebRtcVideoChannel2Test, DoesNotAdaptOnOveruseWhenScreensharing) {
1722 TestCpuAdaptation(true, true); 1765 TestCpuAdaptation(true, true);
1723 } 1766 }
1724 1767
1725 void WebRtcVideoChannel2Test::TestCpuAdaptation(bool enable_overuse, 1768 void WebRtcVideoChannel2Test::TestCpuAdaptation(bool enable_overuse,
1726 bool is_screenshare) { 1769 bool is_screenshare) {
1770 /* TODO(solenberg): !!!!!
1727 cricket::VideoCodec codec = kVp8Codec720p; 1771 cricket::VideoCodec codec = kVp8Codec720p;
1728 std::vector<cricket::VideoCodec> codecs; 1772 std::vector<cricket::VideoCodec> codecs;
1729 codecs.push_back(codec); 1773 codecs.push_back(codec);
1730 EXPECT_TRUE(channel_->SetSendCodecs(codecs)); 1774 EXPECT_TRUE(channel_->SetSendCodecs(codecs));
1731 1775
1732 if (!enable_overuse) { 1776 if (!enable_overuse) {
1733 VideoOptions options; 1777 VideoOptions options;
1734 options.cpu_overuse_detection.Set(false); 1778 options.cpu_overuse_detection.Set(false);
1735 channel_->SetOptions(options); 1779 channel_->SetOptions(options);
1736 } 1780 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 // Trigger underuse which should go back to normal resolution. 1812 // Trigger underuse which should go back to normal resolution.
1769 overuse_callback->OnLoadUpdate(webrtc::LoadObserver::kUnderuse); 1813 overuse_callback->OnLoadUpdate(webrtc::LoadObserver::kUnderuse);
1770 EXPECT_TRUE(capturer.CaptureFrame()); 1814 EXPECT_TRUE(capturer.CaptureFrame());
1771 1815
1772 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); 1816 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames());
1773 1817
1774 EXPECT_EQ(codec.width, send_stream->GetLastWidth()); 1818 EXPECT_EQ(codec.width, send_stream->GetLastWidth());
1775 EXPECT_EQ(codec.height, send_stream->GetLastHeight()); 1819 EXPECT_EQ(codec.height, send_stream->GetLastHeight());
1776 1820
1777 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); 1821 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
1822 */
1778 } 1823 }
1779 1824
1825 /* TODO(solenberg): !!!!!
1780 TEST_F(WebRtcVideoChannel2Test, EstimatesNtpStartTimeAndElapsedTimeCorrectly) { 1826 TEST_F(WebRtcVideoChannel2Test, EstimatesNtpStartTimeAndElapsedTimeCorrectly) {
1781 // Start at last timestamp to verify that wraparounds are estimated correctly. 1827 // Start at last timestamp to verify that wraparounds are estimated correctly.
1782 static const uint32_t kInitialTimestamp = 0xFFFFFFFFu; 1828 static const uint32_t kInitialTimestamp = 0xFFFFFFFFu;
1783 static const int64_t kInitialNtpTimeMs = 1247891230; 1829 static const int64_t kInitialNtpTimeMs = 1247891230;
1784 static const int kFrameOffsetMs = 20; 1830 static const int kFrameOffsetMs = 20;
1785 EXPECT_TRUE(channel_->SetRecvCodecs(engine_.codecs())); 1831 EXPECT_TRUE(channel_->SetRecvCodecs(engine_.codecs()));
1786 1832
1787 FakeVideoReceiveStream* stream = AddRecvStream(); 1833 FakeVideoReceiveStream* stream = AddRecvStream();
1788 cricket::FakeVideoRenderer renderer; 1834 cricket::FakeVideoRenderer renderer;
1789 EXPECT_TRUE(channel_->SetRenderer(last_ssrc_, &renderer)); 1835 EXPECT_TRUE(channel_->SetRenderer(last_ssrc_, &renderer));
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 EXPECT_EQ(kVp8Codec720p.height, streams[0].height); 1965 EXPECT_EQ(kVp8Codec720p.height, streams[0].height);
1920 1966
1921 codecs.clear(); 1967 codecs.clear();
1922 codecs.push_back(kVp8Codec360p); 1968 codecs.push_back(kVp8Codec360p);
1923 ASSERT_TRUE(channel_->SetSendCodecs(codecs)); 1969 ASSERT_TRUE(channel_->SetSendCodecs(codecs));
1924 streams = fake_call_->GetVideoSendStreams()[0]->GetVideoStreams(); 1970 streams = fake_call_->GetVideoSendStreams()[0]->GetVideoStreams();
1925 EXPECT_EQ(kVp8Codec360p.width, streams[0].width); 1971 EXPECT_EQ(kVp8Codec360p.width, streams[0].width);
1926 EXPECT_EQ(kVp8Codec360p.height, streams[0].height); 1972 EXPECT_EQ(kVp8Codec360p.height, streams[0].height);
1927 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); 1973 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
1928 } 1974 }
1975 */
1929 1976
1930 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithBitrates) { 1977 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithBitrates) {
1931 SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200", 1978 SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200",
1932 200000); 1979 200000);
1933 } 1980 }
1934 1981
1935 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithHighMaxBitrate) { 1982 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithHighMaxBitrate) {
1936 SetSendCodecsShouldWorkForBitrates("", 0, "", -1, "10000", 10000000); 1983 SetSendCodecsShouldWorkForBitrates("", 0, "", -1, "10000", 10000000);
1937 std::vector<webrtc::VideoStream> streams = AddSendStream()->GetVideoStreams(); 1984 std::vector<webrtc::VideoStream> streams = AddSendStream()->GetVideoStreams();
1938 ASSERT_EQ(1u, streams.size()); 1985 ASSERT_EQ(1u, streams.size());
1939 EXPECT_EQ(10000000, streams[0].max_bitrate_bps); 1986 EXPECT_EQ(10000000, streams[0].max_bitrate_bps);
1940 } 1987 }
1941 1988
1942 TEST_F(WebRtcVideoChannel2Test, 1989 TEST_F(WebRtcVideoChannel2Test,
1943 SetSendCodecsWithoutBitratesUsesCorrectDefaults) { 1990 SetSendCodecsWithoutBitratesUsesCorrectDefaults) {
1944 SetSendCodecsShouldWorkForBitrates( 1991 SetSendCodecsShouldWorkForBitrates(
1945 "", 0, "", -1, "", -1); 1992 "", 0, "", -1, "", -1);
1946 } 1993 }
1947 1994
1948 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsCapsMinAndStartBitrate) { 1995 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsCapsMinAndStartBitrate) {
1949 SetSendCodecsShouldWorkForBitrates("-1", 0, "-100", -1, "", -1); 1996 SetSendCodecsShouldWorkForBitrates("-1", 0, "-100", -1, "", -1);
1950 } 1997 }
1951 1998
1999 /* TODO(solenberg): !!!!!
1952 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectsMaxLessThanMinBitrate) { 2000 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectsMaxLessThanMinBitrate) {
1953 std::vector<VideoCodec> video_codecs = engine_.codecs(); 2001 std::vector<VideoCodec> video_codecs = engine_.codecs();
1954 video_codecs[0].params[kCodecParamMinBitrate] = "300"; 2002 video_codecs[0].params[kCodecParamMinBitrate] = "300";
1955 video_codecs[0].params[kCodecParamMaxBitrate] = "200"; 2003 video_codecs[0].params[kCodecParamMaxBitrate] = "200";
1956 EXPECT_FALSE(channel_->SetSendCodecs(video_codecs)); 2004 EXPECT_FALSE(channel_->SetSendCodecs(video_codecs));
1957 } 2005 }
1958 2006
1959 TEST_F(WebRtcVideoChannel2Test, 2007 TEST_F(WebRtcVideoChannel2Test,
1960 SetMaxSendBandwidthShouldPreserveOtherBitrates) { 2008 SetMaxSendBandwidthShouldPreserveOtherBitrates) {
1961 SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200", 2009 SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200",
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
2208 AddRecvStream(cricket::StreamParams::CreateLegacy(123)); 2256 AddRecvStream(cricket::StreamParams::CreateLegacy(123));
2209 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams()); 2257 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
2210 2258
2211 std::vector<VideoCodec> codecs2; 2259 std::vector<VideoCodec> codecs2;
2212 codecs2.push_back(kRedCodec); 2260 codecs2.push_back(kRedCodec);
2213 codecs2.push_back(kVp8Codec); 2261 codecs2.push_back(kVp8Codec);
2214 codecs2[1].preference += 1; 2262 codecs2[1].preference += 1;
2215 EXPECT_TRUE(channel_->SetRecvCodecs(codecs2)); 2263 EXPECT_TRUE(channel_->SetRecvCodecs(codecs2));
2216 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams()); 2264 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
2217 } 2265 }
2218 2266 */
2219 TEST_F(WebRtcVideoChannel2Test, SendStreamNotSendingByDefault) { 2267 TEST_F(WebRtcVideoChannel2Test, SendStreamNotSendingByDefault) {
2220 EXPECT_FALSE(AddSendStream()->IsSending()); 2268 EXPECT_FALSE(AddSendStream()->IsSending());
2221 } 2269 }
2222 2270
2223 TEST_F(WebRtcVideoChannel2Test, ReceiveStreamReceivingByDefault) { 2271 TEST_F(WebRtcVideoChannel2Test, ReceiveStreamReceivingByDefault) {
2224 EXPECT_TRUE(AddRecvStream()->IsReceiving()); 2272 EXPECT_TRUE(AddRecvStream()->IsReceiving());
2225 } 2273 }
2226 2274
2227 TEST_F(WebRtcVideoChannel2Test, SetSend) { 2275 TEST_F(WebRtcVideoChannel2Test, SetSend) {
2228 FakeVideoSendStream* stream = AddSendStream(); 2276 FakeVideoSendStream* stream = AddSendStream();
(...skipping 11 matching lines...) Expand all
2240 // false->false 2288 // false->false
2241 EXPECT_TRUE(channel_->SetSend(false)); 2289 EXPECT_TRUE(channel_->SetSend(false));
2242 EXPECT_FALSE(stream->IsSending()); 2290 EXPECT_FALSE(stream->IsSending());
2243 2291
2244 EXPECT_TRUE(channel_->SetSend(true)); 2292 EXPECT_TRUE(channel_->SetSend(true));
2245 FakeVideoSendStream* new_stream = AddSendStream(); 2293 FakeVideoSendStream* new_stream = AddSendStream();
2246 EXPECT_TRUE(new_stream->IsSending()) 2294 EXPECT_TRUE(new_stream->IsSending())
2247 << "Send stream created after SetSend(true) not sending initially."; 2295 << "Send stream created after SetSend(true) not sending initially.";
2248 } 2296 }
2249 2297
2298 /* TODO(solenberg): !!!!!
2250 // This test verifies DSCP settings are properly applied on video media channel. 2299 // This test verifies DSCP settings are properly applied on video media channel.
2251 TEST_F(WebRtcVideoChannel2Test, TestSetDscpOptions) { 2300 TEST_F(WebRtcVideoChannel2Test, TestSetDscpOptions) {
2252 rtc::scoped_ptr<cricket::FakeNetworkInterface> network_interface( 2301 rtc::scoped_ptr<cricket::FakeNetworkInterface> network_interface(
2253 new cricket::FakeNetworkInterface); 2302 new cricket::FakeNetworkInterface);
2254 channel_->SetInterface(network_interface.get()); 2303 channel_->SetInterface(network_interface.get());
2255 cricket::VideoOptions options; 2304 cricket::VideoOptions options;
2256 EXPECT_TRUE(channel_->SetOptions(options)); 2305 EXPECT_TRUE(channel_->SetOptions(options));
2257 EXPECT_EQ(rtc::DSCP_NO_CHANGE, network_interface->dscp()); 2306 EXPECT_EQ(rtc::DSCP_NO_CHANGE, network_interface->dscp());
2258 options.dscp.Set(true); 2307 options.dscp.Set(true);
2259 EXPECT_TRUE(channel_->SetOptions(options)); 2308 EXPECT_TRUE(channel_->SetOptions(options));
(...skipping 22 matching lines...) Expand all
2282 std::vector<cricket::VideoCodec> codecs; 2331 std::vector<cricket::VideoCodec> codecs;
2283 codecs.push_back(kVp8Codec); 2332 codecs.push_back(kVp8Codec);
2284 EXPECT_TRUE(channel_->SetSendCodecs(codecs)); 2333 EXPECT_TRUE(channel_->SetSendCodecs(codecs));
2285 2334
2286 AddSendStream(); 2335 AddSendStream();
2287 2336
2288 cricket::VideoMediaInfo info; 2337 cricket::VideoMediaInfo info;
2289 ASSERT_TRUE(channel_->GetStats(&info)); 2338 ASSERT_TRUE(channel_->GetStats(&info));
2290 EXPECT_EQ(kVp8Codec.name, info.senders[0].codec_name); 2339 EXPECT_EQ(kVp8Codec.name, info.senders[0].codec_name);
2291 } 2340 }
2341 */
2292 2342
2293 TEST_F(WebRtcVideoChannel2Test, GetStatsReportsCpuOveruseMetrics) { 2343 TEST_F(WebRtcVideoChannel2Test, GetStatsReportsCpuOveruseMetrics) {
2294 FakeVideoSendStream* stream = AddSendStream(); 2344 FakeVideoSendStream* stream = AddSendStream();
2295 webrtc::VideoSendStream::Stats stats; 2345 webrtc::VideoSendStream::Stats stats;
2296 stats.avg_encode_time_ms = 13; 2346 stats.avg_encode_time_ms = 13;
2297 stats.encode_usage_percent = 42; 2347 stats.encode_usage_percent = 42;
2298 stream->SetStats(stats); 2348 stream->SetStats(stats);
2299 2349
2300 cricket::VideoMediaInfo info; 2350 cricket::VideoMediaInfo info;
2301 ASSERT_TRUE(channel_->GetStats(&info)); 2351 ASSERT_TRUE(channel_->GetStats(&info));
(...skipping 12 matching lines...) Expand all
2314 stats.substreams[11].height = 90; 2364 stats.substreams[11].height = 90;
2315 stream->SetStats(stats); 2365 stream->SetStats(stats);
2316 2366
2317 cricket::VideoMediaInfo info; 2367 cricket::VideoMediaInfo info;
2318 ASSERT_TRUE(channel_->GetStats(&info)); 2368 ASSERT_TRUE(channel_->GetStats(&info));
2319 ASSERT_EQ(1u, info.senders.size()); 2369 ASSERT_EQ(1u, info.senders.size());
2320 EXPECT_EQ(123, info.senders[0].send_frame_width); 2370 EXPECT_EQ(123, info.senders[0].send_frame_width);
2321 EXPECT_EQ(90, info.senders[0].send_frame_height); 2371 EXPECT_EQ(90, info.senders[0].send_frame_height);
2322 } 2372 }
2323 2373
2374 /* TODO(solenberg): !!!!!
2324 TEST_F(WebRtcVideoChannel2Test, GetStatsTracksAdaptationStats) { 2375 TEST_F(WebRtcVideoChannel2Test, GetStatsTracksAdaptationStats) {
2325 AddSendStream(cricket::CreateSimStreamParams("cname", MAKE_VECTOR(kSsrcs3))); 2376 AddSendStream(cricket::CreateSimStreamParams("cname", MAKE_VECTOR(kSsrcs3)));
2326 2377
2327 // Capture format VGA. 2378 // Capture format VGA.
2328 cricket::FakeVideoCapturer video_capturer_vga; 2379 cricket::FakeVideoCapturer video_capturer_vga;
2329 const std::vector<cricket::VideoFormat>* formats = 2380 const std::vector<cricket::VideoFormat>* formats =
2330 video_capturer_vga.GetSupportedFormats(); 2381 video_capturer_vga.GetSupportedFormats();
2331 cricket::VideoFormat capture_format_vga = (*formats)[1]; 2382 cricket::VideoFormat capture_format_vga = (*formats)[1];
2332 EXPECT_EQ(cricket::CS_RUNNING, video_capturer_vga.Start(capture_format_vga)); 2383 EXPECT_EQ(cricket::CS_RUNNING, video_capturer_vga.Start(capture_format_vga));
2333 EXPECT_TRUE(channel_->SetCapturer(kSsrcs3[0], &video_capturer_vga)); 2384 EXPECT_TRUE(channel_->SetCapturer(kSsrcs3[0], &video_capturer_vga));
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2388 EXPECT_TRUE(video_capturer_hd.CaptureFrame()); 2439 EXPECT_TRUE(video_capturer_hd.CaptureFrame());
2389 info.Clear(); 2440 info.Clear();
2390 EXPECT_TRUE(channel_->GetStats(&info)); 2441 EXPECT_TRUE(channel_->GetStats(&info));
2391 ASSERT_EQ(1U, info.senders.size()); 2442 ASSERT_EQ(1U, info.senders.size());
2392 EXPECT_EQ(3, info.senders[0].adapt_changes); 2443 EXPECT_EQ(3, info.senders[0].adapt_changes);
2393 EXPECT_EQ(CoordinatedVideoAdapter::ADAPTREASON_CPU, 2444 EXPECT_EQ(CoordinatedVideoAdapter::ADAPTREASON_CPU,
2394 info.senders[0].adapt_reason); 2445 info.senders[0].adapt_reason);
2395 2446
2396 EXPECT_TRUE(channel_->SetCapturer(kSsrcs3[0], NULL)); 2447 EXPECT_TRUE(channel_->SetCapturer(kSsrcs3[0], NULL));
2397 } 2448 }
2398 2449 */
2399 TEST_F(WebRtcVideoChannel2Test, 2450 TEST_F(WebRtcVideoChannel2Test,
2400 GetStatsTranslatesSendRtcpPacketTypesCorrectly) { 2451 GetStatsTranslatesSendRtcpPacketTypesCorrectly) {
2401 FakeVideoSendStream* stream = AddSendStream(); 2452 FakeVideoSendStream* stream = AddSendStream();
2402 webrtc::VideoSendStream::Stats stats; 2453 webrtc::VideoSendStream::Stats stats;
2403 stats.substreams[17].rtcp_packet_type_counts.fir_packets = 2; 2454 stats.substreams[17].rtcp_packet_type_counts.fir_packets = 2;
2404 stats.substreams[17].rtcp_packet_type_counts.nack_packets = 3; 2455 stats.substreams[17].rtcp_packet_type_counts.nack_packets = 3;
2405 stats.substreams[17].rtcp_packet_type_counts.pli_packets = 4; 2456 stats.substreams[17].rtcp_packet_type_counts.pli_packets = 4;
2406 2457
2407 stats.substreams[42].rtcp_packet_type_counts.fir_packets = 5; 2458 stats.substreams[42].rtcp_packet_type_counts.fir_packets = 5;
2408 stats.substreams[42].rtcp_packet_type_counts.nack_packets = 7; 2459 stats.substreams[42].rtcp_packet_type_counts.nack_packets = 7;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2528 EXPECT_EQ(stats.target_media_bitrate_bps + stats2.target_media_bitrate_bps, 2579 EXPECT_EQ(stats.target_media_bitrate_bps + stats2.target_media_bitrate_bps,
2529 info.bw_estimations[0].target_enc_bitrate); 2580 info.bw_estimations[0].target_enc_bitrate);
2530 EXPECT_EQ(stats.media_bitrate_bps + stats2.media_bitrate_bps, 2581 EXPECT_EQ(stats.media_bitrate_bps + stats2.media_bitrate_bps,
2531 info.bw_estimations[0].actual_enc_bitrate); 2582 info.bw_estimations[0].actual_enc_bitrate);
2532 EXPECT_EQ(1 + 3 + 5 + 7, info.bw_estimations[0].transmit_bitrate) 2583 EXPECT_EQ(1 + 3 + 5 + 7, info.bw_estimations[0].transmit_bitrate)
2533 << "Bandwidth stats should take all streams into account."; 2584 << "Bandwidth stats should take all streams into account.";
2534 EXPECT_EQ(2 + 4 + 6 + 8, info.bw_estimations[0].retransmit_bitrate) 2585 EXPECT_EQ(2 + 4 + 6 + 8, info.bw_estimations[0].retransmit_bitrate)
2535 << "Bandwidth stats should take all streams into account."; 2586 << "Bandwidth stats should take all streams into account.";
2536 } 2587 }
2537 2588
2589 /* TODO(solenberg): !!!!!
2538 TEST_F(WebRtcVideoChannel2Test, DefaultReceiveStreamReconfiguresToUseRtx) { 2590 TEST_F(WebRtcVideoChannel2Test, DefaultReceiveStreamReconfiguresToUseRtx) {
2539 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs())); 2591 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
2540 2592
2541 const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs1); 2593 const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs1);
2542 const std::vector<uint32> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); 2594 const std::vector<uint32> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
2543 2595
2544 ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size()); 2596 ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size());
2545 const size_t kDataLength = 12; 2597 const size_t kDataLength = 12;
2546 uint8_t data[kDataLength]; 2598 uint8_t data[kDataLength];
2547 memset(data, 0, sizeof(data)); 2599 memset(data, 0, sizeof(data));
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
2727 TestReceiveUnsignalledSsrcPacket(kDefaultRtxVp8PlType, false); 2779 TestReceiveUnsignalledSsrcPacket(kDefaultRtxVp8PlType, false);
2728 } 2780 }
2729 2781
2730 TEST_F(WebRtcVideoChannel2Test, UlpfecPacketDoesntCreateUnsignalledStream) { 2782 TEST_F(WebRtcVideoChannel2Test, UlpfecPacketDoesntCreateUnsignalledStream) {
2731 TestReceiveUnsignalledSsrcPacket(kDefaultUlpfecType, false); 2783 TestReceiveUnsignalledSsrcPacket(kDefaultUlpfecType, false);
2732 } 2784 }
2733 2785
2734 TEST_F(WebRtcVideoChannel2Test, RedRtxPacketDoesntCreateUnsignalledStream) { 2786 TEST_F(WebRtcVideoChannel2Test, RedRtxPacketDoesntCreateUnsignalledStream) {
2735 TestReceiveUnsignalledSsrcPacket(kRedRtxPayloadType, false); 2787 TestReceiveUnsignalledSsrcPacket(kRedRtxPayloadType, false);
2736 } 2788 }
2789 */
2737 2790
2738 void WebRtcVideoChannel2Test::TestReceiverLocalSsrcConfiguration( 2791 void WebRtcVideoChannel2Test::TestReceiverLocalSsrcConfiguration(
2739 bool receiver_first) { 2792 bool receiver_first) {
2793 /* TODO(solenberg): !!!!!
2740 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs())); 2794 EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
2741 2795
2742 const uint32_t kSenderSsrc = 0xC0FFEE; 2796 const uint32_t kSenderSsrc = 0xC0FFEE;
2743 const uint32_t kReceiverSsrc = 0x4711; 2797 const uint32_t kReceiverSsrc = 0x4711;
2744 2798
2745 if (receiver_first) { 2799 if (receiver_first) {
2746 AddRecvStream(StreamParams::CreateLegacy(kReceiverSsrc)); 2800 AddRecvStream(StreamParams::CreateLegacy(kReceiverSsrc));
2747 std::vector<FakeVideoReceiveStream*> receive_streams = 2801 std::vector<FakeVideoReceiveStream*> receive_streams =
2748 fake_call_->GetVideoReceiveStreams(); 2802 fake_call_->GetVideoReceiveStreams();
2749 ASSERT_EQ(1u, receive_streams.size()); 2803 ASSERT_EQ(1u, receive_streams.size());
2750 // Bogus local SSRC when we have no sender. 2804 // Bogus local SSRC when we have no sender.
2751 EXPECT_EQ(1, receive_streams[0]->GetConfig().rtp.local_ssrc); 2805 EXPECT_EQ(1, receive_streams[0]->GetConfig().rtp.local_ssrc);
2752 } 2806 }
2753 AddSendStream(StreamParams::CreateLegacy(kSenderSsrc)); 2807 AddSendStream(StreamParams::CreateLegacy(kSenderSsrc));
2754 if (!receiver_first) 2808 if (!receiver_first)
2755 AddRecvStream(StreamParams::CreateLegacy(kReceiverSsrc)); 2809 AddRecvStream(StreamParams::CreateLegacy(kReceiverSsrc));
2756 std::vector<FakeVideoReceiveStream*> receive_streams = 2810 std::vector<FakeVideoReceiveStream*> receive_streams =
2757 fake_call_->GetVideoReceiveStreams(); 2811 fake_call_->GetVideoReceiveStreams();
2758 ASSERT_EQ(1u, receive_streams.size()); 2812 ASSERT_EQ(1u, receive_streams.size());
2759 EXPECT_EQ(kSenderSsrc, receive_streams[0]->GetConfig().rtp.local_ssrc); 2813 EXPECT_EQ(kSenderSsrc, receive_streams[0]->GetConfig().rtp.local_ssrc);
2814 */
2760 } 2815 }
2761 2816
2762 TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrc) { 2817 TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrc) {
2763 TestReceiverLocalSsrcConfiguration(false); 2818 TestReceiverLocalSsrcConfiguration(false);
2764 } 2819 }
2765 2820
2766 TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrcOnExistingReceivers) { 2821 TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrcOnExistingReceivers) {
2767 TestReceiverLocalSsrcConfiguration(true); 2822 TestReceiverLocalSsrcConfiguration(true);
2768 } 2823 }
2769 2824
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2938 DCHECK(fake_call_ == NULL); 2993 DCHECK(fake_call_ == NULL);
2939 fake_call_ = new FakeCall(config); 2994 fake_call_ = new FakeCall(config);
2940 return fake_call_; 2995 return fake_call_;
2941 } 2996 }
2942 2997
2943 void VerifySimulcastSettings(const VideoCodec& codec, 2998 void VerifySimulcastSettings(const VideoCodec& codec,
2944 VideoOptions::HighestBitrate bitrate_mode, 2999 VideoOptions::HighestBitrate bitrate_mode,
2945 size_t num_configured_streams, 3000 size_t num_configured_streams,
2946 size_t expected_num_streams, 3001 size_t expected_num_streams,
2947 SimulcastBitrateMode simulcast_bitrate_mode) { 3002 SimulcastBitrateMode simulcast_bitrate_mode) {
3003 /* TODO(solenberg): !!!!!
2948 cricket::VideoOptions options; 3004 cricket::VideoOptions options;
2949 options.video_highest_bitrate.Set(bitrate_mode); 3005 options.video_highest_bitrate.Set(bitrate_mode);
2950 EXPECT_TRUE(channel_->SetOptions(options)); 3006 EXPECT_TRUE(channel_->SetOptions(options));
2951 3007
2952 std::vector<VideoCodec> codecs; 3008 std::vector<VideoCodec> codecs;
2953 codecs.push_back(codec); 3009 codecs.push_back(codec);
2954 ASSERT_TRUE(channel_->SetSendCodecs(codecs)); 3010 ASSERT_TRUE(channel_->SetSendCodecs(codecs));
2955 3011
2956 std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs3); 3012 std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs3);
2957 DCHECK(num_configured_streams <= ssrcs.size()); 3013 DCHECK(num_configured_streams <= ssrcs.size());
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
3018 } else { 3074 } else {
3019 total_max_bitrate_bps += video_streams[i].target_bitrate_bps; 3075 total_max_bitrate_bps += video_streams[i].target_bitrate_bps;
3020 } 3076 }
3021 } 3077 }
3022 cricket::VideoMediaInfo info; 3078 cricket::VideoMediaInfo info;
3023 ASSERT_TRUE(channel_->GetStats(&info)); 3079 ASSERT_TRUE(channel_->GetStats(&info));
3024 ASSERT_EQ(1u, info.senders.size()); 3080 ASSERT_EQ(1u, info.senders.size());
3025 EXPECT_EQ(total_max_bitrate_bps, info.senders[0].preferred_bitrate); 3081 EXPECT_EQ(total_max_bitrate_bps, info.senders[0].preferred_bitrate);
3026 3082
3027 EXPECT_TRUE(channel_->SetCapturer(ssrcs.front(), NULL)); 3083 EXPECT_TRUE(channel_->SetCapturer(ssrcs.front(), NULL));
3084 */
3028 } 3085 }
3029 3086
3030 FakeVideoSendStream* AddSendStream() { 3087 FakeVideoSendStream* AddSendStream() {
3031 return AddSendStream(StreamParams::CreateLegacy(last_ssrc_++)); 3088 return AddSendStream(StreamParams::CreateLegacy(last_ssrc_++));
3032 } 3089 }
3033 3090
3034 FakeVideoSendStream* AddSendStream(const StreamParams& sp) { 3091 FakeVideoSendStream* AddSendStream(const StreamParams& sp) {
3035 size_t num_streams = 3092 size_t num_streams =
3036 fake_call_->GetVideoSendStreams().size(); 3093 fake_call_->GetVideoSendStreams().size();
3037 EXPECT_TRUE(channel_->AddSendStream(sp)); 3094 EXPECT_TRUE(channel_->AddSendStream(sp));
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
3178 // Ensures that the correct settings are applied to the codec when two temporal 3235 // Ensures that the correct settings are applied to the codec when two temporal
3179 // layer screencasting is enabled, and that the correct simulcast settings are 3236 // layer screencasting is enabled, and that the correct simulcast settings are
3180 // reapplied when disabling screencasting. 3237 // reapplied when disabling screencasting.
3181 TEST_F(WebRtcVideoChannel2SimulcastTest, 3238 TEST_F(WebRtcVideoChannel2SimulcastTest,
3182 DISABLED_TwoTemporalLayerScreencastSettings) { 3239 DISABLED_TwoTemporalLayerScreencastSettings) {
3183 // TODO(pbos): Implement. 3240 // TODO(pbos): Implement.
3184 FAIL() << "Not implemented."; 3241 FAIL() << "Not implemented.";
3185 } 3242 }
3186 3243
3187 } // namespace cricket 3244 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698