| 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 <deque> | 5 #include <deque> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 void FeedLipSyncInfoIntoReceiver() { | 120 void FeedLipSyncInfoIntoReceiver() { |
| 121 const base::TimeTicks now = testing_clock_->NowTicks(); | 121 const base::TimeTicks now = testing_clock_->NowTicks(); |
| 122 const int64 rtp_timestamp = (now - start_time_) * | 122 const int64 rtp_timestamp = (now - start_time_) * |
| 123 config_.rtp_timebase / base::TimeDelta::FromSeconds(1); | 123 config_.rtp_timebase / base::TimeDelta::FromSeconds(1); |
| 124 CHECK_LE(0, rtp_timestamp); | 124 CHECK_LE(0, rtp_timestamp); |
| 125 uint32 ntp_seconds; | 125 uint32 ntp_seconds; |
| 126 uint32 ntp_fraction; | 126 uint32 ntp_fraction; |
| 127 ConvertTimeTicksToNtp(now, &ntp_seconds, &ntp_fraction); | 127 ConvertTimeTicksToNtp(now, &ntp_seconds, &ntp_fraction); |
| 128 TestRtcpPacketBuilder rtcp_packet; | 128 TestRtcpPacketBuilder rtcp_packet; |
| 129 rtcp_packet.AddSrWithNtp(config_.incoming_ssrc, | 129 rtcp_packet.AddSrWithNtp(config_.sender_ssrc, |
| 130 ntp_seconds, ntp_fraction, | 130 ntp_seconds, ntp_fraction, |
| 131 static_cast<uint32>(rtp_timestamp)); | 131 static_cast<uint32>(rtp_timestamp)); |
| 132 ASSERT_TRUE(receiver_->ProcessPacket(rtcp_packet.GetPacket().Pass())); | 132 ASSERT_TRUE(receiver_->ProcessPacket(rtcp_packet.GetPacket().Pass())); |
| 133 } | 133 } |
| 134 | 134 |
| 135 FrameReceiverConfig config_; | 135 FrameReceiverConfig config_; |
| 136 std::vector<uint8> payload_; | 136 std::vector<uint8> payload_; |
| 137 RtpCastHeader rtp_header_; | 137 RtpCastHeader rtp_header_; |
| 138 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. | 138 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. |
| 139 base::TimeTicks start_time_; | 139 base::TimeTicks start_time_; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 EXPECT_GE(kFirstFrameId + 3, frame_events[i].frame_id); | 411 EXPECT_GE(kFirstFrameId + 3, frame_events[i].frame_id); |
| 412 const int frame_offset = frame_events[i].frame_id - kFirstFrameId; | 412 const int frame_offset = frame_events[i].frame_id - kFirstFrameId; |
| 413 EXPECT_EQ(frame_offset * rtp_advance_per_frame, | 413 EXPECT_EQ(frame_offset * rtp_advance_per_frame, |
| 414 frame_events[i].rtp_timestamp); | 414 frame_events[i].rtp_timestamp); |
| 415 } | 415 } |
| 416 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber); | 416 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber); |
| 417 } | 417 } |
| 418 | 418 |
| 419 } // namespace cast | 419 } // namespace cast |
| 420 } // namespace media | 420 } // namespace media |
| OLD | NEW |