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 "media/cast/net/rtp/rtp_packetizer.h" | 5 #include "media/cast/net/rtp/rtp_packetizer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 parser.ParsePacket(&packet->data[0], packet->data.size(), &rtp_header, | 73 parser.ParsePacket(&packet->data[0], packet->data.size(), &rtp_header, |
74 &payload_data, &payload_size); | 74 &payload_data, &payload_size); |
75 VerifyRtpHeader(rtp_header); | 75 VerifyRtpHeader(rtp_header); |
76 ++sequence_number_; | 76 ++sequence_number_; |
77 ++expected_packet_id_; | 77 ++expected_packet_id_; |
78 return true; | 78 return true; |
79 } | 79 } |
80 | 80 |
81 int64_t GetBytesSent() final { return 0; } | 81 int64_t GetBytesSent() final { return 0; } |
82 | 82 |
| 83 void StartReceiving( |
| 84 const PacketReceiverCallbackWithStatus& packet_receiver) final {} |
| 85 |
| 86 void StopReceiving() final {} |
| 87 |
83 size_t number_of_packets_received() const { return packets_sent_; } | 88 size_t number_of_packets_received() const { return packets_sent_; } |
84 | 89 |
85 void set_expected_number_of_packets(size_t expected_number_of_packets) { | 90 void set_expected_number_of_packets(size_t expected_number_of_packets) { |
86 expected_number_of_packets_ = expected_number_of_packets; | 91 expected_number_of_packets_ = expected_number_of_packets; |
87 } | 92 } |
88 | 93 |
89 void set_rtp_timestamp(RtpTimeTicks rtp_timestamp) { | 94 void set_rtp_timestamp(RtpTimeTicks rtp_timestamp) { |
90 expected_rtp_timestamp_ = rtp_timestamp; | 95 expected_rtp_timestamp_ = rtp_timestamp; |
91 } | 96 } |
92 | 97 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 video_frame_.reference_time = testing_clock_.NowTicks(); | 189 video_frame_.reference_time = testing_clock_.NowTicks(); |
185 rtp_packetizer_->SendFrameAsPackets(video_frame_); | 190 rtp_packetizer_->SendFrameAsPackets(video_frame_); |
186 RunTasks(33 + 1); | 191 RunTasks(33 + 1); |
187 EXPECT_EQ(expected_num_of_packets, rtp_packetizer_->send_packet_count()); | 192 EXPECT_EQ(expected_num_of_packets, rtp_packetizer_->send_packet_count()); |
188 EXPECT_EQ(kFrameSize, rtp_packetizer_->send_octet_count()); | 193 EXPECT_EQ(kFrameSize, rtp_packetizer_->send_octet_count()); |
189 EXPECT_EQ(expected_num_of_packets, transport_->number_of_packets_received()); | 194 EXPECT_EQ(expected_num_of_packets, transport_->number_of_packets_received()); |
190 } | 195 } |
191 | 196 |
192 } // namespace cast | 197 } // namespace cast |
193 } // namespace media | 198 } // namespace media |
OLD | NEW |