| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 371 |
| 372 cricket::SendDataParams params; | 372 cricket::SendDataParams params; |
| 373 params.ssrc = 42; | 373 params.ssrc = 42; |
| 374 unsigned char data[] = "food"; | 374 unsigned char data[] = "food"; |
| 375 rtc::CopyOnWriteBuffer payload(data, 4); | 375 rtc::CopyOnWriteBuffer payload(data, 4); |
| 376 cricket::SendDataResult result; | 376 cricket::SendDataResult result; |
| 377 | 377 |
| 378 // With rtp overhead of 32 bytes, each one of our packets is 36 | 378 // With rtp overhead of 32 bytes, each one of our packets is 36 |
| 379 // bytes, or 288 bits. So, a limit of 872bps will allow 3 packets, | 379 // bytes, or 288 bits. So, a limit of 872bps will allow 3 packets, |
| 380 // but not four. | 380 // but not four. |
| 381 parameters.max_bandwidth_bps = 872; | 381 parameters.max_bitrate_bps = rtc::Optional<int>(872); |
| 382 ASSERT_TRUE(dmc->SetSendParameters(parameters)); | 382 ASSERT_TRUE(dmc->SetSendParameters(parameters)); |
| 383 | 383 |
| 384 EXPECT_TRUE(dmc->SendData(params, payload, &result)); | 384 EXPECT_TRUE(dmc->SendData(params, payload, &result)); |
| 385 EXPECT_TRUE(dmc->SendData(params, payload, &result)); | 385 EXPECT_TRUE(dmc->SendData(params, payload, &result)); |
| 386 EXPECT_TRUE(dmc->SendData(params, payload, &result)); | 386 EXPECT_TRUE(dmc->SendData(params, payload, &result)); |
| 387 EXPECT_FALSE(dmc->SendData(params, payload, &result)); | 387 EXPECT_FALSE(dmc->SendData(params, payload, &result)); |
| 388 EXPECT_FALSE(dmc->SendData(params, payload, &result)); | 388 EXPECT_FALSE(dmc->SendData(params, payload, &result)); |
| 389 | 389 |
| 390 SetNow(0.9); | 390 SetNow(0.9); |
| 391 EXPECT_FALSE(dmc->SendData(params, payload, &result)); | 391 EXPECT_FALSE(dmc->SendData(params, payload, &result)); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 0x80, 0x65, 0x00, 0x02 | 451 0x80, 0x65, 0x00, 0x02 |
| 452 }; | 452 }; |
| 453 rtc::CopyOnWriteBuffer packet(data, sizeof(data)); | 453 rtc::CopyOnWriteBuffer packet(data, sizeof(data)); |
| 454 | 454 |
| 455 std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel()); | 455 std::unique_ptr<cricket::RtpDataMediaChannel> dmc(CreateChannel()); |
| 456 | 456 |
| 457 // Too short | 457 // Too short |
| 458 dmc->OnPacketReceived(&packet, rtc::PacketTime()); | 458 dmc->OnPacketReceived(&packet, rtc::PacketTime()); |
| 459 EXPECT_FALSE(HasReceivedData()); | 459 EXPECT_FALSE(HasReceivedData()); |
| 460 } | 460 } |
| OLD | NEW |