OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 double RateCounter::BitrateWindowS() const { | 93 double RateCounter::BitrateWindowS() const { |
94 return static_cast<double>(window_size_us_) / (1000 * 1000); | 94 return static_cast<double>(window_size_us_) / (1000 * 1000); |
95 } | 95 } |
96 | 96 |
97 Packet::Packet() | 97 Packet::Packet() |
98 : flow_id_(0), | 98 : flow_id_(0), |
99 creation_time_us_(-1), | 99 creation_time_us_(-1), |
100 send_time_us_(-1), | 100 send_time_us_(-1), |
101 sender_timestamp_us_(-1), | 101 sender_timestamp_us_(-1), |
102 payload_size_(0) {} | 102 payload_size_(0), |
| 103 paced_(false) { |
| 104 } |
103 | 105 |
104 Packet::Packet(int flow_id, int64_t send_time_us, size_t payload_size) | 106 Packet::Packet(int flow_id, int64_t send_time_us, size_t payload_size) |
105 : flow_id_(flow_id), | 107 : flow_id_(flow_id), |
106 creation_time_us_(send_time_us), | 108 creation_time_us_(send_time_us), |
107 send_time_us_(send_time_us), | 109 send_time_us_(send_time_us), |
108 sender_timestamp_us_(send_time_us), | 110 sender_timestamp_us_(send_time_us), |
109 payload_size_(payload_size) {} | 111 payload_size_(payload_size), |
| 112 paced_(false) { |
| 113 } |
110 | 114 |
111 Packet::~Packet() { | 115 Packet::~Packet() { |
112 } | 116 } |
113 | 117 |
114 bool Packet::operator<(const Packet& rhs) const { | 118 bool Packet::operator<(const Packet& rhs) const { |
115 return send_time_us_ < rhs.send_time_us_; | 119 return send_time_us_ < rhs.send_time_us_; |
116 } | 120 } |
117 | 121 |
118 void Packet::set_send_time_us(int64_t send_time_us) { | 122 void Packet::set_send_time_us(int64_t send_time_us) { |
119 assert(send_time_us >= 0); | 123 assert(send_time_us >= 0); |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, | 809 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, |
806 uint32_t remaining_payload) { | 810 uint32_t remaining_payload) { |
807 uint32_t fragments = | 811 uint32_t fragments = |
808 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; | 812 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; |
809 uint32_t avg_size = (frame_size + fragments - 1) / fragments; | 813 uint32_t avg_size = (frame_size + fragments - 1) / fragments; |
810 return std::min(avg_size, remaining_payload); | 814 return std::min(avg_size, remaining_payload); |
811 } | 815 } |
812 } // namespace bwe | 816 } // namespace bwe |
813 } // namespace testing | 817 } // namespace testing |
814 } // namespace webrtc | 818 } // namespace webrtc |
OLD | NEW |