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 } | |
105 | 103 |
106 Packet::Packet(int flow_id, int64_t send_time_us, size_t payload_size) | 104 Packet::Packet(int flow_id, int64_t send_time_us, size_t payload_size) |
107 : flow_id_(flow_id), | 105 : flow_id_(flow_id), |
108 creation_time_us_(send_time_us), | 106 creation_time_us_(send_time_us), |
109 send_time_us_(send_time_us), | 107 send_time_us_(send_time_us), |
110 sender_timestamp_us_(send_time_us), | 108 sender_timestamp_us_(send_time_us), |
111 payload_size_(payload_size), | 109 payload_size_(payload_size) {} |
112 paced_(false) { | |
113 } | |
114 | 110 |
115 Packet::~Packet() { | 111 Packet::~Packet() { |
116 } | 112 } |
117 | 113 |
118 bool Packet::operator<(const Packet& rhs) const { | 114 bool Packet::operator<(const Packet& rhs) const { |
119 return send_time_us_ < rhs.send_time_us_; | 115 return send_time_us_ < rhs.send_time_us_; |
120 } | 116 } |
121 | 117 |
122 void Packet::set_send_time_us(int64_t send_time_us) { | 118 void Packet::set_send_time_us(int64_t send_time_us) { |
123 assert(send_time_us >= 0); | 119 assert(send_time_us >= 0); |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, | 805 uint32_t PeriodicKeyFrameSource::NextPacketSize(uint32_t frame_size, |
810 uint32_t remaining_payload) { | 806 uint32_t remaining_payload) { |
811 uint32_t fragments = | 807 uint32_t fragments = |
812 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; | 808 (frame_size + (kMaxPayloadSizeBytes - 1)) / kMaxPayloadSizeBytes; |
813 uint32_t avg_size = (frame_size + fragments - 1) / fragments; | 809 uint32_t avg_size = (frame_size + fragments - 1) / fragments; |
814 return std::min(avg_size, remaining_payload); | 810 return std::min(avg_size, remaining_payload); |
815 } | 811 } |
816 } // namespace bwe | 812 } // namespace bwe |
817 } // namespace testing | 813 } // namespace testing |
818 } // namespace webrtc | 814 } // namespace webrtc |
OLD | NEW |