| OLD | NEW | 
|---|
| 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 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2671   cricket::VideoRecvParameters parameters; | 2671   cricket::VideoRecvParameters parameters; | 
| 2672   parameters.codecs.push_back(kVp8Codec); | 2672   parameters.codecs.push_back(kVp8Codec); | 
| 2673   parameters.codecs.push_back(kVp9Codec); | 2673   parameters.codecs.push_back(kVp9Codec); | 
| 2674   EXPECT_TRUE(channel_->SetRecvParameters(parameters)); | 2674   EXPECT_TRUE(channel_->SetRecvParameters(parameters)); | 
| 2675   FAIL();  // TODO(pbos): Verify that the FEC parameters are set for all codecs. | 2675   FAIL();  // TODO(pbos): Verify that the FEC parameters are set for all codecs. | 
| 2676 } | 2676 } | 
| 2677 | 2677 | 
| 2678 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithoutFecDisablesFec) { | 2678 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithoutFecDisablesFec) { | 
| 2679   cricket::VideoSendParameters send_parameters; | 2679   cricket::VideoSendParameters send_parameters; | 
| 2680   send_parameters.codecs.push_back(kVp8Codec); | 2680   send_parameters.codecs.push_back(kVp8Codec); | 
|  | 2681   send_parameters.codecs.push_back(kRedCodec); | 
| 2681   send_parameters.codecs.push_back(kUlpfecCodec); | 2682   send_parameters.codecs.push_back(kUlpfecCodec); | 
| 2682   ASSERT_TRUE(channel_->SetSendParameters(send_parameters)); | 2683   ASSERT_TRUE(channel_->SetSendParameters(send_parameters)); | 
| 2683 | 2684 | 
| 2684   FakeVideoReceiveStream* stream = AddRecvStream(); | 2685   FakeVideoReceiveStream* stream = AddRecvStream(); | 
| 2685   webrtc::VideoReceiveStream::Config config = stream->GetConfig(); | 2686   webrtc::VideoReceiveStream::Config config = stream->GetConfig(); | 
| 2686 | 2687 | 
| 2687   EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type); | 2688   EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type); | 
| 2688 | 2689 | 
| 2689   cricket::VideoRecvParameters recv_parameters; | 2690   cricket::VideoRecvParameters recv_parameters; | 
| 2690   recv_parameters.codecs.push_back(kVp8Codec); | 2691   recv_parameters.codecs.push_back(kVp8Codec); | 
| 2691   ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters)); | 2692   ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters)); | 
| 2692   stream = fake_call_->GetVideoReceiveStreams()[0]; | 2693   stream = fake_call_->GetVideoReceiveStreams()[0]; | 
| 2693   ASSERT_TRUE(stream != NULL); | 2694   ASSERT_TRUE(stream != NULL); | 
| 2694   config = stream->GetConfig(); | 2695   config = stream->GetConfig(); | 
| 2695   EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type) | 2696   EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type) | 
| 2696       << "SetSendCodec without FEC should disable current FEC."; | 2697       << "SetSendCodec without FEC should disable current FEC."; | 
| 2697 } | 2698 } | 
| 2698 | 2699 | 
|  | 2700 TEST_F(WebRtcVideoChannel2Test, SetSendParamsWithoutFecDisablesReceivingFec) { | 
|  | 2701   FakeVideoReceiveStream* stream = AddRecvStream(); | 
|  | 2702   webrtc::VideoReceiveStream::Config config = stream->GetConfig(); | 
|  | 2703 | 
|  | 2704   EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type); | 
|  | 2705 | 
|  | 2706   cricket::VideoRecvParameters recv_parameters; | 
|  | 2707   recv_parameters.codecs.push_back(kVp8Codec); | 
|  | 2708   recv_parameters.codecs.push_back(kRedCodec); | 
|  | 2709   recv_parameters.codecs.push_back(kUlpfecCodec); | 
|  | 2710   ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters)); | 
|  | 2711   stream = fake_call_->GetVideoReceiveStreams()[0]; | 
|  | 2712   ASSERT_TRUE(stream != NULL); | 
|  | 2713   config = stream->GetConfig(); | 
|  | 2714   EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type) | 
|  | 2715       << "FEC should be enabled on the recieve stream."; | 
|  | 2716 | 
|  | 2717   cricket::VideoSendParameters send_parameters; | 
|  | 2718   send_parameters.codecs.push_back(kVp8Codec); | 
|  | 2719   ASSERT_TRUE(channel_->SetSendParameters(send_parameters)); | 
|  | 2720   stream = fake_call_->GetVideoReceiveStreams()[0]; | 
|  | 2721   config = stream->GetConfig(); | 
|  | 2722   EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type) | 
|  | 2723       << "FEC should have been disabled when we know the other side won't do " | 
|  | 2724          "FEC."; | 
|  | 2725 | 
|  | 2726   send_parameters.codecs.push_back(kRedCodec); | 
|  | 2727   send_parameters.codecs.push_back(kUlpfecCodec); | 
|  | 2728   ASSERT_TRUE(channel_->SetSendParameters(send_parameters)); | 
|  | 2729   stream = fake_call_->GetVideoReceiveStreams()[0]; | 
|  | 2730   config = stream->GetConfig(); | 
|  | 2731   EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type) | 
|  | 2732       << "FEC should be enabled on the recieve stream."; | 
|  | 2733 } | 
|  | 2734 | 
| 2699 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectDuplicateFecPayloads) { | 2735 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectDuplicateFecPayloads) { | 
| 2700   cricket::VideoRecvParameters parameters; | 2736   cricket::VideoRecvParameters parameters; | 
| 2701   parameters.codecs.push_back(kVp8Codec); | 2737   parameters.codecs.push_back(kVp8Codec); | 
| 2702   parameters.codecs.push_back(kRedCodec); | 2738   parameters.codecs.push_back(kRedCodec); | 
| 2703   parameters.codecs[1].id = parameters.codecs[0].id; | 2739   parameters.codecs[1].id = parameters.codecs[0].id; | 
| 2704   EXPECT_FALSE(channel_->SetRecvParameters(parameters)); | 2740   EXPECT_FALSE(channel_->SetRecvParameters(parameters)); | 
| 2705 } | 2741 } | 
| 2706 | 2742 | 
| 2707 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectDuplicateCodecPayloads) { | 2743 TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectDuplicateCodecPayloads) { | 
| 2708   cricket::VideoRecvParameters parameters; | 2744   cricket::VideoRecvParameters parameters; | 
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3743 } | 3779 } | 
| 3744 | 3780 | 
| 3745 // Test that we normalize send codec format size in simulcast. | 3781 // Test that we normalize send codec format size in simulcast. | 
| 3746 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3782 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 
| 3747   cricket::VideoCodec codec(kVp8Codec270p); | 3783   cricket::VideoCodec codec(kVp8Codec270p); | 
| 3748   codec.width += 1; | 3784   codec.width += 1; | 
| 3749   codec.height += 1; | 3785   codec.height += 1; | 
| 3750   VerifySimulcastSettings(codec, 2, 2); | 3786   VerifySimulcastSettings(codec, 2, 2); | 
| 3751 } | 3787 } | 
| 3752 }  // namespace cricket | 3788 }  // namespace cricket | 
| OLD | NEW | 
|---|