| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/cast/net/rtp_sender/rtp_packetizer/rtp_packetizer.h" | 5 #include "media/cast/transport/rtp_sender/rtp_packetizer/rtp_packetizer.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/cast_config.h" | 9 #include "media/cast/cast_config.h" |
| 10 #include "media/cast/net/pacing/paced_sender.h" | 10 #include "media/cast/transport/pacing/paced_sender.h" |
| 11 #include "media/cast/net/rtp_sender/packet_storage/packet_storage.h" | 11 #include "media/cast/transport/rtp_sender/packet_storage/packet_storage.h" |
| 12 #include "media/cast/net/rtp_sender/rtp_packetizer/test/rtp_header_parser.h" | 12 #include "media/cast/transport/rtp_sender/rtp_packetizer/test/rtp_header_parser.
h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 | 14 |
| 15 namespace media { | 15 namespace media { |
| 16 namespace cast { | 16 namespace cast { |
| 17 namespace transport { |
| 17 | 18 |
| 18 static const int kPayload = 127; | 19 static const int kPayload = 127; |
| 19 static const uint32 kTimestampMs = 10; | 20 static const uint32 kTimestampMs = 10; |
| 20 static const uint16 kSeqNum = 33; | 21 static const uint16 kSeqNum = 33; |
| 21 static const int kMaxPacketLength = 1500; | 22 static const int kMaxPacketLength = 1500; |
| 22 static const int kSsrc = 0x12345; | 23 static const int kSsrc = 0x12345; |
| 23 static const unsigned int kFrameSize = 5000; | 24 static const unsigned int kFrameSize = 5000; |
| 24 static const int kMaxPacketStorageTimeMs = 300; | 25 static const int kMaxPacketStorageTimeMs = 300; |
| 25 | 26 |
| 26 class TestRtpPacketTransport : public PacedPacketSender { | 27 class TestRtpPacketTransport : public PacedPacketSender { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 int expected_num_of_packets = kFrameSize / kMaxPacketLength + 1; | 143 int expected_num_of_packets = kFrameSize / kMaxPacketLength + 1; |
| 143 transport_->SetExpectedNumberOfPackets(expected_num_of_packets); | 144 transport_->SetExpectedNumberOfPackets(expected_num_of_packets); |
| 144 | 145 |
| 145 testing_clock_.Advance(base::TimeDelta::FromMilliseconds(kTimestampMs)); | 146 testing_clock_.Advance(base::TimeDelta::FromMilliseconds(kTimestampMs)); |
| 146 rtp_packetizer_->IncomingEncodedVideoFrame(&video_frame_, | 147 rtp_packetizer_->IncomingEncodedVideoFrame(&video_frame_, |
| 147 testing_clock_.NowTicks()); | 148 testing_clock_.NowTicks()); |
| 148 EXPECT_EQ(expected_num_of_packets, rtp_packetizer_->send_packets_count()); | 149 EXPECT_EQ(expected_num_of_packets, rtp_packetizer_->send_packets_count()); |
| 149 EXPECT_EQ(kFrameSize, rtp_packetizer_->send_octet_count()); | 150 EXPECT_EQ(kFrameSize, rtp_packetizer_->send_octet_count()); |
| 150 } | 151 } |
| 151 | 152 |
| 153 } // namespace transport |
| 152 } // namespace cast | 154 } // namespace cast |
| 153 } // namespace media | 155 } // namespace media |
| OLD | NEW |