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

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

Issue 2048033003: Refactoring: CastTransport InitializeAudio/InitializeVideo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments. Created 4 years, 5 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/pacing/paced_sender_unittest.cc ('k') | media/cast/sender/audio_sender.cc » ('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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 RtpPacketizerTest() 115 RtpPacketizerTest()
116 : task_runner_(new FakeSingleThreadTaskRunner(&testing_clock_)) { 116 : task_runner_(new FakeSingleThreadTaskRunner(&testing_clock_)) {
117 config_.sequence_number = kSeqNum; 117 config_.sequence_number = kSeqNum;
118 config_.ssrc = kSsrc; 118 config_.ssrc = kSsrc;
119 config_.payload_type = kPayload; 119 config_.payload_type = kPayload;
120 config_.max_payload_length = kMaxPacketLength; 120 config_.max_payload_length = kMaxPacketLength;
121 transport_.reset(new TestRtpPacketTransport(config_)); 121 transport_.reset(new TestRtpPacketTransport(config_));
122 pacer_.reset(new PacedSender(kTargetBurstSize, kMaxBurstSize, 122 pacer_.reset(new PacedSender(kTargetBurstSize, kMaxBurstSize,
123 &testing_clock_, nullptr, transport_.get(), 123 &testing_clock_, nullptr, transport_.get(),
124 task_runner_)); 124 task_runner_));
125 pacer_->RegisterVideoSsrc(config_.ssrc); 125 pacer_->RegisterSsrc(config_.ssrc, false);
126 rtp_packetizer_.reset(new RtpPacketizer( 126 rtp_packetizer_.reset(new RtpPacketizer(
127 pacer_.get(), &packet_storage_, config_)); 127 pacer_.get(), &packet_storage_, config_));
128 video_frame_.dependency = EncodedFrame::DEPENDENT; 128 video_frame_.dependency = EncodedFrame::DEPENDENT;
129 video_frame_.frame_id = FrameId::first() + 1; 129 video_frame_.frame_id = FrameId::first() + 1;
130 video_frame_.referenced_frame_id = video_frame_.frame_id - 1; 130 video_frame_.referenced_frame_id = video_frame_.frame_id - 1;
131 video_frame_.data.assign(kFrameSize, 123); 131 video_frame_.data.assign(kFrameSize, 123);
132 video_frame_.rtp_timestamp = RtpTimeTicks().Expand(UINT32_C(0x0055aa11)); 132 video_frame_.rtp_timestamp = RtpTimeTicks().Expand(UINT32_C(0x0055aa11));
133 } 133 }
134 134
135 void RunTasks(int during_ms) { 135 void RunTasks(int during_ms) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 video_frame_.reference_time = testing_clock_.NowTicks(); 190 video_frame_.reference_time = testing_clock_.NowTicks();
191 rtp_packetizer_->SendFrameAsPackets(video_frame_); 191 rtp_packetizer_->SendFrameAsPackets(video_frame_);
192 RunTasks(33 + 1); 192 RunTasks(33 + 1);
193 EXPECT_EQ(expected_num_of_packets, rtp_packetizer_->send_packet_count()); 193 EXPECT_EQ(expected_num_of_packets, rtp_packetizer_->send_packet_count());
194 EXPECT_EQ(kFrameSize, rtp_packetizer_->send_octet_count()); 194 EXPECT_EQ(kFrameSize, rtp_packetizer_->send_octet_count());
195 EXPECT_EQ(expected_num_of_packets, transport_->number_of_packets_received()); 195 EXPECT_EQ(expected_num_of_packets, transport_->number_of_packets_received());
196 } 196 }
197 197
198 } // namespace cast 198 } // namespace cast
199 } // namespace media 199 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/pacing/paced_sender_unittest.cc ('k') | media/cast/sender/audio_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698