OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 : BweReceiver(flow_id), last_feedback_ms_(0) { | 119 : BweReceiver(flow_id), last_feedback_ms_(0) { |
120 } | 120 } |
121 | 121 |
122 SendSideBweReceiver::~SendSideBweReceiver() { | 122 SendSideBweReceiver::~SendSideBweReceiver() { |
123 } | 123 } |
124 | 124 |
125 void SendSideBweReceiver::ReceivePacket(int64_t arrival_time_ms, | 125 void SendSideBweReceiver::ReceivePacket(int64_t arrival_time_ms, |
126 const MediaPacket& media_packet) { | 126 const MediaPacket& media_packet) { |
127 packet_feedback_vector_.push_back(PacketInfo( | 127 packet_feedback_vector_.push_back(PacketInfo( |
128 arrival_time_ms, media_packet.sender_timestamp_us() / 1000, | 128 arrival_time_ms, media_packet.sender_timestamp_us() / 1000, |
129 media_packet.header().sequenceNumber, media_packet.payload_size())); | 129 media_packet.header().sequenceNumber, media_packet.payload_size(), true)); |
130 | 130 |
131 received_packets_.Insert(media_packet.sequence_number(), | 131 received_packets_.Insert(media_packet.sequence_number(), |
132 media_packet.send_time_ms(), arrival_time_ms, | 132 media_packet.send_time_ms(), arrival_time_ms, |
133 media_packet.payload_size()); | 133 media_packet.payload_size()); |
134 } | 134 } |
135 | 135 |
136 FeedbackPacket* SendSideBweReceiver::GetFeedback(int64_t now_ms) { | 136 FeedbackPacket* SendSideBweReceiver::GetFeedback(int64_t now_ms) { |
137 if (now_ms - last_feedback_ms_ < kFeedbackIntervalMs) | 137 if (now_ms - last_feedback_ms_ < kFeedbackIntervalMs) |
138 return NULL; | 138 return NULL; |
139 last_feedback_ms_ = now_ms; | 139 last_feedback_ms_ = now_ms; |
140 int64_t corrected_send_time_ms = | 140 int64_t corrected_send_time_ms = |
141 packet_feedback_vector_.back().send_time_ms + now_ms - | 141 packet_feedback_vector_.back().send_time_ms + now_ms - |
142 packet_feedback_vector_.back().arrival_time_ms; | 142 packet_feedback_vector_.back().arrival_time_ms; |
143 FeedbackPacket* fb = new SendSideBweFeedback( | 143 FeedbackPacket* fb = new SendSideBweFeedback( |
144 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); | 144 flow_id_, now_ms * 1000, corrected_send_time_ms, packet_feedback_vector_); |
145 packet_feedback_vector_.clear(); | 145 packet_feedback_vector_.clear(); |
146 return fb; | 146 return fb; |
147 } | 147 } |
148 | 148 |
149 } // namespace bwe | 149 } // namespace bwe |
150 } // namespace testing | 150 } // namespace testing |
151 } // namespace webrtc | 151 } // namespace webrtc |
OLD | NEW |