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 3375 matching lines...) Loading... |
3386 parameters.encodings[0].active = false; | 3386 parameters.encodings[0].active = false; |
3387 EXPECT_TRUE(channel_->SetRtpParameters(last_ssrc_, parameters)); | 3387 EXPECT_TRUE(channel_->SetRtpParameters(last_ssrc_, parameters)); |
3388 EXPECT_FALSE(stream->IsSending()); | 3388 EXPECT_FALSE(stream->IsSending()); |
3389 | 3389 |
3390 // Now change it back to active and verify we resume sending. | 3390 // Now change it back to active and verify we resume sending. |
3391 parameters.encodings[0].active = true; | 3391 parameters.encodings[0].active = true; |
3392 EXPECT_TRUE(channel_->SetRtpParameters(last_ssrc_, parameters)); | 3392 EXPECT_TRUE(channel_->SetRtpParameters(last_ssrc_, parameters)); |
3393 EXPECT_TRUE(stream->IsSending()); | 3393 EXPECT_TRUE(stream->IsSending()); |
3394 } | 3394 } |
3395 | 3395 |
| 3396 // Test that GetRtpParameters returns the currently configured codecs. |
| 3397 TEST_F(WebRtcVideoChannel2Test, GetRtpParametersCodecs) { |
| 3398 AddSendStream(); |
| 3399 cricket::VideoSendParameters parameters; |
| 3400 parameters.codecs.push_back(kVp8Codec); |
| 3401 parameters.codecs.push_back(kVp9Codec); |
| 3402 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 3403 |
| 3404 webrtc::RtpParameters rtp_parameters = channel_->GetRtpParameters(last_ssrc_); |
| 3405 ASSERT_EQ(2u, rtp_parameters.codecs.size()); |
| 3406 EXPECT_EQ(kVp8Codec.id, rtp_parameters.codecs[0].payload_type); |
| 3407 EXPECT_EQ(kVp8Codec.name, rtp_parameters.codecs[0].mime_type); |
| 3408 EXPECT_EQ(kVp8Codec.clockrate, rtp_parameters.codecs[0].clock_rate); |
| 3409 EXPECT_EQ(1, rtp_parameters.codecs[0].channels); |
| 3410 EXPECT_EQ(kVp9Codec.id, rtp_parameters.codecs[1].payload_type); |
| 3411 EXPECT_EQ(kVp9Codec.name, rtp_parameters.codecs[1].mime_type); |
| 3412 EXPECT_EQ(kVp9Codec.clockrate, rtp_parameters.codecs[1].clock_rate); |
| 3413 EXPECT_EQ(1, rtp_parameters.codecs[1].channels); |
| 3414 } |
| 3415 |
3396 void WebRtcVideoChannel2Test::TestReceiverLocalSsrcConfiguration( | 3416 void WebRtcVideoChannel2Test::TestReceiverLocalSsrcConfiguration( |
3397 bool receiver_first) { | 3417 bool receiver_first) { |
3398 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); | 3418 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); |
3399 | 3419 |
3400 const uint32_t kSenderSsrc = 0xC0FFEE; | 3420 const uint32_t kSenderSsrc = 0xC0FFEE; |
3401 const uint32_t kSecondSenderSsrc = 0xBADCAFE; | 3421 const uint32_t kSecondSenderSsrc = 0xBADCAFE; |
3402 const uint32_t kReceiverSsrc = 0x4711; | 3422 const uint32_t kReceiverSsrc = 0x4711; |
3403 const uint32_t kExpectedDefaultReceiverSsrc = 1; | 3423 const uint32_t kExpectedDefaultReceiverSsrc = 1; |
3404 | 3424 |
3405 if (receiver_first) { | 3425 if (receiver_first) { |
(...skipping 174 matching lines...) Loading... |
3580 } | 3600 } |
3581 | 3601 |
3582 // Test that we normalize send codec format size in simulcast. | 3602 // Test that we normalize send codec format size in simulcast. |
3583 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3603 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
3584 cricket::VideoCodec codec(kVp8Codec270p); | 3604 cricket::VideoCodec codec(kVp8Codec270p); |
3585 codec.width += 1; | 3605 codec.width += 1; |
3586 codec.height += 1; | 3606 codec.height += 1; |
3587 VerifySimulcastSettings(codec, 2, 2); | 3607 VerifySimulcastSettings(codec, 2, 2); |
3588 } | 3608 } |
3589 } // namespace cricket | 3609 } // namespace cricket |
OLD | NEW |