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

Side by Side Diff: media/cast/sender/audio_sender_unittest.cc

Issue 1520613004: cast: Split Rtcp into two for sender and receiver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@timestamp
Patch Set: Rebased Created 4 years, 11 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/receiver/frame_receiver.cc ('k') | media/cast/sender/frame_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/sender/audio_sender.h" 5 #include "media/cast/sender/audio_sender.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 24 matching lines...) Expand all
35 *out_status = in_status; 35 *out_status = in_status;
36 } 36 }
37 37
38 } // namespace 38 } // namespace
39 39
40 class TestPacketSender : public PacketSender { 40 class TestPacketSender : public PacketSender {
41 public: 41 public:
42 TestPacketSender() : number_of_rtp_packets_(0), number_of_rtcp_packets_(0) {} 42 TestPacketSender() : number_of_rtp_packets_(0), number_of_rtcp_packets_(0) {}
43 43
44 bool SendPacket(PacketRef packet, const base::Closure& cb) final { 44 bool SendPacket(PacketRef packet, const base::Closure& cb) final {
45 if (Rtcp::IsRtcpPacket(&packet->data[0], packet->data.size())) { 45 if (IsRtcpPacket(&packet->data[0], packet->data.size())) {
46 ++number_of_rtcp_packets_; 46 ++number_of_rtcp_packets_;
47 } else { 47 } else {
48 // Check that at least one RTCP packet was sent before the first RTP 48 // Check that at least one RTCP packet was sent before the first RTP
49 // packet. This confirms that the receiver will have the necessary lip 49 // packet. This confirms that the receiver will have the necessary lip
50 // sync info before it has to calculate the playout time of the first 50 // sync info before it has to calculate the playout time of the first
51 // frame. 51 // frame.
52 if (number_of_rtp_packets_ == 0) 52 if (number_of_rtp_packets_ == 0)
53 EXPECT_LE(1, number_of_rtcp_packets_); 53 EXPECT_LE(1, number_of_rtcp_packets_);
54 ++number_of_rtp_packets_; 54 ++number_of_rtp_packets_;
55 } 55 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 base::TimeDelta max_rtcp_timeout = 154 base::TimeDelta max_rtcp_timeout =
155 base::TimeDelta::FromMilliseconds(1 + kRtcpReportIntervalMs * 3 / 2); 155 base::TimeDelta::FromMilliseconds(1 + kRtcpReportIntervalMs * 3 / 2);
156 testing_clock_->Advance(max_rtcp_timeout); 156 testing_clock_->Advance(max_rtcp_timeout);
157 task_runner_->RunTasks(); 157 task_runner_->RunTasks();
158 EXPECT_LE(1, transport_.number_of_rtp_packets()); 158 EXPECT_LE(1, transport_.number_of_rtp_packets());
159 EXPECT_LE(1, transport_.number_of_rtcp_packets()); 159 EXPECT_LE(1, transport_.number_of_rtcp_packets());
160 } 160 }
161 161
162 } // namespace cast 162 } // namespace cast
163 } // namespace media 163 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/receiver/frame_receiver.cc ('k') | media/cast/sender/frame_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698