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

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

Powered by Google App Engine
This is Rietveld 408576698