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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/test/simple_test_tick_clock.h" | 10 #include "base/test/simple_test_tick_clock.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 static const int64_t kStartMillisecond = INT64_C(12345678900000); | 24 static const int64_t kStartMillisecond = INT64_C(12345678900000); |
25 | 25 |
26 typedef std::map<uint32_t, size_t> MissingPacketsMap; | 26 typedef std::map<uint32_t, size_t> MissingPacketsMap; |
27 | 27 |
28 class NackFeedbackVerification : public RtpPayloadFeedback { | 28 class NackFeedbackVerification : public RtpPayloadFeedback { |
29 public: | 29 public: |
30 NackFeedbackVerification() | 30 NackFeedbackVerification() |
31 : triggered_(false), missing_packets_(), last_frame_acked_(0) {} | 31 : triggered_(false), missing_packets_(), last_frame_acked_(0) {} |
32 | 32 |
33 void CastFeedback(const RtcpCastMessage& cast_feedback) final { | 33 void CastFeedback(const RtcpCastMessage& cast_feedback) final { |
34 EXPECT_EQ(kSsrc, cast_feedback.media_ssrc); | 34 EXPECT_EQ(kSsrc, cast_feedback.remote_ssrc); |
35 | 35 |
36 last_frame_acked_ = cast_feedback.ack_frame_id; | 36 last_frame_acked_ = cast_feedback.ack_frame_id; |
37 | 37 |
38 MissingFramesAndPacketsMap::const_iterator frame_it = | 38 MissingFramesAndPacketsMap::const_iterator frame_it = |
39 cast_feedback.missing_frames_and_packets.begin(); | 39 cast_feedback.missing_frames_and_packets.begin(); |
40 | 40 |
41 // Keep track of the number of missing packets per frame. | 41 // Keep track of the number of missing packets per frame. |
42 missing_packets_.clear(); | 42 missing_packets_.clear(); |
43 while (frame_it != cast_feedback.missing_frames_and_packets.end()) { | 43 while (frame_it != cast_feedback.missing_frames_and_packets.end()) { |
44 // Check for complete frame lost. | 44 // Check for complete frame lost. |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 SetFrameIds(frame_id, frame_id - 1); | 430 SetFrameIds(frame_id, frame_id - 1); |
431 InsertPacket(); | 431 InsertPacket(); |
432 testing_clock_.Advance( | 432 testing_clock_.Advance( |
433 base::TimeDelta::FromMilliseconds(kShortTimeIncrementMs)); | 433 base::TimeDelta::FromMilliseconds(kShortTimeIncrementMs)); |
434 EXPECT_TRUE(feedback_.triggered()); | 434 EXPECT_TRUE(feedback_.triggered()); |
435 EXPECT_EQ(frame_id, feedback_.last_frame_acked()); | 435 EXPECT_EQ(frame_id, feedback_.last_frame_acked()); |
436 } | 436 } |
437 | 437 |
438 } // namespace cast | 438 } // namespace cast |
439 } // namespace media | 439 } // namespace media |
OLD | NEW |