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

Side by Side Diff: media/cast/sender/video_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/sender/frame_sender.h ('k') | no next file » | 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 number_of_rtcp_packets_(0), 54 number_of_rtcp_packets_(0),
55 paused_(false) {} 55 paused_(false) {}
56 56
57 // A singular packet implies a RTCP packet. 57 // A singular packet implies a RTCP packet.
58 bool SendPacket(PacketRef packet, const base::Closure& cb) final { 58 bool SendPacket(PacketRef packet, const base::Closure& cb) final {
59 if (paused_) { 59 if (paused_) {
60 stored_packet_ = packet; 60 stored_packet_ = packet;
61 callback_ = cb; 61 callback_ = cb;
62 return false; 62 return false;
63 } 63 }
64 if (Rtcp::IsRtcpPacket(&packet->data[0], packet->data.size())) { 64 if (IsRtcpPacket(&packet->data[0], packet->data.size())) {
65 ++number_of_rtcp_packets_; 65 ++number_of_rtcp_packets_;
66 } else { 66 } else {
67 // Check that at least one RTCP packet was sent before the first RTP 67 // Check that at least one RTCP packet was sent before the first RTP
68 // packet. This confirms that the receiver will have the necessary lip 68 // packet. This confirms that the receiver will have the necessary lip
69 // sync info before it has to calculate the playout time of the first 69 // sync info before it has to calculate the playout time of the first
70 // frame. 70 // frame.
71 if (number_of_rtp_packets_ == 0) 71 if (number_of_rtp_packets_ == 0)
72 EXPECT_LE(1, number_of_rtcp_packets_); 72 EXPECT_LE(1, number_of_rtcp_packets_);
73 ++number_of_rtp_packets_; 73 ++number_of_rtp_packets_;
74 } 74 }
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 << ", hfr=" << kTestCases[i].high_frame_rate); 656 << ", hfr=" << kTestCases[i].high_frame_rate);
657 const scoped_refptr<VideoFrame> frame = 657 const scoped_refptr<VideoFrame> frame =
658 CreateFakeFrame(resolution, kTestCases[i].high_frame_rate); 658 CreateFakeFrame(resolution, kTestCases[i].high_frame_rate);
659 EXPECT_EQ(kTestCases[i].expected_bitrate, 659 EXPECT_EQ(kTestCases[i].expected_bitrate,
660 PeerVideoSender::GetMaximumTargetBitrateForFrame(*frame)); 660 PeerVideoSender::GetMaximumTargetBitrateForFrame(*frame));
661 } 661 }
662 } 662 }
663 663
664 } // namespace cast 664 } // namespace cast
665 } // namespace media 665 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/frame_sender.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698