Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 public: | 43 public: |
| 44 RtcpRttStatsTestImpl() : rtt_ms_(0) {} | 44 RtcpRttStatsTestImpl() : rtt_ms_(0) {} |
| 45 virtual ~RtcpRttStatsTestImpl() {} | 45 virtual ~RtcpRttStatsTestImpl() {} |
| 46 | 46 |
| 47 void OnRttUpdate(int64_t rtt_ms) override { rtt_ms_ = rtt_ms; } | 47 void OnRttUpdate(int64_t rtt_ms) override { rtt_ms_ = rtt_ms; } |
| 48 int64_t LastProcessedRtt() const override { return rtt_ms_; } | 48 int64_t LastProcessedRtt() const override { return rtt_ms_; } |
| 49 int64_t rtt_ms_; | 49 int64_t rtt_ms_; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 class SendTransport : public Transport, | 52 class SendTransport : public Transport, |
| 53 public NullRtpData { | 53 public RtpData { |
| 54 public: | 54 public: |
| 55 SendTransport() | 55 SendTransport() |
| 56 : receiver_(NULL), | 56 : receiver_(NULL), |
| 57 clock_(NULL), | 57 clock_(NULL), |
| 58 delay_ms_(0), | 58 delay_ms_(0), |
| 59 rtp_packets_sent_(0) { | 59 rtp_packets_sent_(0) { |
| 60 } | 60 } |
| 61 | 61 |
| 62 void SetRtpRtcpModule(ModuleRtpRtcpImpl* receiver) { | 62 void SetRtpRtcpModule(ModuleRtpRtcpImpl* receiver) { |
| 63 receiver_ = receiver; | 63 receiver_ = receiver; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 81 parser.Parse(data, len); | 81 parser.Parse(data, len); |
| 82 last_nack_list_ = parser.nack()->packet_ids(); | 82 last_nack_list_ = parser.nack()->packet_ids(); |
| 83 | 83 |
| 84 if (clock_) { | 84 if (clock_) { |
| 85 clock_->AdvanceTimeMilliseconds(delay_ms_); | 85 clock_->AdvanceTimeMilliseconds(delay_ms_); |
| 86 } | 86 } |
| 87 EXPECT_TRUE(receiver_); | 87 EXPECT_TRUE(receiver_); |
| 88 EXPECT_EQ(0, receiver_->IncomingRtcpPacket(data, len)); | 88 EXPECT_EQ(0, receiver_->IncomingRtcpPacket(data, len)); |
| 89 return true; | 89 return true; |
| 90 } | 90 } |
| 91 int OnReceivedPayloadData(const uint8_t* payload_data, | |
|
danilchap
2017/05/31 12:59:28
return type is int32_t
nisse-webrtc
2017/05/31 13:24:13
Done.
| |
| 92 size_t payload_size, | |
| 93 const WebRtcRTPHeader* rtp_header) override { | |
| 94 return 0; | |
| 95 } | |
| 91 ModuleRtpRtcpImpl* receiver_; | 96 ModuleRtpRtcpImpl* receiver_; |
| 92 SimulatedClock* clock_; | 97 SimulatedClock* clock_; |
| 93 int64_t delay_ms_; | 98 int64_t delay_ms_; |
| 94 int rtp_packets_sent_; | 99 int rtp_packets_sent_; |
| 95 RTPHeader last_rtp_header_; | 100 RTPHeader last_rtp_header_; |
| 96 std::vector<uint16_t> last_nack_list_; | 101 std::vector<uint16_t> last_nack_list_; |
| 97 }; | 102 }; |
| 98 | 103 |
| 99 class RtpRtcpModule : public RtcpPacketTypeCounterObserver { | 104 class RtpRtcpModule : public RtcpPacketTypeCounterObserver { |
| 100 public: | 105 public: |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 555 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests); | 560 EXPECT_EQ(6U, receiver_.RtcpSent().unique_nack_requests); |
| 556 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); | 561 EXPECT_THAT(receiver_.LastNackListSent(), ElementsAre(11, 18, 20, 21)); |
| 557 | 562 |
| 558 // Send module receives the request. | 563 // Send module receives the request. |
| 559 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); | 564 EXPECT_EQ(2U, sender_.RtcpReceived().nack_packets); |
| 560 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); | 565 EXPECT_EQ(8U, sender_.RtcpReceived().nack_requests); |
| 561 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); | 566 EXPECT_EQ(6U, sender_.RtcpReceived().unique_nack_requests); |
| 562 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); | 567 EXPECT_EQ(75, sender_.RtcpReceived().UniqueNackRequestsInPercent()); |
| 563 } | 568 } |
| 564 } // namespace webrtc | 569 } // namespace webrtc |
| OLD | NEW |