| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |