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

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

Issue 1845673002: Removing `preference` field from `cricket::Codec`. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding back a unit test. Created 4 years, 8 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 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 13 matching lines...) Expand all
24 #include "webrtc/media/engine/webrtcvideochannelfactory.h" 24 #include "webrtc/media/engine/webrtcvideochannelfactory.h"
25 #include "webrtc/media/engine/webrtcvideoengine2.h" 25 #include "webrtc/media/engine/webrtcvideoengine2.h"
26 #include "webrtc/media/engine/webrtcvoiceengine.h" 26 #include "webrtc/media/engine/webrtcvoiceengine.h"
27 #include "webrtc/test/field_trial.h" 27 #include "webrtc/test/field_trial.h"
28 #include "webrtc/video_encoder.h" 28 #include "webrtc/video_encoder.h"
29 29
30 namespace { 30 namespace {
31 static const int kDefaultQpMax = 56; 31 static const int kDefaultQpMax = 56;
32 static const int kDefaultFramerate = 30; 32 static const int kDefaultFramerate = 30;
33 33
34 static const cricket::VideoCodec kVp8Codec720p(100, "VP8", 1280, 720, 30, 0); 34 static const cricket::VideoCodec kVp8Codec720p(100, "VP8", 1280, 720, 30);
35 static const cricket::VideoCodec kVp8Codec360p(100, "VP8", 640, 360, 30, 0); 35 static const cricket::VideoCodec kVp8Codec360p(100, "VP8", 640, 360, 30);
36 static const cricket::VideoCodec kVp8Codec270p(100, "VP8", 480, 270, 30, 0); 36 static const cricket::VideoCodec kVp8Codec270p(100, "VP8", 480, 270, 30);
37 37
38 static const cricket::VideoCodec kVp8Codec(100, "VP8", 640, 400, 30, 0); 38 static const cricket::VideoCodec kVp8Codec(100, "VP8", 640, 400, 30);
39 static const cricket::VideoCodec kVp9Codec(101, "VP9", 640, 400, 30, 0); 39 static const cricket::VideoCodec kVp9Codec(101, "VP9", 640, 400, 30);
40 static const cricket::VideoCodec kH264Codec(102, "H264", 640, 400, 30, 0); 40 static const cricket::VideoCodec kH264Codec(102, "H264", 640, 400, 30);
41 41
42 static const cricket::VideoCodec kRedCodec(116, "red", 0, 0, 0, 0); 42 static const cricket::VideoCodec kRedCodec(116, "red", 0, 0, 0);
43 static const cricket::VideoCodec kUlpfecCodec(117, "ulpfec", 0, 0, 0, 0); 43 static const cricket::VideoCodec kUlpfecCodec(117, "ulpfec", 0, 0, 0);
44 44
45 static const uint8_t kRedRtxPayloadType = 125; 45 static const uint8_t kRedRtxPayloadType = 125;
46 46
47 static const uint32_t kSsrcs1[] = {1}; 47 static const uint32_t kSsrcs1[] = {1};
48 static const uint32_t kSsrcs3[] = {1, 2, 3}; 48 static const uint32_t kSsrcs3[] = {1, 2, 3};
49 static const uint32_t kRtxSsrcs1[] = {4}; 49 static const uint32_t kRtxSsrcs1[] = {4};
50 static const uint32_t kIncomingUnsignalledSsrc = 0xC0FFEE; 50 static const uint32_t kIncomingUnsignalledSsrc = 0xC0FFEE;
51 static const char kUnsupportedExtensionName[] = 51 static const char kUnsupportedExtensionName[] =
52 "urn:ietf:params:rtp-hdrext:unsupported"; 52 "urn:ietf:params:rtp-hdrext:unsupported";
53 53
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 // TODO(juberti): Understand why we get decode errors on this test. 846 // TODO(juberti): Understand why we get decode errors on this test.
847 WEBRTC_DISABLED_BASE_TEST(AdaptFramerate); 847 WEBRTC_DISABLED_BASE_TEST(AdaptFramerate);
848 848
849 WEBRTC_BASE_TEST(SendsLowerResolutionOnSmallerFrames); 849 WEBRTC_BASE_TEST(SendsLowerResolutionOnSmallerFrames);
850 850
851 WEBRTC_BASE_TEST(MuteStream); 851 WEBRTC_BASE_TEST(MuteStream);
852 852
853 WEBRTC_BASE_TEST(MultipleSendStreams); 853 WEBRTC_BASE_TEST(MultipleSendStreams);
854 854
855 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Vga) { 855 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Vga) {
856 SendAndReceive(cricket::VideoCodec(100, "VP8", 640, 400, 30, 0)); 856 SendAndReceive(cricket::VideoCodec(100, "VP8", 640, 400, 30));
857 } 857 }
858 858
859 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Qvga) { 859 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Qvga) {
860 SendAndReceive(cricket::VideoCodec(100, "VP8", 320, 200, 30, 0)); 860 SendAndReceive(cricket::VideoCodec(100, "VP8", 320, 200, 30));
861 } 861 }
862 862
863 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8SvcQqvga) { 863 TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8SvcQqvga) {
864 SendAndReceive(cricket::VideoCodec(100, "VP8", 160, 100, 30, 0)); 864 SendAndReceive(cricket::VideoCodec(100, "VP8", 160, 100, 30));
865 } 865 }
866 866
867 TEST_F(WebRtcVideoChannel2BaseTest, TwoStreamsSendAndReceive) { 867 TEST_F(WebRtcVideoChannel2BaseTest, TwoStreamsSendAndReceive) {
868 Base::TwoStreamsSendAndReceive(kVp8Codec); 868 Base::TwoStreamsSendAndReceive(kVp8Codec);
869 } 869 }
870 870
871 class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test { 871 class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test {
872 public: 872 public:
873 WebRtcVideoChannel2Test() : WebRtcVideoChannel2Test("") {} 873 WebRtcVideoChannel2Test() : WebRtcVideoChannel2Test("") {}
874 explicit WebRtcVideoChannel2Test(const char* field_trials) 874 explicit WebRtcVideoChannel2Test(const char* field_trials)
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after
2178 FakeVideoSendStream* stream = AddSendStream(); 2178 FakeVideoSendStream* stream = AddSendStream();
2179 webrtc::VideoSendStream::Config config = stream->GetConfig(); 2179 webrtc::VideoSendStream::Config config = stream->GetConfig();
2180 2180
2181 EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type); 2181 EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type);
2182 EXPECT_EQ(-1, config.rtp.fec.red_payload_type); 2182 EXPECT_EQ(-1, config.rtp.fec.red_payload_type);
2183 } 2183 }
2184 2184
2185 TEST_F(WebRtcVideoChannel2Test, 2185 TEST_F(WebRtcVideoChannel2Test,
2186 SetSendCodecRejectsRtxWithoutAssociatedPayloadType) { 2186 SetSendCodecRejectsRtxWithoutAssociatedPayloadType) {
2187 cricket::VideoSendParameters parameters; 2187 cricket::VideoSendParameters parameters;
2188 cricket::VideoCodec rtx_codec(96, "rtx", 0, 0, 0, 0); 2188 cricket::VideoCodec rtx_codec(96, "rtx", 0, 0, 0);
2189 parameters.codecs.push_back(rtx_codec); 2189 parameters.codecs.push_back(rtx_codec);
2190 EXPECT_FALSE(channel_->SetSendParameters(parameters)) 2190 EXPECT_FALSE(channel_->SetSendParameters(parameters))
2191 << "RTX codec without associated payload type should be rejected."; 2191 << "RTX codec without associated payload type should be rejected.";
2192 } 2192 }
2193 2193
2194 TEST_F(WebRtcVideoChannel2Test, 2194 TEST_F(WebRtcVideoChannel2Test,
2195 SetSendCodecRejectsRtxWithoutMatchingVideoCodec) { 2195 SetSendCodecRejectsRtxWithoutMatchingVideoCodec) {
2196 cricket::VideoSendParameters parameters; 2196 cricket::VideoSendParameters parameters;
2197 cricket::VideoCodec rtx_codec = 2197 cricket::VideoCodec rtx_codec =
2198 cricket::VideoCodec::CreateRtxCodec(96, kVp8Codec.id); 2198 cricket::VideoCodec::CreateRtxCodec(96, kVp8Codec.id);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2410 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsAcceptAllValidPayloadTypes) { 2410 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsAcceptAllValidPayloadTypes) {
2411 cricket::VideoSendParameters parameters; 2411 cricket::VideoSendParameters parameters;
2412 parameters.codecs.push_back(kVp8Codec); 2412 parameters.codecs.push_back(kVp8Codec);
2413 for (int payload_type = 0; payload_type <= 127; ++payload_type) { 2413 for (int payload_type = 0; payload_type <= 127; ++payload_type) {
2414 parameters.codecs[0].id = payload_type; 2414 parameters.codecs[0].id = payload_type;
2415 EXPECT_TRUE(channel_->SetSendParameters(parameters)) 2415 EXPECT_TRUE(channel_->SetSendParameters(parameters))
2416 << "Payload type '" << payload_type << "' rejected."; 2416 << "Payload type '" << payload_type << "' rejected.";
2417 } 2417 }
2418 } 2418 }
2419 2419
2420 // Test that setting the a different set of codecs but with an identical front
2421 // codec doesn't result in the stream being recreated.
2422 // This may happen when a subsequent negotiation includes fewew codecs, as a
pbos-webrtc 2016/04/05 09:30:32 fewer
Taylor Brandstetter 2016/04/05 17:57:13 Done.
2423 // result of one of the codecs being rejected.
2424 TEST_F(WebRtcVideoChannel2Test,
2425 SetSendCodecsIdenticalFirstCodecDoesntRecreateStream) {
2426 cricket::VideoSendParameters parameters1;
2427 parameters1.codecs.push_back(kVp8Codec);
2428 parameters1.codecs.push_back(kVp9Codec);
2429 EXPECT_TRUE(channel_->SetSendParameters(parameters1));
2430
2431 AddSendStream();
2432 EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
2433
2434 cricket::VideoSendParameters parameters2;
2435 parameters2.codecs.push_back(kVp8Codec);
2436 EXPECT_TRUE(channel_->SetSendParameters(parameters2));
2437 EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams());
2438 }
2439
2420 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithOnlyVp8) { 2440 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithOnlyVp8) {
2421 cricket::VideoRecvParameters parameters; 2441 cricket::VideoRecvParameters parameters;
2422 parameters.codecs.push_back(kVp8Codec); 2442 parameters.codecs.push_back(kVp8Codec);
2423 EXPECT_TRUE(channel_->SetRecvParameters(parameters)); 2443 EXPECT_TRUE(channel_->SetRecvParameters(parameters));
2424 } 2444 }
2425 2445
2426 // Test that we set our inbound RTX codecs properly. 2446 // Test that we set our inbound RTX codecs properly.
2427 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithRtx) { 2447 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithRtx) {
2428 cricket::VideoRecvParameters parameters; 2448 cricket::VideoRecvParameters parameters;
2429 parameters.codecs.push_back(kVp8Codec); 2449 parameters.codecs.push_back(kVp8Codec);
2430 cricket::VideoCodec rtx_codec(96, "rtx", 0, 0, 0, 0); 2450 cricket::VideoCodec rtx_codec(96, "rtx", 0, 0, 0);
2431 parameters.codecs.push_back(rtx_codec); 2451 parameters.codecs.push_back(rtx_codec);
2432 EXPECT_FALSE(channel_->SetRecvParameters(parameters)) 2452 EXPECT_FALSE(channel_->SetRecvParameters(parameters))
2433 << "RTX codec without associated payload should be rejected."; 2453 << "RTX codec without associated payload should be rejected.";
2434 2454
2435 parameters.codecs[1].SetParam("apt", kVp8Codec.id + 1); 2455 parameters.codecs[1].SetParam("apt", kVp8Codec.id + 1);
2436 EXPECT_FALSE(channel_->SetRecvParameters(parameters)) 2456 EXPECT_FALSE(channel_->SetRecvParameters(parameters))
2437 << "RTX codec with invalid associated payload type should be rejected."; 2457 << "RTX codec with invalid associated payload type should be rejected.";
2438 2458
2439 parameters.codecs[1].SetParam("apt", kVp8Codec.id); 2459 parameters.codecs[1].SetParam("apt", kVp8Codec.id);
2440 EXPECT_TRUE(channel_->SetRecvParameters(parameters)); 2460 EXPECT_TRUE(channel_->SetRecvParameters(parameters));
2441 2461
2442 cricket::VideoCodec rtx_codec2(97, "rtx", 0, 0, 0, 0); 2462 cricket::VideoCodec rtx_codec2(97, "rtx", 0, 0, 0);
2443 rtx_codec2.SetParam("apt", rtx_codec.id); 2463 rtx_codec2.SetParam("apt", rtx_codec.id);
2444 parameters.codecs.push_back(rtx_codec2); 2464 parameters.codecs.push_back(rtx_codec2);
2445 2465
2446 EXPECT_FALSE(channel_->SetRecvParameters(parameters)) << 2466 EXPECT_FALSE(channel_->SetRecvParameters(parameters)) <<
2447 "RTX codec with another RTX as associated payload type should be " 2467 "RTX codec with another RTX as associated payload type should be "
2448 "rejected."; 2468 "rejected.";
2449 } 2469 }
2450 2470
2451 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsDifferentPayloadType) { 2471 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsDifferentPayloadType) {
2452 cricket::VideoRecvParameters parameters; 2472 cricket::VideoRecvParameters parameters;
2453 parameters.codecs.push_back(kVp8Codec); 2473 parameters.codecs.push_back(kVp8Codec);
2454 parameters.codecs[0].id = 99; 2474 parameters.codecs[0].id = 99;
2455 EXPECT_TRUE(channel_->SetRecvParameters(parameters)); 2475 EXPECT_TRUE(channel_->SetRecvParameters(parameters));
2456 } 2476 }
2457 2477
2458 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsAcceptDefaultCodecs) { 2478 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsAcceptDefaultCodecs) {
2459 cricket::VideoRecvParameters parameters; 2479 cricket::VideoRecvParameters parameters;
2460 parameters.codecs = engine_.codecs(); 2480 parameters.codecs = engine_.codecs();
2461 EXPECT_TRUE(channel_->SetRecvParameters(parameters)); 2481 EXPECT_TRUE(channel_->SetRecvParameters(parameters));
2462 2482
2463 FakeVideoReceiveStream* stream = AddRecvStream(); 2483 FakeVideoReceiveStream* stream = AddRecvStream();
2464 webrtc::VideoReceiveStream::Config config = stream->GetConfig(); 2484 webrtc::VideoReceiveStream::Config config = stream->GetConfig();
2465 EXPECT_EQ(engine_.codecs()[0].name, config.decoders[0].payload_name); 2485 EXPECT_EQ(engine_.codecs()[0].name, config.decoders[0].payload_name);
2466 EXPECT_EQ(engine_.codecs()[0].id, config.decoders[0].payload_type); 2486 EXPECT_EQ(engine_.codecs()[0].id, config.decoders[0].payload_type);
2467 } 2487 }
2468 2488
2469 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectUnsupportedCodec) { 2489 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectUnsupportedCodec) {
2470 cricket::VideoRecvParameters parameters; 2490 cricket::VideoRecvParameters parameters;
2471 parameters.codecs.push_back(kVp8Codec); 2491 parameters.codecs.push_back(kVp8Codec);
2472 parameters.codecs.push_back(VideoCodec(101, "WTF3", 640, 400, 30, 0)); 2492 parameters.codecs.push_back(VideoCodec(101, "WTF3", 640, 400, 30));
2473 EXPECT_FALSE(channel_->SetRecvParameters(parameters)); 2493 EXPECT_FALSE(channel_->SetRecvParameters(parameters));
2474 } 2494 }
2475 2495
2476 // TODO(pbos): Enable VP9 through external codec support 2496 // TODO(pbos): Enable VP9 through external codec support
2477 TEST_F(WebRtcVideoChannel2Test, 2497 TEST_F(WebRtcVideoChannel2Test,
2478 DISABLED_SetRecvCodecsAcceptsMultipleVideoCodecs) { 2498 DISABLED_SetRecvCodecsAcceptsMultipleVideoCodecs) {
2479 cricket::VideoRecvParameters parameters; 2499 cricket::VideoRecvParameters parameters;
2480 parameters.codecs.push_back(kVp8Codec); 2500 parameters.codecs.push_back(kVp8Codec);
2481 parameters.codecs.push_back(kVp9Codec); 2501 parameters.codecs.push_back(kVp9Codec);
2482 EXPECT_TRUE(channel_->SetRecvParameters(parameters)); 2502 EXPECT_TRUE(channel_->SetRecvParameters(parameters));
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2530 2550
2531 TEST_F(WebRtcVideoChannel2Test, 2551 TEST_F(WebRtcVideoChannel2Test,
2532 SetRecvCodecsAcceptSameCodecOnMultiplePayloadTypes) { 2552 SetRecvCodecsAcceptSameCodecOnMultiplePayloadTypes) {
2533 cricket::VideoRecvParameters parameters; 2553 cricket::VideoRecvParameters parameters;
2534 parameters.codecs.push_back(kVp8Codec); 2554 parameters.codecs.push_back(kVp8Codec);
2535 parameters.codecs.push_back(kVp8Codec); 2555 parameters.codecs.push_back(kVp8Codec);
2536 parameters.codecs[1].id += 1; 2556 parameters.codecs[1].id += 1;
2537 EXPECT_TRUE(channel_->SetRecvParameters(parameters)); 2557 EXPECT_TRUE(channel_->SetRecvParameters(parameters));
2538 } 2558 }
2539 2559
2540 // Test that setting the same codecs but with a different order and preference 2560 // Test that setting the same codecs but with a different order
2541 // doesn't result in the stream being recreated. 2561 // doesn't result in the stream being recreated.
2542 TEST_F(WebRtcVideoChannel2Test, 2562 TEST_F(WebRtcVideoChannel2Test,
2543 SetRecvCodecsDifferentOrderAndPreferenceDoesntRecreateStream) { 2563 SetRecvCodecsDifferentOrderDoesntRecreateStream) {
2544 cricket::VideoRecvParameters parameters1; 2564 cricket::VideoRecvParameters parameters1;
2545 parameters1.codecs.push_back(kVp8Codec); 2565 parameters1.codecs.push_back(kVp8Codec);
2546 parameters1.codecs.push_back(kRedCodec); 2566 parameters1.codecs.push_back(kRedCodec);
2547 EXPECT_TRUE(channel_->SetRecvParameters(parameters1)); 2567 EXPECT_TRUE(channel_->SetRecvParameters(parameters1));
2548 2568
2549 AddRecvStream(cricket::StreamParams::CreateLegacy(123)); 2569 AddRecvStream(cricket::StreamParams::CreateLegacy(123));
2550 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams()); 2570 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
2551 2571
2552 cricket::VideoRecvParameters parameters2; 2572 cricket::VideoRecvParameters parameters2;
2553 parameters2.codecs.push_back(kRedCodec); 2573 parameters2.codecs.push_back(kRedCodec);
2554 parameters2.codecs.push_back(kVp8Codec); 2574 parameters2.codecs.push_back(kVp8Codec);
2555 parameters2.codecs[1].preference += 1;
2556 EXPECT_TRUE(channel_->SetRecvParameters(parameters2)); 2575 EXPECT_TRUE(channel_->SetRecvParameters(parameters2));
2557 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams()); 2576 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
2558 } 2577 }
2559 2578
2560 TEST_F(WebRtcVideoChannel2Test, SendStreamNotSendingByDefault) { 2579 TEST_F(WebRtcVideoChannel2Test, SendStreamNotSendingByDefault) {
2561 EXPECT_FALSE(AddSendStream()->IsSending()); 2580 EXPECT_FALSE(AddSendStream()->IsSending());
2562 } 2581 }
2563 2582
2564 TEST_F(WebRtcVideoChannel2Test, ReceiveStreamReceivingByDefault) { 2583 TEST_F(WebRtcVideoChannel2Test, ReceiveStreamReceivingByDefault) {
2565 EXPECT_TRUE(AddRecvStream()->IsReceiving()); 2584 EXPECT_TRUE(AddRecvStream()->IsReceiving());
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2730 2749
2731 // Capture format VGA. 2750 // Capture format VGA.
2732 cricket::FakeVideoCapturer video_capturer_vga; 2751 cricket::FakeVideoCapturer video_capturer_vga;
2733 const std::vector<cricket::VideoFormat>* formats = 2752 const std::vector<cricket::VideoFormat>* formats =
2734 video_capturer_vga.GetSupportedFormats(); 2753 video_capturer_vga.GetSupportedFormats();
2735 cricket::VideoFormat capture_format_vga = (*formats)[1]; 2754 cricket::VideoFormat capture_format_vga = (*formats)[1];
2736 EXPECT_EQ(cricket::CS_RUNNING, video_capturer_vga.Start(capture_format_vga)); 2755 EXPECT_EQ(cricket::CS_RUNNING, video_capturer_vga.Start(capture_format_vga));
2737 EXPECT_TRUE(channel_->SetCapturer(kSsrcs3[0], &video_capturer_vga)); 2756 EXPECT_TRUE(channel_->SetCapturer(kSsrcs3[0], &video_capturer_vga));
2738 EXPECT_TRUE(video_capturer_vga.CaptureFrame()); 2757 EXPECT_TRUE(video_capturer_vga.CaptureFrame());
2739 2758
2740 cricket::VideoCodec send_codec(100, "VP8", 640, 480, 30, 0); 2759 cricket::VideoCodec send_codec(100, "VP8", 640, 480, 30);
2741 cricket::VideoSendParameters parameters; 2760 cricket::VideoSendParameters parameters;
2742 parameters.codecs.push_back(send_codec); 2761 parameters.codecs.push_back(send_codec);
2743 EXPECT_TRUE(channel_->SetSendParameters(parameters)); 2762 EXPECT_TRUE(channel_->SetSendParameters(parameters));
2744 EXPECT_TRUE(channel_->SetSend(true)); 2763 EXPECT_TRUE(channel_->SetSend(true));
2745 2764
2746 // Verify that the CpuOveruseObserver is registered and trigger downgrade. 2765 // Verify that the CpuOveruseObserver is registered and trigger downgrade.
2747 2766
2748 // Trigger overuse. 2767 // Trigger overuse.
2749 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); 2768 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
2750 webrtc::LoadObserver* overuse_callback = 2769 webrtc::LoadObserver* overuse_callback =
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2805 2824
2806 // Capture format VGA. 2825 // Capture format VGA.
2807 cricket::FakeVideoCapturer video_capturer_vga; 2826 cricket::FakeVideoCapturer video_capturer_vga;
2808 const std::vector<cricket::VideoFormat>* formats = 2827 const std::vector<cricket::VideoFormat>* formats =
2809 video_capturer_vga.GetSupportedFormats(); 2828 video_capturer_vga.GetSupportedFormats();
2810 cricket::VideoFormat capture_format_vga = (*formats)[1]; 2829 cricket::VideoFormat capture_format_vga = (*formats)[1];
2811 EXPECT_EQ(cricket::CS_RUNNING, video_capturer_vga.Start(capture_format_vga)); 2830 EXPECT_EQ(cricket::CS_RUNNING, video_capturer_vga.Start(capture_format_vga));
2812 EXPECT_TRUE(channel_->SetCapturer(kSsrcs3[0], &video_capturer_vga)); 2831 EXPECT_TRUE(channel_->SetCapturer(kSsrcs3[0], &video_capturer_vga));
2813 EXPECT_TRUE(video_capturer_vga.CaptureFrame()); 2832 EXPECT_TRUE(video_capturer_vga.CaptureFrame());
2814 2833
2815 cricket::VideoCodec send_codec(100, "VP8", 640, 480, 30, 0); 2834 cricket::VideoCodec send_codec(100, "VP8", 640, 480, 30);
2816 cricket::VideoSendParameters parameters; 2835 cricket::VideoSendParameters parameters;
2817 parameters.codecs.push_back(send_codec); 2836 parameters.codecs.push_back(send_codec);
2818 EXPECT_TRUE(channel_->SetSendParameters(parameters)); 2837 EXPECT_TRUE(channel_->SetSendParameters(parameters));
2819 EXPECT_TRUE(channel_->SetSend(true)); 2838 EXPECT_TRUE(channel_->SetSend(true));
2820 2839
2821 // Verify that the CpuOveruseObserver is registered and trigger downgrade. 2840 // Verify that the CpuOveruseObserver is registered and trigger downgrade.
2822 2841
2823 // Trigger overuse -> adapt CPU. 2842 // Trigger overuse -> adapt CPU.
2824 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); 2843 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
2825 webrtc::LoadObserver* overuse_callback = 2844 webrtc::LoadObserver* overuse_callback =
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
3490 } 3509 }
3491 3510
3492 // Test that we normalize send codec format size in simulcast. 3511 // Test that we normalize send codec format size in simulcast.
3493 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3512 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3494 cricket::VideoCodec codec(kVp8Codec270p); 3513 cricket::VideoCodec codec(kVp8Codec270p);
3495 codec.width += 1; 3514 codec.width += 1;
3496 codec.height += 1; 3515 codec.height += 1;
3497 VerifySimulcastSettings(codec, 2, 2); 3516 VerifySimulcastSettings(codec, 2, 2);
3498 } 3517 }
3499 } // namespace cricket 3518 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698