| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
| 9 #include "media/cast/net/rtcp/rtcp.h" | 9 #include "media/cast/net/rtcp/rtcp.h" |
| 10 #include "media/cast/net/rtp/cast_message_builder.h" | 10 #include "media/cast/net/rtp/cast_message_builder.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 static const uint32 kLongTimeIncrementMs = 40; | 21 static const uint32 kLongTimeIncrementMs = 40; |
| 22 static const int64 kStartMillisecond = INT64_C(12345678900000); | 22 static const int64 kStartMillisecond = INT64_C(12345678900000); |
| 23 | 23 |
| 24 typedef std::map<uint32, size_t> MissingPacketsMap; | 24 typedef std::map<uint32, size_t> MissingPacketsMap; |
| 25 | 25 |
| 26 class NackFeedbackVerification : public RtpPayloadFeedback { | 26 class NackFeedbackVerification : public RtpPayloadFeedback { |
| 27 public: | 27 public: |
| 28 NackFeedbackVerification() | 28 NackFeedbackVerification() |
| 29 : triggered_(false), missing_packets_(), last_frame_acked_(0) {} | 29 : triggered_(false), missing_packets_(), last_frame_acked_(0) {} |
| 30 | 30 |
| 31 virtual void CastFeedback(const RtcpCastMessage& cast_feedback) OVERRIDE { | 31 virtual void CastFeedback(const RtcpCastMessage& cast_feedback) override { |
| 32 EXPECT_EQ(kSsrc, cast_feedback.media_ssrc); | 32 EXPECT_EQ(kSsrc, cast_feedback.media_ssrc); |
| 33 | 33 |
| 34 last_frame_acked_ = cast_feedback.ack_frame_id; | 34 last_frame_acked_ = cast_feedback.ack_frame_id; |
| 35 | 35 |
| 36 MissingFramesAndPacketsMap::const_iterator frame_it = | 36 MissingFramesAndPacketsMap::const_iterator frame_it = |
| 37 cast_feedback.missing_frames_and_packets.begin(); | 37 cast_feedback.missing_frames_and_packets.begin(); |
| 38 | 38 |
| 39 // Keep track of the number of missing packets per frame. | 39 // Keep track of the number of missing packets per frame. |
| 40 missing_packets_.clear(); | 40 missing_packets_.clear(); |
| 41 while (frame_it != cast_feedback.missing_frames_and_packets.end()) { | 41 while (frame_it != cast_feedback.missing_frames_and_packets.end()) { |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 SetFrameIds(frame_id, frame_id - 1); | 427 SetFrameIds(frame_id, frame_id - 1); |
| 428 InsertPacket(); | 428 InsertPacket(); |
| 429 testing_clock_.Advance( | 429 testing_clock_.Advance( |
| 430 base::TimeDelta::FromMilliseconds(kShortTimeIncrementMs)); | 430 base::TimeDelta::FromMilliseconds(kShortTimeIncrementMs)); |
| 431 EXPECT_TRUE(feedback_.triggered()); | 431 EXPECT_TRUE(feedback_.triggered()); |
| 432 EXPECT_EQ(frame_id, feedback_.last_frame_acked()); | 432 EXPECT_EQ(frame_id, feedback_.last_frame_acked()); |
| 433 } | 433 } |
| 434 | 434 |
| 435 } // namespace cast | 435 } // namespace cast |
| 436 } // namespace media | 436 } // namespace media |
| OLD | NEW |