Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: media/cast/net/rtp/rtp_packetizer_unittest.cc

Issue 560223002: [Cast] Limit frames in flight by duration, and not by number of frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaks. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/cast/net/rtp/packet_storage_unittest.cc ('k') | media/cast/net/rtp/rtp_sender.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 int expected_packet_id_; 95 int expected_packet_id_;
96 uint32 expected_frame_id_; 96 uint32 expected_frame_id_;
97 uint32 expectd_rtp_timestamp_; 97 uint32 expectd_rtp_timestamp_;
98 98
99 DISALLOW_COPY_AND_ASSIGN(TestRtpPacketTransport); 99 DISALLOW_COPY_AND_ASSIGN(TestRtpPacketTransport);
100 }; 100 };
101 101
102 class RtpPacketizerTest : public ::testing::Test { 102 class RtpPacketizerTest : public ::testing::Test {
103 protected: 103 protected:
104 RtpPacketizerTest() 104 RtpPacketizerTest()
105 : task_runner_(new test::FakeSingleThreadTaskRunner(&testing_clock_)), 105 : task_runner_(new test::FakeSingleThreadTaskRunner(&testing_clock_)) {
106 video_frame_(),
107 packet_storage_(200) {
108 config_.sequence_number = kSeqNum; 106 config_.sequence_number = kSeqNum;
109 config_.ssrc = kSsrc; 107 config_.ssrc = kSsrc;
110 config_.payload_type = kPayload; 108 config_.payload_type = kPayload;
111 config_.max_payload_length = kMaxPacketLength; 109 config_.max_payload_length = kMaxPacketLength;
112 transport_.reset(new TestRtpPacketTransport(config_)); 110 transport_.reset(new TestRtpPacketTransport(config_));
113 pacer_.reset(new PacedSender(kTargetBurstSize, 111 pacer_.reset(new PacedSender(kTargetBurstSize,
114 kMaxBurstSize, 112 kMaxBurstSize,
115 &testing_clock_, 113 &testing_clock_,
116 &logging_, 114 &logging_,
117 transport_.get(), 115 transport_.get(),
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 video_frame_.reference_time = testing_clock_.NowTicks(); 170 video_frame_.reference_time = testing_clock_.NowTicks();
173 rtp_packetizer_->SendFrameAsPackets(video_frame_); 171 rtp_packetizer_->SendFrameAsPackets(video_frame_);
174 RunTasks(33 + 1); 172 RunTasks(33 + 1);
175 EXPECT_EQ(expected_num_of_packets, rtp_packetizer_->send_packet_count()); 173 EXPECT_EQ(expected_num_of_packets, rtp_packetizer_->send_packet_count());
176 EXPECT_EQ(kFrameSize, rtp_packetizer_->send_octet_count()); 174 EXPECT_EQ(kFrameSize, rtp_packetizer_->send_octet_count());
177 EXPECT_EQ(expected_num_of_packets, transport_->number_of_packets_received()); 175 EXPECT_EQ(expected_num_of_packets, transport_->number_of_packets_received());
178 } 176 }
179 177
180 } // namespace cast 178 } // namespace cast
181 } // namespace media 179 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/rtp/packet_storage_unittest.cc ('k') | media/cast/net/rtp/rtp_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698